From 64a2a6e9841edf78f06e0e8277758c92d1590b43 Mon Sep 17 00:00:00 2001 From: meorphis <108296353+meorphis@users.noreply.github.com> Date: Fri, 18 Apr 2025 22:14:41 -0400 Subject: [PATCH 01/33] Update create-releases.yml --- .github/workflows/create-releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index c1ea30fa..929b2934 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -30,7 +30,7 @@ jobs: with: bundler-cache: false ruby-version: '3.1' - - run: |- + run: |- bundle install - name: Publish to RubyGems.org From 2653f09f99292e4da95238b29ec115660e29ab85 Mon Sep 17 00:00:00 2001 From: meorphis <108296353+meorphis@users.noreply.github.com> Date: Fri, 18 Apr 2025 22:15:44 -0400 Subject: [PATCH 02/33] Update create-releases.yml --- .github/workflows/create-releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index 929b2934..d87eec13 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -30,7 +30,7 @@ jobs: with: bundler-cache: false ruby-version: '3.1' - run: |- + run: | bundle install - name: Publish to RubyGems.org From e9ce032e64772294c628937779f14425badaa11f Mon Sep 17 00:00:00 2001 From: meorphis <108296353+meorphis@users.noreply.github.com> Date: Fri, 18 Apr 2025 22:18:56 -0400 Subject: [PATCH 03/33] Update create-releases.yml --- .github/workflows/create-releases.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index d87eec13..4f1e03ce 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -25,16 +25,17 @@ jobs: stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} - name: Set up Ruby - if: ${{ steps.release.outputs.releases_created }} + if: ${{ steps.release.outputs.releases_created }} uses: ruby/setup-ruby@v1 with: bundler-cache: false ruby-version: '3.1' - run: | + + - run: | bundle install - name: Publish to RubyGems.org - if: ${{ steps.release.outputs.releases_created }} + if: ${{ steps.release.outputs.releases_created }} run: | bash ./bin/publish-gem env: From ef2a5d46f21a0df6b4b6ebc4e9d4dd4f6a6a6e5f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 17:32:41 +0000 Subject: [PATCH 04/33] chore(internal): version bump From ca0d841a571433528ae15974041c5ea142f9109e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Apr 2025 01:45:01 +0000 Subject: [PATCH 05/33] chore: explicitly mark apis public under `Internal` module --- .yardopts | 1 + lib/openai/client.rb | 8 ++++---- lib/openai/internal.rb | 1 - lib/openai/internal/type/array_of.rb | 6 ++++++ lib/openai/internal/type/base_model.rb | 18 +++++++++++++++++- lib/openai/internal/type/base_page.rb | 8 ++++++++ lib/openai/internal/type/base_stream.rb | 8 ++++++++ lib/openai/internal/type/boolean.rb | 4 ++++ lib/openai/internal/type/enum.rb | 6 ++++++ lib/openai/internal/type/hash_of.rb | 6 ++++++ lib/openai/internal/type/io_like.rb | 4 ++++ lib/openai/internal/type/union.rb | 6 ++++++ lib/openai/internal/type/unknown.rb | 4 ++++ .../chat_completion_assistant_message_param.rb | 2 ++ .../models/chat/chat_completion_chunk.rb | 2 ++ .../models/chat/chat_completion_message.rb | 2 ++ .../models/chat/completion_create_params.rb | 6 ++++++ lib/openai/models/file_object.rb | 4 ++++ .../models/fine_tuning/job_create_params.rb | 2 ++ lib/openai/models/reasoning.rb | 2 ++ rbi/lib/openai/client.rbi | 8 ++++---- rbi/lib/openai/internal.rbi | 1 - rbi/lib/openai/internal/type/base_model.rbi | 1 - rbi/lib/openai/internal/type/base_page.rbi | 2 ++ rbi/lib/openai/internal/type/base_stream.rbi | 2 ++ 25 files changed, 102 insertions(+), 12 deletions(-) diff --git a/.yardopts b/.yardopts index 5757768a..84c12f2a 100644 --- a/.yardopts +++ b/.yardopts @@ -1,4 +1,5 @@ --type-name-tag generic:Generic +--default-return void --markup markdown --markup-provider redcarpet --exclude /rbi diff --git a/lib/openai/client.rb b/lib/openai/client.rb index 15aa8d39..c79c1a83 100644 --- a/lib/openai/client.rb +++ b/lib/openai/client.rb @@ -101,10 +101,10 @@ def initialize( organization: ENV["OPENAI_ORG_ID"], project: ENV["OPENAI_PROJECT_ID"], base_url: ENV["OPENAI_BASE_URL"], - max_retries: DEFAULT_MAX_RETRIES, - timeout: DEFAULT_TIMEOUT_IN_SECONDS, - initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, - max_retry_delay: DEFAULT_MAX_RETRY_DELAY + max_retries: OpenAI::Client::DEFAULT_MAX_RETRIES, + timeout: OpenAI::Client::DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: OpenAI::Client::DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: OpenAI::Client::DEFAULT_MAX_RETRY_DELAY ) base_url ||= "https://api.openai.com/v1" diff --git a/lib/openai/internal.rb b/lib/openai/internal.rb index 32bc2cf5..143e002b 100644 --- a/lib/openai/internal.rb +++ b/lib/openai/internal.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true module OpenAI - # @api private module Internal OMIT = Object.new.tap do diff --git a/lib/openai/internal/type/array_of.rb b/lib/openai/internal/type/array_of.rb index d0d77538..dcfc2f95 100644 --- a/lib/openai/internal/type/array_of.rb +++ b/lib/openai/internal/type/array_of.rb @@ -30,11 +30,15 @@ class ArrayOf # @option spec [Boolean] :"nil?" def self.[](...) = new(...) + # @api public + # # @param other [Object] # # @return [Boolean] def ===(other) = other.is_a?(Array) && other.all?(item_type) + # @api public + # # @param other [Object] # # @return [Boolean] @@ -44,6 +48,8 @@ def ==(other) # rubocop:enable Layout/LineLength end + # @api public + # # @return [Integer] def hash = [self.class, item_type].hash diff --git a/lib/openai/internal/type/base_model.rb b/lib/openai/internal/type/base_model.rb index 043039d4..b356a480 100644 --- a/lib/openai/internal/type/base_model.rb +++ b/lib/openai/internal/type/base_model.rb @@ -159,6 +159,8 @@ def optional(name_sym, type_info, spec = {}) @mode = nil end + # @api public + # # @param other [Object] # # @return [Boolean] @@ -166,15 +168,21 @@ def ==(other) other.is_a?(Class) && other <= OpenAI::Internal::Type::BaseModel && other.fields == fields end + # @api public + # # @return [Integer] def hash = fields.hash end + # @api public + # # @param other [Object] # # @return [Boolean] def ==(other) = self.class == other.class && @data == other.to_h + # @api public + # # @return [Integer] def hash = [self.class, @data].hash @@ -291,6 +299,8 @@ def dump(value, state:) end end + # @api public + # # Returns the raw value associated with the given key, if found. Otherwise, nil is # returned. # @@ -309,6 +319,8 @@ def [](key) @data[key] end + # @api public + # # Returns a Hash of the data underlying this object. O(1) # # Keys are Symbols and values are the raw values from the response. The return @@ -361,11 +373,15 @@ def walk(model) end end + # @api public + # # @param a [Object] # # @return [String] def to_json(*a) = OpenAI::Internal::Type::Converter.dump(self.class, self).to_json(*a) + # @api public + # # @param a [Object] # # @return [String] @@ -407,7 +423,7 @@ def inspect(depth: 0) end end - # @api private + # @api public # # @return [String] def to_s = self.class.walk(@data).to_s diff --git a/lib/openai/internal/type/base_page.rb b/lib/openai/internal/type/base_page.rb index 48c98885..e17895f2 100644 --- a/lib/openai/internal/type/base_page.rb +++ b/lib/openai/internal/type/base_page.rb @@ -3,19 +3,27 @@ module OpenAI module Internal module Type + # @api private + # # @generic Elem # # This module provides a base implementation for paginated responses in the SDK. module BasePage # rubocop:disable Lint/UnusedMethodArgument + # @api public + # # @return [Boolean] def next_page? = (raise NotImplementedError) + # @api public + # # @raise [OpenAI::Errors::APIError] # @return [OpenAI::Internal::Type::BasePage] def next_page = (raise NotImplementedError) + # @api public + # # @param blk [Proc] # # @yieldparam [generic] diff --git a/lib/openai/internal/type/base_stream.rb b/lib/openai/internal/type/base_stream.rb index ebcb564c..580ba8ab 100644 --- a/lib/openai/internal/type/base_stream.rb +++ b/lib/openai/internal/type/base_stream.rb @@ -3,6 +3,8 @@ module OpenAI module Internal module Type + # @api private + # # @generic Elem # # This module provides a base implementation for streaming responses in the SDK. @@ -26,6 +28,8 @@ class << self def defer_closing(stream) = ->(_id) { OpenAI::Internal::Util.close_fused!(stream) } end + # @api public + # # @return [void] def close = OpenAI::Internal::Util.close_fused!(@iterator) @@ -34,6 +38,8 @@ def close = OpenAI::Internal::Util.close_fused!(@iterator) # @return [Enumerable>] private def iterator = (raise NotImplementedError) + # @api public + # # @param blk [Proc] # # @yieldparam [generic] @@ -45,6 +51,8 @@ def each(&blk) @iterator.each(&blk) end + # @api public + # # @return [Enumerator>] def to_enum = @iterator diff --git a/lib/openai/internal/type/boolean.rb b/lib/openai/internal/type/boolean.rb index 298979c8..13c242e0 100644 --- a/lib/openai/internal/type/boolean.rb +++ b/lib/openai/internal/type/boolean.rb @@ -13,11 +13,15 @@ class Boolean private_class_method :new + # @api public + # # @param other [Object] # # @return [Boolean] def self.===(other) = other == true || other == false + # @api public + # # @param other [Object] # # @return [Boolean] diff --git a/lib/openai/internal/type/enum.rb b/lib/openai/internal/type/enum.rb index afdeb5f9..55df3e66 100644 --- a/lib/openai/internal/type/enum.rb +++ b/lib/openai/internal/type/enum.rb @@ -48,11 +48,15 @@ module Enum # @return [Array] def values = constants.map { const_get(_1) } + # @api public + # # @param other [Object] # # @return [Boolean] def ===(other) = values.include?(other) + # @api public + # # @param other [Object] # # @return [Boolean] @@ -62,6 +66,8 @@ def ==(other) # rubocop:enable Style/CaseEquality end + # @api public + # # @return [Integer] def hash = values.to_set.hash diff --git a/lib/openai/internal/type/hash_of.rb b/lib/openai/internal/type/hash_of.rb index 40c7a89a..b586a220 100644 --- a/lib/openai/internal/type/hash_of.rb +++ b/lib/openai/internal/type/hash_of.rb @@ -30,6 +30,8 @@ class HashOf # @option spec [Boolean] :"nil?" def self.[](...) = new(...) + # @api public + # # @param other [Object] # # @return [Boolean] @@ -50,6 +52,8 @@ def ===(other) end end + # @api public + # # @param other [Object] # # @return [Boolean] @@ -59,6 +63,8 @@ def ==(other) # rubocop:enable Layout/LineLength end + # @api public + # # @return [Integer] def hash = [self.class, item_type].hash diff --git a/lib/openai/internal/type/io_like.rb b/lib/openai/internal/type/io_like.rb index 43aba589..568418be 100644 --- a/lib/openai/internal/type/io_like.rb +++ b/lib/openai/internal/type/io_like.rb @@ -13,6 +13,8 @@ class IOLike private_class_method :new + # @api public + # # @param other [Object] # # @return [Boolean] @@ -25,6 +27,8 @@ def self.===(other) end end + # @api public + # # @param other [Object] # # @return [Boolean] diff --git a/lib/openai/internal/type/union.rb b/lib/openai/internal/type/union.rb index 5f9048cf..3db41ef0 100644 --- a/lib/openai/internal/type/union.rb +++ b/lib/openai/internal/type/union.rb @@ -112,6 +112,8 @@ def variants = derefed_variants.map(&:last) # rubocop:disable Style/HashEachMethods # rubocop:disable Style/CaseEquality + # @api public + # # @param other [Object] # # @return [Boolean] @@ -121,6 +123,8 @@ def ===(other) end end + # @api public + # # @param other [Object] # # @return [Boolean] @@ -128,6 +132,8 @@ def ==(other) OpenAI::Internal::Type::Union === other && other.derefed_variants == derefed_variants end + # @api public + # # @return [Integer] def hash = variants.hash diff --git a/lib/openai/internal/type/unknown.rb b/lib/openai/internal/type/unknown.rb index 36556ac1..698303d5 100644 --- a/lib/openai/internal/type/unknown.rb +++ b/lib/openai/internal/type/unknown.rb @@ -15,11 +15,15 @@ class Unknown private_class_method :new + # @api public + # # @param other [Object] # # @return [Boolean] def self.===(other) = true + # @api public + # # @param other [Object] # # @return [Boolean] diff --git a/lib/openai/models/chat/chat_completion_assistant_message_param.rb b/lib/openai/models/chat/chat_completion_assistant_message_param.rb index 8cd2c5c2..a139420e 100644 --- a/lib/openai/models/chat/chat_completion_assistant_message_param.rb +++ b/lib/openai/models/chat/chat_completion_assistant_message_param.rb @@ -27,6 +27,8 @@ class ChatCompletionAssistantMessageParam < OpenAI::Internal::Type::BaseModel nil?: true # @!attribute function_call + # @deprecated + # # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. # diff --git a/lib/openai/models/chat/chat_completion_chunk.rb b/lib/openai/models/chat/chat_completion_chunk.rb index 77585995..05970b9f 100644 --- a/lib/openai/models/chat/chat_completion_chunk.rb +++ b/lib/openai/models/chat/chat_completion_chunk.rb @@ -141,6 +141,8 @@ class Delta < OpenAI::Internal::Type::BaseModel optional :content, String, nil?: true # @!attribute function_call + # @deprecated + # # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. # diff --git a/lib/openai/models/chat/chat_completion_message.rb b/lib/openai/models/chat/chat_completion_message.rb index 3d874f33..21ca6db0 100644 --- a/lib/openai/models/chat/chat_completion_message.rb +++ b/lib/openai/models/chat/chat_completion_message.rb @@ -39,6 +39,8 @@ class ChatCompletionMessage < OpenAI::Internal::Type::BaseModel optional :audio, -> { OpenAI::Models::Chat::ChatCompletionAudio }, nil?: true # @!attribute function_call + # @deprecated + # # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. # diff --git a/lib/openai/models/chat/completion_create_params.rb b/lib/openai/models/chat/completion_create_params.rb index 999209e1..045de7a8 100644 --- a/lib/openai/models/chat/completion_create_params.rb +++ b/lib/openai/models/chat/completion_create_params.rb @@ -49,6 +49,8 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel optional :frequency_penalty, Float, nil?: true # @!attribute function_call + # @deprecated + # # Deprecated in favor of `tool_choice`. # # Controls which (if any) function is called by the model. @@ -68,6 +70,8 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel optional :function_call, union: -> { OpenAI::Models::Chat::CompletionCreateParams::FunctionCall } # @!attribute functions + # @deprecated + # # Deprecated in favor of `tools`. # # A list of functions the model may generate JSON inputs for. @@ -106,6 +110,8 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel optional :max_completion_tokens, Integer, nil?: true # @!attribute max_tokens + # @deprecated + # # The maximum number of [tokens](/tokenizer) that can be generated in the chat # completion. This value can be used to control # [costs](https://openai.com/api/pricing/) for text generated via API. diff --git a/lib/openai/models/file_object.rb b/lib/openai/models/file_object.rb index 5031a63d..b6825ae1 100644 --- a/lib/openai/models/file_object.rb +++ b/lib/openai/models/file_object.rb @@ -43,6 +43,8 @@ class FileObject < OpenAI::Internal::Type::BaseModel required :purpose, enum: -> { OpenAI::Models::FileObject::Purpose } # @!attribute status + # @deprecated + # # Deprecated. The current status of the file, which can be either `uploaded`, # `processed`, or `error`. # @@ -56,6 +58,8 @@ class FileObject < OpenAI::Internal::Type::BaseModel optional :expires_at, Integer # @!attribute status_details + # @deprecated + # # Deprecated. For details on why a fine-tuning training file failed validation, # see the `error` field on `fine_tuning.job`. # diff --git a/lib/openai/models/fine_tuning/job_create_params.rb b/lib/openai/models/fine_tuning/job_create_params.rb index ada446ed..2078e4bd 100644 --- a/lib/openai/models/fine_tuning/job_create_params.rb +++ b/lib/openai/models/fine_tuning/job_create_params.rb @@ -38,6 +38,8 @@ class JobCreateParams < OpenAI::Internal::Type::BaseModel required :training_file, String # @!attribute hyperparameters + # @deprecated + # # The hyperparameters used for the fine-tuning job. This value is now deprecated # in favor of `method`, and should be passed in under the `method` parameter. # diff --git a/lib/openai/models/reasoning.rb b/lib/openai/models/reasoning.rb index 5aa982ea..3457ccea 100644 --- a/lib/openai/models/reasoning.rb +++ b/lib/openai/models/reasoning.rb @@ -15,6 +15,8 @@ class Reasoning < OpenAI::Internal::Type::BaseModel optional :effort, enum: -> { OpenAI::Models::ReasoningEffort }, nil?: true # @!attribute generate_summary + # @deprecated + # # **Deprecated:** use `summary` instead. # # A summary of the reasoning performed by the model. This can be useful for diff --git a/rbi/lib/openai/client.rbi b/rbi/lib/openai/client.rbi index 64aba6c1..b70ce71a 100644 --- a/rbi/lib/openai/client.rbi +++ b/rbi/lib/openai/client.rbi @@ -93,10 +93,10 @@ module OpenAI # `"https://api.example.com/v2/"`. Defaults to `ENV["OPENAI_BASE_URL"]` base_url: ENV["OPENAI_BASE_URL"], # Max number of retries to attempt after a failed retryable request. - max_retries: DEFAULT_MAX_RETRIES, - timeout: DEFAULT_TIMEOUT_IN_SECONDS, - initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, - max_retry_delay: DEFAULT_MAX_RETRY_DELAY + max_retries: OpenAI::Client::DEFAULT_MAX_RETRIES, + timeout: OpenAI::Client::DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: OpenAI::Client::DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: OpenAI::Client::DEFAULT_MAX_RETRY_DELAY ); end end end diff --git a/rbi/lib/openai/internal.rbi b/rbi/lib/openai/internal.rbi index 05388159..8390947e 100644 --- a/rbi/lib/openai/internal.rbi +++ b/rbi/lib/openai/internal.rbi @@ -1,7 +1,6 @@ # typed: strong module OpenAI - # @api private module Internal # Due to the current WIP status of Shapes support in Sorbet, types referencing # this alias might be refined in the future. diff --git a/rbi/lib/openai/internal/type/base_model.rbi b/rbi/lib/openai/internal/type/base_model.rbi index cf8285ae..d97f840f 100644 --- a/rbi/lib/openai/internal/type/base_model.rbi +++ b/rbi/lib/openai/internal/type/base_model.rbi @@ -203,7 +203,6 @@ module OpenAI def inspect(depth: 0); end end - # @api private sig { returns(String) } def to_s; end diff --git a/rbi/lib/openai/internal/type/base_page.rbi b/rbi/lib/openai/internal/type/base_page.rbi index 3906abb9..6a3257fe 100644 --- a/rbi/lib/openai/internal/type/base_page.rbi +++ b/rbi/lib/openai/internal/type/base_page.rbi @@ -3,6 +3,8 @@ module OpenAI module Internal module Type + # @api private + # # This module provides a base implementation for paginated responses in the SDK. module BasePage Elem = type_member(:out) diff --git a/rbi/lib/openai/internal/type/base_stream.rbi b/rbi/lib/openai/internal/type/base_stream.rbi index 8dcf7413..ff3f1d51 100644 --- a/rbi/lib/openai/internal/type/base_stream.rbi +++ b/rbi/lib/openai/internal/type/base_stream.rbi @@ -3,6 +3,8 @@ module OpenAI module Internal module Type + # @api private + # # This module provides a base implementation for streaming responses in the SDK. module BaseStream include Enumerable From 67b0e35c2c8d48c50c71c20a71304896a63f6b44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 15:54:15 +0000 Subject: [PATCH 06/33] chore(internal): minor type annotation improvements --- Steepfile | 2 +- lib/openai/internal/cursor_page.rb | 2 +- lib/openai/internal/page.rb | 2 +- lib/openai/internal/transport/base_client.rb | 8 ++++---- lib/openai/internal/type/array_of.rb | 2 ++ lib/openai/internal/type/base_model.rb | 2 +- lib/openai/internal/type/base_page.rb | 2 +- lib/openai/internal/type/hash_of.rb | 2 ++ 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Steepfile b/Steepfile index 6e5d0ac5..d7aebca1 100644 --- a/Steepfile +++ b/Steepfile @@ -2,7 +2,7 @@ require "yaml" -target :lib do +target(:lib) do configure_code_diagnostics(Steep::Diagnostic::Ruby.strict) signature("sig") diff --git a/lib/openai/internal/cursor_page.rb b/lib/openai/internal/cursor_page.rb index eb661553..3cb0654b 100644 --- a/lib/openai/internal/cursor_page.rb +++ b/lib/openai/internal/cursor_page.rb @@ -28,7 +28,7 @@ def next_page? end # @raise [OpenAI::HTTP::Error] - # @return [OpenAI::Internal::CursorPage] + # @return [self] def next_page unless next_page? message = "No more pages available. Please check #next_page? before calling ##{__method__}" diff --git a/lib/openai/internal/page.rb b/lib/openai/internal/page.rb index 7df85077..f3792c4c 100644 --- a/lib/openai/internal/page.rb +++ b/lib/openai/internal/page.rb @@ -28,7 +28,7 @@ def next_page? end # @raise [OpenAI::HTTP::Error] - # @return [OpenAI::Internal::Page] + # @return [self] def next_page RuntimeError.new("No more pages available.") end diff --git a/lib/openai/internal/transport/base_client.rb b/lib/openai/internal/transport/base_client.rb index 30b12835..f3fd4559 100644 --- a/lib/openai/internal/transport/base_client.rb +++ b/lib/openai/internal/transport/base_client.rb @@ -216,9 +216,9 @@ def initialize( # # @option req [Symbol, nil] :unwrap # - # @option req [Class, nil] :page + # @option req [Class, nil] :page # - # @option req [Class, nil] :stream + # @option req [Class, nil] :stream # # @option req [OpenAI::Internal::Type::Converter, Class, nil] :model # @@ -417,9 +417,9 @@ def initialize( # # @param unwrap [Symbol, nil] # - # @param page [Class, nil] + # @param page [Class, nil] # - # @param stream [Class, nil] + # @param stream [Class, nil] # # @param model [OpenAI::Internal::Type::Converter, Class, nil] # diff --git a/lib/openai/internal/type/array_of.rb b/lib/openai/internal/type/array_of.rb index dcfc2f95..5b1a4113 100644 --- a/lib/openai/internal/type/array_of.rb +++ b/lib/openai/internal/type/array_of.rb @@ -28,6 +28,8 @@ class ArrayOf # @option spec [Proc] :union # # @option spec [Boolean] :"nil?" + # + # @return [OpenAI::Internal::Type::ArrayOf] def self.[](...) = new(...) # @api public diff --git a/lib/openai/internal/type/base_model.rb b/lib/openai/internal/type/base_model.rb index b356a480..af231837 100644 --- a/lib/openai/internal/type/base_model.rb +++ b/lib/openai/internal/type/base_model.rb @@ -389,7 +389,7 @@ def to_yaml(*a) = OpenAI::Internal::Type::Converter.dump(self.class, self).to_ya # Create a new instance of a model. # - # @param data [Hash{Symbol=>Object}, OpenAI::Internal::Type::BaseModel] + # @param data [Hash{Symbol=>Object}, self] def initialize(data = {}) case OpenAI::Internal::Util.coerce_hash(data) in Hash => coerced diff --git a/lib/openai/internal/type/base_page.rb b/lib/openai/internal/type/base_page.rb index e17895f2..3ebca02d 100644 --- a/lib/openai/internal/type/base_page.rb +++ b/lib/openai/internal/type/base_page.rb @@ -19,7 +19,7 @@ def next_page? = (raise NotImplementedError) # @api public # # @raise [OpenAI::Errors::APIError] - # @return [OpenAI::Internal::Type::BasePage] + # @return [self] def next_page = (raise NotImplementedError) # @api public diff --git a/lib/openai/internal/type/hash_of.rb b/lib/openai/internal/type/hash_of.rb index b586a220..20280b5b 100644 --- a/lib/openai/internal/type/hash_of.rb +++ b/lib/openai/internal/type/hash_of.rb @@ -28,6 +28,8 @@ class HashOf # @option spec [Proc] :union # # @option spec [Boolean] :"nil?" + # + # @return [OpenAI::Internal::Type::HashOf] def self.[](...) = new(...) # @api public From 6fba7b2a1d4043b3ee41f49da43a50c305d613d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 20:13:34 +0000 Subject: [PATCH 07/33] chore(ci): add timeout thresholds for CI jobs --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2c0c8f7..4f7276bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: lint: + timeout-minutes: 10 name: lint runs-on: ubuntu-latest steps: @@ -25,6 +26,7 @@ jobs: - name: Run lints run: ./scripts/lint test: + timeout-minutes: 10 name: test runs-on: ubuntu-latest steps: From 641f4eb0fadf75909a32dc48644bf0e220fbbe81 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:30:52 +0000 Subject: [PATCH 08/33] feat(api): adding new image model support --- .stats.yml | 6 +- lib/openai.rb | 4 + .../beta/thread_create_and_run_params.rb | 15 +- lib/openai/models/eval_create_params.rb | 431 ++++++---- lib/openai/models/eval_create_response.rb | 218 ++++- lib/openai/models/eval_label_model_grader.rb | 226 ++--- lib/openai/models/eval_list_response.rb | 218 ++++- lib/openai/models/eval_retrieve_response.rb | 220 ++++- .../models/eval_text_similarity_grader.rb | 9 +- lib/openai/models/eval_update_response.rb | 218 ++++- ...create_eval_completions_run_data_source.rb | 492 +++++------ .../models/evals/run_cancel_response.rb | 454 +++++++++- lib/openai/models/evals/run_create_params.rb | 473 ++++++++++- .../models/evals/run_create_response.rb | 454 +++++++++- lib/openai/models/evals/run_list_params.rb | 8 +- lib/openai/models/evals/run_list_response.rb | 450 +++++++++- .../models/evals/run_retrieve_response.rb | 456 +++++++++- .../checkpoints/permission_delete_params.rb | 8 +- lib/openai/models/image.rb | 14 +- .../models/image_create_variation_params.rb | 3 +- lib/openai/models/image_edit_params.rb | 89 +- lib/openai/models/image_generate_params.rb | 175 +++- lib/openai/models/image_model.rb | 1 + lib/openai/models/images_response.rb | 73 +- ...onse_reasoning_summary_part_added_event.rb | 69 ++ ...ponse_reasoning_summary_part_done_event.rb | 69 ++ ...onse_reasoning_summary_text_delta_event.rb | 48 ++ ...ponse_reasoning_summary_text_done_event.rb | 48 ++ .../models/responses/response_stream_event.rb | 18 +- lib/openai/resources/evals.rb | 7 +- lib/openai/resources/evals/runs.rb | 2 +- .../fine_tuning/checkpoints/permissions.rb | 18 +- lib/openai/resources/images.rb | 19 +- lib/openai/resources/responses.rb | 2 +- .../beta/thread_create_and_run_params.rbi | 12 - rbi/lib/openai/models/eval_create_params.rbi | 636 ++++++++------ .../openai/models/eval_create_response.rbi | 315 ++++++- .../openai/models/eval_label_model_grader.rbi | 316 ++----- rbi/lib/openai/models/eval_list_response.rbi | 309 ++++++- .../openai/models/eval_retrieve_response.rbi | 326 +++++++- .../models/eval_text_similarity_grader.rbi | 9 +- .../openai/models/eval_update_response.rbi | 315 ++++++- ...reate_eval_completions_run_data_source.rbi | 786 +++++++----------- .../models/evals/run_cancel_response.rbi | 662 ++++++++++++++- .../openai/models/evals/run_create_params.rbi | 698 +++++++++++++++- .../models/evals/run_create_response.rbi | 662 ++++++++++++++- .../openai/models/evals/run_list_params.rbi | 8 +- .../openai/models/evals/run_list_response.rbi | 662 ++++++++++++++- .../models/evals/run_retrieve_response.rbi | 662 ++++++++++++++- .../checkpoints/permission_delete_params.rbi | 18 +- rbi/lib/openai/models/image.rbi | 14 +- .../models/image_create_variation_params.rbi | 3 +- rbi/lib/openai/models/image_edit_params.rbi | 88 +- .../openai/models/image_generate_params.rbi | 185 ++++- rbi/lib/openai/models/image_model.rbi | 1 + rbi/lib/openai/models/images_response.rbi | 100 ++- ...nse_reasoning_summary_part_added_event.rbi | 88 ++ ...onse_reasoning_summary_part_done_event.rbi | 88 ++ ...nse_reasoning_summary_text_delta_event.rbi | 55 ++ ...onse_reasoning_summary_text_done_event.rbi | 55 ++ .../responses/response_stream_event.rbi | 2 +- rbi/lib/openai/resources/evals.rbi | 9 +- rbi/lib/openai/resources/evals/runs.rbi | 7 +- .../fine_tuning/checkpoints/permissions.rbi | 5 +- rbi/lib/openai/resources/images.rbi | 105 ++- rbi/lib/openai/resources/responses.rbi | 4 + .../beta/thread_create_and_run_params.rbs | 17 +- sig/openai/models/eval_create_params.rbs | 281 ++++--- sig/openai/models/eval_create_response.rbs | 161 +++- sig/openai/models/eval_label_model_grader.rbs | 169 ++-- sig/openai/models/eval_list_response.rbs | 161 +++- sig/openai/models/eval_retrieve_response.rbs | 161 +++- .../models/eval_text_similarity_grader.rbs | 2 - sig/openai/models/eval_update_response.rbs | 161 +++- ...reate_eval_completions_run_data_source.rbs | 370 ++++----- .../models/evals/run_cancel_response.rbs | 341 +++++++- sig/openai/models/evals/run_create_params.rbs | 351 +++++++- .../models/evals/run_create_response.rbs | 341 +++++++- sig/openai/models/evals/run_list_response.rbs | 341 +++++++- .../models/evals/run_retrieve_response.rbs | 341 +++++++- .../checkpoints/permission_delete_params.rbs | 10 +- sig/openai/models/image_edit_params.rbs | 36 +- sig/openai/models/image_generate_params.rbs | 79 +- sig/openai/models/image_model.rbs | 3 +- sig/openai/models/images_response.rbs | 61 +- ...nse_reasoning_summary_part_added_event.rbs | 48 ++ ...onse_reasoning_summary_part_done_event.rbs | 48 ++ ...nse_reasoning_summary_text_delta_event.rbs | 36 + ...onse_reasoning_summary_text_done_event.rbs | 36 + .../responses/response_stream_event.rbs | 6 +- sig/openai/resources/beta/threads.rbs | 4 +- sig/openai/resources/evals.rbs | 1 - .../fine_tuning/checkpoints/permissions.rbs | 3 +- sig/openai/resources/images.rbs | 9 +- test/openai/resources/evals_test.rb | 4 - .../checkpoints/permissions_test.rb | 9 +- test/openai/resources/images_test.rb | 9 +- 97 files changed, 13333 insertions(+), 2487 deletions(-) create mode 100644 lib/openai/models/responses/response_reasoning_summary_part_added_event.rb create mode 100644 lib/openai/models/responses/response_reasoning_summary_part_done_event.rb create mode 100644 lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb create mode 100644 lib/openai/models/responses/response_reasoning_summary_text_done_event.rb create mode 100644 rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi create mode 100644 rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi create mode 100644 rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi create mode 100644 rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi create mode 100644 sig/openai/models/responses/response_reasoning_summary_part_added_event.rbs create mode 100644 sig/openai/models/responses/response_reasoning_summary_part_done_event.rbs create mode 100644 sig/openai/models/responses/response_reasoning_summary_text_delta_event.rbs create mode 100644 sig/openai/models/responses/response_reasoning_summary_text_done_event.rbs diff --git a/.stats.yml b/.stats.yml index c3609ee0..7738ef3d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 95 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5633633cc38734869cf7d993f7b549bb8e4d10e0ec45381ec2cd91507cd8eb8f.yml -openapi_spec_hash: c855121b2b2324b99499c9244c21d24d -config_hash: d20837393b73efdb19cd08e04c1cc9a1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-8b68ae6b807dca92e914da1dd9e835a20f69b075e79102a264367fd7fddddb33.yml +openapi_spec_hash: b6ade5b1a6327339e6669e1134de2d03 +config_hash: b597cd9a31e9e5ec709e2eefb4c54122 diff --git a/lib/openai.rb b/lib/openai.rb index 68a9c048..5bd82a3c 100644 --- a/lib/openai.rb +++ b/lib/openai.rb @@ -363,6 +363,10 @@ require_relative "openai/models/responses/response_output_refusal" require_relative "openai/models/responses/response_output_text" require_relative "openai/models/responses/response_reasoning_item" +require_relative "openai/models/responses/response_reasoning_summary_part_added_event" +require_relative "openai/models/responses/response_reasoning_summary_part_done_event" +require_relative "openai/models/responses/response_reasoning_summary_text_delta_event" +require_relative "openai/models/responses/response_reasoning_summary_text_done_event" require_relative "openai/models/responses/response_refusal_delta_event" require_relative "openai/models/responses/response_refusal_done_event" require_relative "openai/models/responses/response_retrieve_params" diff --git a/lib/openai/models/beta/thread_create_and_run_params.rb b/lib/openai/models/beta/thread_create_and_run_params.rb index 131ba814..979eb39f 100644 --- a/lib/openai/models/beta/thread_create_and_run_params.rb +++ b/lib/openai/models/beta/thread_create_and_run_params.rb @@ -140,7 +140,7 @@ class ThreadCreateAndRunParams < OpenAI::Internal::Type::BaseModel # # @return [Array, nil] optional :tools, - -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::ThreadCreateAndRunParams::Tool] }, + -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::AssistantTool] }, nil?: true # @!attribute top_p @@ -584,19 +584,6 @@ class FileSearch < OpenAI::Internal::Type::BaseModel end end - module Tool - extend OpenAI::Internal::Type::Union - - variant -> { OpenAI::Models::Beta::CodeInterpreterTool } - - variant -> { OpenAI::Models::Beta::FileSearchTool } - - variant -> { OpenAI::Models::Beta::FunctionTool } - - # @!method self.variants - # @return [Array(OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool)] - end - class TruncationStrategy < OpenAI::Internal::Type::BaseModel # @!attribute type # The truncation strategy to use for the thread. The default is `auto`. If set to diff --git a/lib/openai/models/eval_create_params.rb b/lib/openai/models/eval_create_params.rb index 54d31b12..5f686026 100644 --- a/lib/openai/models/eval_create_params.rb +++ b/lib/openai/models/eval_create_params.rb @@ -10,13 +10,13 @@ class EvalCreateParams < OpenAI::Internal::Type::BaseModel # @!attribute data_source_config # The configuration for the data source used for the evaluation runs. # - # @return [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions] + # @return [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] required :data_source_config, union: -> { OpenAI::Models::EvalCreateParams::DataSourceConfig } # @!attribute testing_criteria # A list of graders for all eval runs in this group. # - # @return [Array] + # @return [Array] required :testing_criteria, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalCreateParams::TestingCriterion] } @@ -37,18 +37,11 @@ class EvalCreateParams < OpenAI::Internal::Type::BaseModel # @return [String, nil] optional :name, String - # @!attribute share_with_openai - # Indicates whether the evaluation is shared with OpenAI. - # - # @return [Boolean, nil] - optional :share_with_openai, OpenAI::Internal::Type::Boolean - - # @!method initialize(data_source_config:, testing_criteria:, metadata: nil, name: nil, share_with_openai: nil, request_options: {}) - # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions] - # @param testing_criteria [Array] + # @!method initialize(data_source_config:, testing_criteria:, metadata: nil, name: nil, request_options: {}) + # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] + # @param testing_criteria [Array] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] - # @param share_with_openai [Boolean] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The configuration for the data source used for the evaluation runs. @@ -65,11 +58,11 @@ module DataSourceConfig # A data source config which specifies the metadata property of your stored completions query. # This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. - variant :stored_completions, -> { OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions } + variant :logs, -> { OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs } class Custom < OpenAI::Internal::Type::BaseModel # @!attribute item_schema - # The json schema for the run data source items. + # The json schema for each row in the data source. # # @return [Hash{Symbol=>Object}] required :item_schema, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] @@ -81,7 +74,8 @@ class Custom < OpenAI::Internal::Type::BaseModel required :type, const: :custom # @!attribute include_sample_schema - # Whether to include the sample schema in the data source. + # Whether the eval should expect you to populate the sample namespace (ie, by + # generating responses off of your data source) # # @return [Boolean, nil] optional :include_sample_schema, OpenAI::Internal::Type::Boolean @@ -99,35 +93,30 @@ class Custom < OpenAI::Internal::Type::BaseModel # @param type [Symbol, :custom] end - class StoredCompletions < OpenAI::Internal::Type::BaseModel + class Logs < OpenAI::Internal::Type::BaseModel # @!attribute type - # The type of data source. Always `stored_completions`. + # The type of data source. Always `logs`. # - # @return [Symbol, :stored_completions] - required :type, const: :stored_completions + # @return [Symbol, :logs] + required :type, const: :logs # @!attribute metadata - # Set of 16 key-value pairs that can be attached to an object. This can be useful - # for storing additional information about the object in a structured format, and - # querying for objects via API or the dashboard. + # Metadata filters for the logs data source. # - # Keys are strings with a maximum length of 64 characters. Values are strings with - # a maximum length of 512 characters. - # - # @return [Hash{Symbol=>String}, nil] - optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true + # @return [Hash{Symbol=>Object}, nil] + optional :metadata, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] - # @!method initialize(metadata: nil, type: :stored_completions) + # @!method initialize(metadata: nil, type: :logs) # A data source config which specifies the metadata property of your stored # completions query. This is usually metadata like `usecase=chatbot` or # `prompt-version=v2`, etc. # - # @param metadata [Hash{Symbol=>String}, nil] - # @param type [Symbol, :stored_completions] + # @param metadata [Hash{Symbol=>Object}] + # @param type [Symbol, :logs] end # @!method self.variants - # @return [Array(OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions)] + # @return [Array(OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs)] end # A LabelModelGrader object which uses a model to assign labels to each item in @@ -147,10 +136,18 @@ module TestingCriterion # A TextSimilarityGrader object which grades text based on similarity metrics. variant :text_similarity, -> { OpenAI::Models::EvalTextSimilarityGrader } + # A PythonGrader object that runs a python script on the input. + variant :python, -> { OpenAI::Models::EvalCreateParams::TestingCriterion::Python } + + # A ScoreModelGrader object that uses a model to assign a score to the input. + variant :score_model, -> { OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel } + class LabelModel < OpenAI::Internal::Type::BaseModel # @!attribute input + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. # - # @return [Array] + # @return [Array] required :input, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input] } @@ -188,21 +185,26 @@ class LabelModel < OpenAI::Internal::Type::BaseModel # A LabelModelGrader object which uses a model to assign labels to each item in # the evaluation. # - # @param input [Array] + # @param input [Array] # @param labels [Array] # @param model [String] # @param name [String] # @param passing_labels [Array] # @param type [Symbol, :label_model] + # A chat message that makes up the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. module Input extend OpenAI::Internal::Type::Union variant -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage } - variant -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage } - - variant -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage } + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem } class SimpleInputMessage < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -222,71 +224,88 @@ class SimpleInputMessage < OpenAI::Internal::Type::BaseModel # @param role [String] end - class InputMessage < OpenAI::Internal::Type::BaseModel + class EvalItem < OpenAI::Internal::Type::BaseModel # @!attribute content + # Text inputs to the model - can contain template strings. # - # @return [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content] + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText] required :content, - -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content } + union: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content } # @!attribute role - # The role of the message. One of `user`, `system`, or `developer`. + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. # - # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role] + # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role] required :role, - enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role } + enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role } # @!attribute type - # The type of item, which is always `message`. + # The type of the message input. Always `message`. # - # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type] - required :type, - enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type } - - # @!method initialize(content:, role:, type:) - # @param content [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content] - # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role] - # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type] - - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage#content - class Content < OpenAI::Internal::Type::BaseModel - # @!attribute text - # The text content. - # - # @return [String] - required :text, String - - # @!attribute type - # The type of content, which is always `input_text`. - # - # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type] - required :type, - enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type } - - # @!method initialize(text:, type:) - # @param text [String] - # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type] - - # The type of content, which is always `input_text`. - # - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content#type - module Type - extend OpenAI::Internal::Type::Enum - - INPUT_TEXT = :input_text + # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type, nil] + optional :type, + enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText] + # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role] + # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type] - # @!method self.values - # @return [Array] + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText)] end - # The role of the message. One of `user`, `system`, or `developer`. + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. # - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage#role + # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem#role module Role extend OpenAI::Internal::Type::Enum USER = :user + ASSISTANT = :assistant SYSTEM = :system DEVELOPER = :developer @@ -294,9 +313,9 @@ module Role # @return [Array] end - # The type of item, which is always `message`. + # The type of the message input. Always `message`. # - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage#type + # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem#type module Type extend OpenAI::Internal::Type::Enum @@ -307,96 +326,210 @@ module Type end end - class OutputMessage < OpenAI::Internal::Type::BaseModel - # @!attribute content - # - # @return [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content] - required :content, - -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content } + # @!method self.variants + # @return [Array(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem)] + end + end - # @!attribute role - # The role of the message. Must be `assistant` for output. - # - # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role] - required :role, - enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role } + class Python < OpenAI::Internal::Type::BaseModel + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String - # @!attribute type - # The type of item, which is always `message`. - # - # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type] - required :type, - enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type } + # @!attribute source + # The source code of the python script. + # + # @return [String] + required :source, String + + # @!attribute type + # The object type, which is always `python`. + # + # @return [Symbol, :python] + required :type, const: :python + + # @!attribute image_tag + # The image tag to use for the python script. + # + # @return [String, nil] + optional :image_tag, String + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) + # A PythonGrader object that runs a python script on the input. + # + # @param name [String] + # @param source [String] + # @param image_tag [String] + # @param pass_threshold [Float] + # @param type [Symbol, :python] + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # @!attribute input + # The input text. This may include template strings. + # + # @return [Array] + required :input, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input] } + + # @!attribute model + # The model to use for the evaluation. + # + # @return [String] + required :model, String + + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String - # @!method initialize(content:, role:, type:) - # @param content [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content] - # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role] - # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type] + # @!attribute type + # The object type, which is always `score_model`. + # + # @return [Symbol, :score_model] + required :type, const: :score_model + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage#content - class Content < OpenAI::Internal::Type::BaseModel + # @!attribute range + # The range of the score. Defaults to `[0, 1]`. + # + # @return [Array, nil] + optional :range, OpenAI::Internal::Type::ArrayOf[Float] + + # @!attribute sampling_params + # The sampling parameters for the model. + # + # @return [Object, nil] + optional :sampling_params, OpenAI::Internal::Type::Unknown + + # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) + # A ScoreModelGrader object that uses a model to assign a score to the input. + # + # @param input [Array] + # @param model [String] + # @param name [String] + # @param pass_threshold [Float] + # @param range [Array] + # @param sampling_params [Object] + # @param type [Symbol, :score_model] + + class Input < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText] + required :content, + union: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role] + required :role, enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type, nil] + optional :type, enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText] + # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role] + # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel # @!attribute text - # The text content. + # The text output from the model. # # @return [String] required :text, String # @!attribute type - # The type of content, which is always `output_text`. + # The type of the output text. Always `output_text`. # - # @return [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type] - required :type, - enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type } - - # @!method initialize(text:, type:) - # @param text [String] - # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type] + # @return [Symbol, :output_text] + required :type, const: :output_text - # The type of content, which is always `output_text`. + # @!method initialize(text:, type: :output_text) + # A text output from the model. # - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content#type - module Type - extend OpenAI::Internal::Type::Enum - - OUTPUT_TEXT = :output_text - - # @!method self.values - # @return [Array] - end + # @param text [String] + # @param type [Symbol, :output_text] end - # The role of the message. Must be `assistant` for output. - # - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage#role - module Role - extend OpenAI::Internal::Type::Enum + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText)] + end - ASSISTANT = :assistant + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input#role + module Role + extend OpenAI::Internal::Type::Enum - # @!method self.values - # @return [Array] - end + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer - # The type of item, which is always `message`. - # - # @see OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage#type - module Type - extend OpenAI::Internal::Type::Enum + # @!method self.values + # @return [Array] + end - MESSAGE = :message + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input#type + module Type + extend OpenAI::Internal::Type::Enum - # @!method self.values - # @return [Array] - end - end + MESSAGE = :message - # @!method self.variants - # @return [Array(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage)] + # @!method self.values + # @return [Array] + end end end # @!method self.variants - # @return [Array(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader)] + # @return [Array(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalCreateParams::TestingCriterion::Python, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel)] end end end diff --git a/lib/openai/models/eval_create_response.rb b/lib/openai/models/eval_create_response.rb index 12832a04..65885fd7 100644 --- a/lib/openai/models/eval_create_response.rb +++ b/lib/openai/models/eval_create_response.rb @@ -45,20 +45,14 @@ class EvalCreateResponse < OpenAI::Internal::Type::BaseModel # @return [Symbol, :eval] required :object, const: :eval - # @!attribute share_with_openai - # Indicates whether the evaluation is shared with OpenAI. - # - # @return [Boolean] - required :share_with_openai, OpenAI::Internal::Type::Boolean - # @!attribute testing_criteria # A list of testing criteria. # - # @return [Array] + # @return [Array] required :testing_criteria, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalCreateResponse::TestingCriterion] } - # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, share_with_openai:, testing_criteria:, object: :eval) + # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -71,8 +65,7 @@ class EvalCreateResponse < OpenAI::Internal::Type::BaseModel # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] - # @param share_with_openai [Boolean] - # @param testing_criteria [Array] + # @param testing_criteria [Array] # @param object [Symbol, :eval] # Configuration of data sources used in runs of the evaluation. @@ -116,8 +109,211 @@ module TestingCriterion # A TextSimilarityGrader object which grades text based on similarity metrics. variant :text_similarity, -> { OpenAI::Models::EvalTextSimilarityGrader } + # A PythonGrader object that runs a python script on the input. + variant :python, -> { OpenAI::Models::EvalCreateResponse::TestingCriterion::Python } + + # A ScoreModelGrader object that uses a model to assign a score to the input. + variant :score_model, -> { OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel } + + class Python < OpenAI::Internal::Type::BaseModel + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute source + # The source code of the python script. + # + # @return [String] + required :source, String + + # @!attribute type + # The object type, which is always `python`. + # + # @return [Symbol, :python] + required :type, const: :python + + # @!attribute image_tag + # The image tag to use for the python script. + # + # @return [String, nil] + optional :image_tag, String + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) + # A PythonGrader object that runs a python script on the input. + # + # @param name [String] + # @param source [String] + # @param image_tag [String] + # @param pass_threshold [Float] + # @param type [Symbol, :python] + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # @!attribute input + # The input text. This may include template strings. + # + # @return [Array] + required :input, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input] } + + # @!attribute model + # The model to use for the evaluation. + # + # @return [String] + required :model, String + + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute type + # The object type, which is always `score_model`. + # + # @return [Symbol, :score_model] + required :type, const: :score_model + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!attribute range + # The range of the score. Defaults to `[0, 1]`. + # + # @return [Array, nil] + optional :range, OpenAI::Internal::Type::ArrayOf[Float] + + # @!attribute sampling_params + # The sampling parameters for the model. + # + # @return [Object, nil] + optional :sampling_params, OpenAI::Internal::Type::Unknown + + # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) + # A ScoreModelGrader object that uses a model to assign a score to the input. + # + # @param input [Array] + # @param model [String] + # @param name [String] + # @param pass_threshold [Float] + # @param range [Array] + # @param sampling_params [Object] + # @param type [Symbol, :score_model] + + class Input < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + required :content, + union: -> { OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role] + required :role, enum: -> { OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type, nil] + optional :type, enum: -> { OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + # @param role [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role] + # @param type [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader)] + # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalCreateResponse::TestingCriterion::Python, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel)] end end end diff --git a/lib/openai/models/eval_label_model_grader.rb b/lib/openai/models/eval_label_model_grader.rb index 2318e553..2af7746f 100644 --- a/lib/openai/models/eval_label_model_grader.rb +++ b/lib/openai/models/eval_label_model_grader.rb @@ -5,9 +5,8 @@ module Models class EvalLabelModelGrader < OpenAI::Internal::Type::BaseModel # @!attribute input # - # @return [Array] - required :input, - -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalLabelModelGrader::Input] } + # @return [Array] + required :input, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::EvalLabelModelGrader::Input] } # @!attribute labels # The labels to assign to each item in the evaluation. @@ -43,173 +42,110 @@ class EvalLabelModelGrader < OpenAI::Internal::Type::BaseModel # A LabelModelGrader object which uses a model to assign labels to each item in # the evaluation. # - # @param input [Array] + # @param input [Array] # @param labels [Array] # @param model [String] # @param name [String] # @param passing_labels [Array] # @param type [Symbol, :label_model] - # An item can either be an input message or an output message. - module Input - extend OpenAI::Internal::Type::Union - - discriminator :role - - variant :assistant, -> { OpenAI::Models::EvalLabelModelGrader::Input::Assistant } - - variant -> { OpenAI::Models::EvalLabelModelGrader::Input::InputMessage } - - class InputMessage < OpenAI::Internal::Type::BaseModel - # @!attribute content - # - # @return [OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content] - required :content, -> { OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content } - - # @!attribute role - # The role of the message. One of `user`, `system`, or `developer`. - # - # @return [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role] - required :role, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role } - - # @!attribute type - # The type of item, which is always `message`. - # - # @return [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type] - required :type, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type } - - # @!method initialize(content:, role:, type:) - # @param content [OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content] - # @param role [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role] - # @param type [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type] - - # @see OpenAI::Models::EvalLabelModelGrader::Input::InputMessage#content - class Content < OpenAI::Internal::Type::BaseModel + class Input < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText] + required :content, union: -> { OpenAI::Models::EvalLabelModelGrader::Input::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Role] + required :role, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Type, nil] + optional :type, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText] + # @param role [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Role] + # @param type [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::EvalLabelModelGrader::Input#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel # @!attribute text - # The text content. + # The text output from the model. # # @return [String] required :text, String # @!attribute type - # The type of content, which is always `input_text`. + # The type of the output text. Always `output_text`. # - # @return [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type] - required :type, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type } - - # @!method initialize(text:, type:) - # @param text [String] - # @param type [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type] + # @return [Symbol, :output_text] + required :type, const: :output_text - # The type of content, which is always `input_text`. + # @!method initialize(text:, type: :output_text) + # A text output from the model. # - # @see OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content#type - module Type - extend OpenAI::Internal::Type::Enum - - INPUT_TEXT = :input_text - - # @!method self.values - # @return [Array] - end - end - - # The role of the message. One of `user`, `system`, or `developer`. - # - # @see OpenAI::Models::EvalLabelModelGrader::Input::InputMessage#role - module Role - extend OpenAI::Internal::Type::Enum - - USER = :user - SYSTEM = :system - DEVELOPER = :developer - - # @!method self.values - # @return [Array] + # @param text [String] + # @param type [Symbol, :output_text] end - # The type of item, which is always `message`. - # - # @see OpenAI::Models::EvalLabelModelGrader::Input::InputMessage#type - module Type - extend OpenAI::Internal::Type::Enum - - MESSAGE = :message - - # @!method self.values - # @return [Array] - end + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText)] end - class Assistant < OpenAI::Internal::Type::BaseModel - # @!attribute content - # - # @return [OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content] - required :content, -> { OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content } - - # @!attribute role - # The role of the message. Must be `assistant` for output. - # - # @return [Symbol, :assistant] - required :role, const: :assistant - - # @!attribute type - # The type of item, which is always `message`. - # - # @return [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type] - required :type, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type } - - # @!method initialize(content:, type:, role: :assistant) - # @param content [OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content] - # @param type [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type] - # @param role [Symbol, :assistant] - - # @see OpenAI::Models::EvalLabelModelGrader::Input::Assistant#content - class Content < OpenAI::Internal::Type::BaseModel - # @!attribute text - # The text content. - # - # @return [String] - required :text, String + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::EvalLabelModelGrader::Input#role + module Role + extend OpenAI::Internal::Type::Enum - # @!attribute type - # The type of content, which is always `output_text`. - # - # @return [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type] - required :type, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type } + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer - # @!method initialize(text:, type:) - # @param text [String] - # @param type [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type] - - # The type of content, which is always `output_text`. - # - # @see OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content#type - module Type - extend OpenAI::Internal::Type::Enum - - OUTPUT_TEXT = :output_text - - # @!method self.values - # @return [Array] - end - end + # @!method self.values + # @return [Array] + end - # The type of item, which is always `message`. - # - # @see OpenAI::Models::EvalLabelModelGrader::Input::Assistant#type - module Type - extend OpenAI::Internal::Type::Enum + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::EvalLabelModelGrader::Input#type + module Type + extend OpenAI::Internal::Type::Enum - MESSAGE = :message + MESSAGE = :message - # @!method self.values - # @return [Array] - end + # @!method self.values + # @return [Array] end - - # @!method self.variants - # @return [Array(OpenAI::Models::EvalLabelModelGrader::Input::Assistant, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage)] end end end diff --git a/lib/openai/models/eval_list_response.rb b/lib/openai/models/eval_list_response.rb index 0abeed04..d80085f0 100644 --- a/lib/openai/models/eval_list_response.rb +++ b/lib/openai/models/eval_list_response.rb @@ -45,20 +45,14 @@ class EvalListResponse < OpenAI::Internal::Type::BaseModel # @return [Symbol, :eval] required :object, const: :eval - # @!attribute share_with_openai - # Indicates whether the evaluation is shared with OpenAI. - # - # @return [Boolean] - required :share_with_openai, OpenAI::Internal::Type::Boolean - # @!attribute testing_criteria # A list of testing criteria. # - # @return [Array] + # @return [Array] required :testing_criteria, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalListResponse::TestingCriterion] } - # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, share_with_openai:, testing_criteria:, object: :eval) + # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -71,8 +65,7 @@ class EvalListResponse < OpenAI::Internal::Type::BaseModel # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] - # @param share_with_openai [Boolean] - # @param testing_criteria [Array] + # @param testing_criteria [Array] # @param object [Symbol, :eval] # Configuration of data sources used in runs of the evaluation. @@ -116,8 +109,211 @@ module TestingCriterion # A TextSimilarityGrader object which grades text based on similarity metrics. variant :text_similarity, -> { OpenAI::Models::EvalTextSimilarityGrader } + # A PythonGrader object that runs a python script on the input. + variant :python, -> { OpenAI::Models::EvalListResponse::TestingCriterion::Python } + + # A ScoreModelGrader object that uses a model to assign a score to the input. + variant :score_model, -> { OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel } + + class Python < OpenAI::Internal::Type::BaseModel + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute source + # The source code of the python script. + # + # @return [String] + required :source, String + + # @!attribute type + # The object type, which is always `python`. + # + # @return [Symbol, :python] + required :type, const: :python + + # @!attribute image_tag + # The image tag to use for the python script. + # + # @return [String, nil] + optional :image_tag, String + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) + # A PythonGrader object that runs a python script on the input. + # + # @param name [String] + # @param source [String] + # @param image_tag [String] + # @param pass_threshold [Float] + # @param type [Symbol, :python] + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # @!attribute input + # The input text. This may include template strings. + # + # @return [Array] + required :input, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input] } + + # @!attribute model + # The model to use for the evaluation. + # + # @return [String] + required :model, String + + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute type + # The object type, which is always `score_model`. + # + # @return [Symbol, :score_model] + required :type, const: :score_model + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!attribute range + # The range of the score. Defaults to `[0, 1]`. + # + # @return [Array, nil] + optional :range, OpenAI::Internal::Type::ArrayOf[Float] + + # @!attribute sampling_params + # The sampling parameters for the model. + # + # @return [Object, nil] + optional :sampling_params, OpenAI::Internal::Type::Unknown + + # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) + # A ScoreModelGrader object that uses a model to assign a score to the input. + # + # @param input [Array] + # @param model [String] + # @param name [String] + # @param pass_threshold [Float] + # @param range [Array] + # @param sampling_params [Object] + # @param type [Symbol, :score_model] + + class Input < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + required :content, + union: -> { OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role] + required :role, enum: -> { OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type, nil] + optional :type, enum: -> { OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + # @param role [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role] + # @param type [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader)] + # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalListResponse::TestingCriterion::Python, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel)] end end end diff --git a/lib/openai/models/eval_retrieve_response.rb b/lib/openai/models/eval_retrieve_response.rb index b1d14b18..e90d4965 100644 --- a/lib/openai/models/eval_retrieve_response.rb +++ b/lib/openai/models/eval_retrieve_response.rb @@ -45,20 +45,14 @@ class EvalRetrieveResponse < OpenAI::Internal::Type::BaseModel # @return [Symbol, :eval] required :object, const: :eval - # @!attribute share_with_openai - # Indicates whether the evaluation is shared with OpenAI. - # - # @return [Boolean] - required :share_with_openai, OpenAI::Internal::Type::Boolean - # @!attribute testing_criteria # A list of testing criteria. # - # @return [Array] + # @return [Array] required :testing_criteria, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalRetrieveResponse::TestingCriterion] } - # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, share_with_openai:, testing_criteria:, object: :eval) + # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -71,8 +65,7 @@ class EvalRetrieveResponse < OpenAI::Internal::Type::BaseModel # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] - # @param share_with_openai [Boolean] - # @param testing_criteria [Array] + # @param testing_criteria [Array] # @param object [Symbol, :eval] # Configuration of data sources used in runs of the evaluation. @@ -116,8 +109,213 @@ module TestingCriterion # A TextSimilarityGrader object which grades text based on similarity metrics. variant :text_similarity, -> { OpenAI::Models::EvalTextSimilarityGrader } + # A PythonGrader object that runs a python script on the input. + variant :python, -> { OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python } + + # A ScoreModelGrader object that uses a model to assign a score to the input. + variant :score_model, -> { OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel } + + class Python < OpenAI::Internal::Type::BaseModel + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute source + # The source code of the python script. + # + # @return [String] + required :source, String + + # @!attribute type + # The object type, which is always `python`. + # + # @return [Symbol, :python] + required :type, const: :python + + # @!attribute image_tag + # The image tag to use for the python script. + # + # @return [String, nil] + optional :image_tag, String + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) + # A PythonGrader object that runs a python script on the input. + # + # @param name [String] + # @param source [String] + # @param image_tag [String] + # @param pass_threshold [Float] + # @param type [Symbol, :python] + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # @!attribute input + # The input text. This may include template strings. + # + # @return [Array] + required :input, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input] } + + # @!attribute model + # The model to use for the evaluation. + # + # @return [String] + required :model, String + + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute type + # The object type, which is always `score_model`. + # + # @return [Symbol, :score_model] + required :type, const: :score_model + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!attribute range + # The range of the score. Defaults to `[0, 1]`. + # + # @return [Array, nil] + optional :range, OpenAI::Internal::Type::ArrayOf[Float] + + # @!attribute sampling_params + # The sampling parameters for the model. + # + # @return [Object, nil] + optional :sampling_params, OpenAI::Internal::Type::Unknown + + # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) + # A ScoreModelGrader object that uses a model to assign a score to the input. + # + # @param input [Array] + # @param model [String] + # @param name [String] + # @param pass_threshold [Float] + # @param range [Array] + # @param sampling_params [Object] + # @param type [Symbol, :score_model] + + class Input < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + required :content, + union: -> { OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role] + required :role, + enum: -> { OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type, nil] + optional :type, + enum: -> { OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + # @param role [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role] + # @param type [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader)] + # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel)] end end end diff --git a/lib/openai/models/eval_text_similarity_grader.rb b/lib/openai/models/eval_text_similarity_grader.rb index 8d037316..2a8d70e0 100644 --- a/lib/openai/models/eval_text_similarity_grader.rb +++ b/lib/openai/models/eval_text_similarity_grader.rb @@ -4,8 +4,8 @@ module OpenAI module Models class EvalTextSimilarityGrader < OpenAI::Internal::Type::BaseModel # @!attribute evaluation_metric - # The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`, - # `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. + # The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, + # `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. # # @return [Symbol, OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric] required :evaluation_metric, enum: -> { OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric } @@ -50,8 +50,8 @@ class EvalTextSimilarityGrader < OpenAI::Internal::Type::BaseModel # @param name [String] # @param type [Symbol, :text_similarity] - # The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`, - # `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. + # The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, + # `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. # # @see OpenAI::Models::EvalTextSimilarityGrader#evaluation_metric module EvaluationMetric @@ -67,7 +67,6 @@ module EvaluationMetric ROUGE_4 = :rouge_4 ROUGE_5 = :rouge_5 ROUGE_L = :rouge_l - COSINE = :cosine # @!method self.values # @return [Array] diff --git a/lib/openai/models/eval_update_response.rb b/lib/openai/models/eval_update_response.rb index 08e01385..923a9e03 100644 --- a/lib/openai/models/eval_update_response.rb +++ b/lib/openai/models/eval_update_response.rb @@ -45,20 +45,14 @@ class EvalUpdateResponse < OpenAI::Internal::Type::BaseModel # @return [Symbol, :eval] required :object, const: :eval - # @!attribute share_with_openai - # Indicates whether the evaluation is shared with OpenAI. - # - # @return [Boolean] - required :share_with_openai, OpenAI::Internal::Type::Boolean - # @!attribute testing_criteria # A list of testing criteria. # - # @return [Array] + # @return [Array] required :testing_criteria, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalUpdateResponse::TestingCriterion] } - # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, share_with_openai:, testing_criteria:, object: :eval) + # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -71,8 +65,7 @@ class EvalUpdateResponse < OpenAI::Internal::Type::BaseModel # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] - # @param share_with_openai [Boolean] - # @param testing_criteria [Array] + # @param testing_criteria [Array] # @param object [Symbol, :eval] # Configuration of data sources used in runs of the evaluation. @@ -116,8 +109,211 @@ module TestingCriterion # A TextSimilarityGrader object which grades text based on similarity metrics. variant :text_similarity, -> { OpenAI::Models::EvalTextSimilarityGrader } + # A PythonGrader object that runs a python script on the input. + variant :python, -> { OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python } + + # A ScoreModelGrader object that uses a model to assign a score to the input. + variant :score_model, -> { OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel } + + class Python < OpenAI::Internal::Type::BaseModel + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute source + # The source code of the python script. + # + # @return [String] + required :source, String + + # @!attribute type + # The object type, which is always `python`. + # + # @return [Symbol, :python] + required :type, const: :python + + # @!attribute image_tag + # The image tag to use for the python script. + # + # @return [String, nil] + optional :image_tag, String + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) + # A PythonGrader object that runs a python script on the input. + # + # @param name [String] + # @param source [String] + # @param image_tag [String] + # @param pass_threshold [Float] + # @param type [Symbol, :python] + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # @!attribute input + # The input text. This may include template strings. + # + # @return [Array] + required :input, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input] } + + # @!attribute model + # The model to use for the evaluation. + # + # @return [String] + required :model, String + + # @!attribute name + # The name of the grader. + # + # @return [String] + required :name, String + + # @!attribute type + # The object type, which is always `score_model`. + # + # @return [Symbol, :score_model] + required :type, const: :score_model + + # @!attribute pass_threshold + # The threshold for the score. + # + # @return [Float, nil] + optional :pass_threshold, Float + + # @!attribute range + # The range of the score. Defaults to `[0, 1]`. + # + # @return [Array, nil] + optional :range, OpenAI::Internal::Type::ArrayOf[Float] + + # @!attribute sampling_params + # The sampling parameters for the model. + # + # @return [Object, nil] + optional :sampling_params, OpenAI::Internal::Type::Unknown + + # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) + # A ScoreModelGrader object that uses a model to assign a score to the input. + # + # @param input [Array] + # @param model [String] + # @param name [String] + # @param pass_threshold [Float] + # @param range [Array] + # @param sampling_params [Object] + # @param type [Symbol, :score_model] + + class Input < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + required :content, + union: -> { OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role] + required :role, enum: -> { OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type, nil] + optional :type, enum: -> { OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + # @param role [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role] + # @param type [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader)] + # @return [Array(OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel)] end end end diff --git a/lib/openai/models/evals/create_eval_completions_run_data_source.rb b/lib/openai/models/evals/create_eval_completions_run_data_source.rb index ac306948..d4f61b7b 100644 --- a/lib/openai/models/evals/create_eval_completions_run_data_source.rb +++ b/lib/openai/models/evals/create_eval_completions_run_data_source.rb @@ -4,18 +4,6 @@ module OpenAI module Models module Evals class CreateEvalCompletionsRunDataSource < OpenAI::Internal::Type::BaseModel - # @!attribute input_messages - # - # @return [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference] - required :input_messages, - union: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages } - - # @!attribute model - # The name of the model to use for generating completions (e.g. "o3-mini"). - # - # @return [String] - required :model, String - # @!attribute source # A StoredCompletionsRunDataSource configuration describing a set of filters # @@ -28,274 +16,33 @@ class CreateEvalCompletionsRunDataSource < OpenAI::Internal::Type::BaseModel # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type] required :type, enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type } + # @!attribute input_messages + # + # @return [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference, nil] + optional :input_messages, + union: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages } + + # @!attribute model + # The name of the model to use for generating completions (e.g. "o3-mini"). + # + # @return [String, nil] + optional :model, String + # @!attribute sampling_params # # @return [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams, nil] optional :sampling_params, -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams } - # @!method initialize(input_messages:, model:, source:, type:, sampling_params: nil) + # @!method initialize(source:, type:, input_messages: nil, model: nil, sampling_params: nil) # A CompletionsRunDataSource object describing a model sampling configuration. # - # @param input_messages [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference] - # @param model [String] # @param source [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions] # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type] + # @param input_messages [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference] + # @param model [String] # @param sampling_params [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams] - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource#input_messages - module InputMessages - extend OpenAI::Internal::Type::Union - - discriminator :type - - variant :template, - -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template } - - variant :item_reference, - -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference } - - class Template < OpenAI::Internal::Type::BaseModel - # @!attribute template - # A list of chat messages forming the prompt or context. May include variable - # references to the "item" namespace, ie {{item.name}}. - # - # @return [Array] - required :template, - -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template] } - - # @!attribute type - # The type of input messages. Always `template`. - # - # @return [Symbol, :template] - required :type, const: :template - - # @!method initialize(template:, type: :template) - # @param template [Array] - # @param type [Symbol, :template] - - module Template - extend OpenAI::Internal::Type::Union - - variant -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage } - - variant -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage } - - variant -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage } - - class ChatMessage < OpenAI::Internal::Type::BaseModel - # @!attribute content - # The content of the message. - # - # @return [String] - required :content, String - - # @!attribute role - # The role of the message (e.g. "system", "assistant", "user"). - # - # @return [String] - required :role, String - - # @!method initialize(content:, role:) - # @param content [String] - # @param role [String] - end - - class InputMessage < OpenAI::Internal::Type::BaseModel - # @!attribute content - # - # @return [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content] - required :content, - -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content } - - # @!attribute role - # The role of the message. One of `user`, `system`, or `developer`. - # - # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role] - required :role, - enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role } - - # @!attribute type - # The type of item, which is always `message`. - # - # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type] - required :type, - enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type } - - # @!method initialize(content:, role:, type:) - # @param content [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content] - # @param role [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role] - # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type] - - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage#content - class Content < OpenAI::Internal::Type::BaseModel - # @!attribute text - # The text content. - # - # @return [String] - required :text, String - - # @!attribute type - # The type of content, which is always `input_text`. - # - # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type] - required :type, - enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type } - - # @!method initialize(text:, type:) - # @param text [String] - # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type] - - # The type of content, which is always `input_text`. - # - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content#type - module Type - extend OpenAI::Internal::Type::Enum - - INPUT_TEXT = :input_text - - # @!method self.values - # @return [Array] - end - end - - # The role of the message. One of `user`, `system`, or `developer`. - # - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage#role - module Role - extend OpenAI::Internal::Type::Enum - - USER = :user - SYSTEM = :system - DEVELOPER = :developer - - # @!method self.values - # @return [Array] - end - - # The type of item, which is always `message`. - # - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage#type - module Type - extend OpenAI::Internal::Type::Enum - - MESSAGE = :message - - # @!method self.values - # @return [Array] - end - end - - class OutputMessage < OpenAI::Internal::Type::BaseModel - # @!attribute content - # - # @return [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content] - required :content, - -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content } - - # @!attribute role - # The role of the message. Must be `assistant` for output. - # - # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role] - required :role, - enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role } - - # @!attribute type - # The type of item, which is always `message`. - # - # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type] - required :type, - enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type } - - # @!method initialize(content:, role:, type:) - # @param content [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content] - # @param role [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role] - # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type] - - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage#content - class Content < OpenAI::Internal::Type::BaseModel - # @!attribute text - # The text content. - # - # @return [String] - required :text, String - - # @!attribute type - # The type of content, which is always `output_text`. - # - # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type] - required :type, - enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type } - - # @!method initialize(text:, type:) - # @param text [String] - # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type] - - # The type of content, which is always `output_text`. - # - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content#type - module Type - extend OpenAI::Internal::Type::Enum - - OUTPUT_TEXT = :output_text - - # @!method self.values - # @return [Array] - end - end - - # The role of the message. Must be `assistant` for output. - # - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage#role - module Role - extend OpenAI::Internal::Type::Enum - - ASSISTANT = :assistant - - # @!method self.values - # @return [Array] - end - - # The type of item, which is always `message`. - # - # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage#type - module Type - extend OpenAI::Internal::Type::Enum - - MESSAGE = :message - - # @!method self.values - # @return [Array] - end - end - - # @!method self.variants - # @return [Array(OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage)] - end - end - - class ItemReference < OpenAI::Internal::Type::BaseModel - # @!attribute item_reference - # A reference to a variable in the "item" namespace. Ie, "item.name" - # - # @return [String] - required :item_reference, String - - # @!attribute type - # The type of input messages. Always `item_reference`. - # - # @return [Symbol, :item_reference] - required :type, const: :item_reference - - # @!method initialize(item_reference:, type: :item_reference) - # @param item_reference [String] - # @param type [Symbol, :item_reference] - end - - # @!method self.variants - # @return [Array(OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference)] - end - # A StoredCompletionsRunDataSource configuration describing a set of filters # # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource#source @@ -367,23 +114,29 @@ class FileID < OpenAI::Internal::Type::BaseModel end class StoredCompletions < OpenAI::Internal::Type::BaseModel + # @!attribute type + # The type of source. Always `stored_completions`. + # + # @return [Symbol, :stored_completions] + required :type, const: :stored_completions + # @!attribute created_after # An optional Unix timestamp to filter items created after this time. # # @return [Integer, nil] - required :created_after, Integer, nil?: true + optional :created_after, Integer, nil?: true # @!attribute created_before # An optional Unix timestamp to filter items created before this time. # # @return [Integer, nil] - required :created_before, Integer, nil?: true + optional :created_before, Integer, nil?: true # @!attribute limit # An optional maximum number of items to return. # # @return [Integer, nil] - required :limit, Integer, nil?: true + optional :limit, Integer, nil?: true # @!attribute metadata # Set of 16 key-value pairs that can be attached to an object. This can be useful @@ -394,21 +147,15 @@ class StoredCompletions < OpenAI::Internal::Type::BaseModel # a maximum length of 512 characters. # # @return [Hash{Symbol=>String}, nil] - required :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true + optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!attribute model # An optional model to filter by (e.g., 'gpt-4o'). # # @return [String, nil] - required :model, String, nil?: true - - # @!attribute type - # The type of source. Always `stored_completions`. - # - # @return [Symbol, :stored_completions] - required :type, const: :stored_completions + optional :model, String, nil?: true - # @!method initialize(created_after:, created_before:, limit:, metadata:, model:, type: :stored_completions) + # @!method initialize(created_after: nil, created_before: nil, limit: nil, metadata: nil, model: nil, type: :stored_completions) # A StoredCompletionsRunDataSource configuration describing a set of filters # # @param created_after [Integer, nil] @@ -435,6 +182,191 @@ module Type # @return [Array] end + # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource#input_messages + module InputMessages + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :template, + -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template } + + variant :item_reference, + -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference } + + class Template < OpenAI::Internal::Type::BaseModel + # @!attribute template + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + # + # @return [Array] + required :template, + -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template] } + + # @!attribute type + # The type of input messages. Always `template`. + # + # @return [Symbol, :template] + required :type, const: :template + + # @!method initialize(template:, type: :template) + # @param template [Array] + # @param type [Symbol, :template] + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + discriminator :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant :message, -> { OpenAI::Models::Responses::EasyInputMessage } + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant :message, + -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message } + + class Message < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText] + required :content, + union: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role] + required :role, + enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type, nil] + optional :type, + enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText] + # @param role [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role] + # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Responses::EasyInputMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message)] + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # @!attribute item_reference + # A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @return [String] + required :item_reference, String + + # @!attribute type + # The type of input messages. Always `item_reference`. + # + # @return [Symbol, :item_reference] + required :type, const: :item_reference + + # @!method initialize(item_reference:, type: :item_reference) + # @param item_reference [String] + # @param type [Symbol, :item_reference] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference)] + end + # @see OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource#sampling_params class SamplingParams < OpenAI::Internal::Type::BaseModel # @!attribute max_completion_tokens diff --git a/lib/openai/models/evals/run_cancel_response.rb b/lib/openai/models/evals/run_cancel_response.rb index 19775cff..2412cad7 100644 --- a/lib/openai/models/evals/run_cancel_response.rb +++ b/lib/openai/models/evals/run_cancel_response.rb @@ -20,7 +20,7 @@ class RunCancelResponse < OpenAI::Internal::Type::BaseModel # @!attribute data_source # Information about the run's data source. # - # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions] required :data_source, union: -> { OpenAI::Models::Evals::RunCancelResponse::DataSource } # @!attribute error @@ -101,7 +101,7 @@ class RunCancelResponse < OpenAI::Internal::Type::BaseModel # # @param id [String] # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions] # @param error [OpenAI::Models::Evals::EvalAPIError] # @param eval_id [String] # @param metadata [Hash{Symbol=>String}, nil] @@ -128,8 +128,456 @@ module DataSource # A CompletionsRunDataSource object describing a model sampling configuration. variant :completions, -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource } + # A ResponsesRunDataSource object describing a model sampling configuration. + variant :completions, -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions } + + class Completions < OpenAI::Internal::Type::BaseModel + # @!attribute source + # A EvalResponsesSource object describing a run data source configuration. + # + # @return [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses] + required :source, union: -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source } + + # @!attribute type + # The type of run data source. Always `completions`. + # + # @return [Symbol, :completions] + required :type, const: :completions + + # @!attribute input_messages + # + # @return [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference, nil] + optional :input_messages, + union: -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages } + + # @!attribute model + # The name of the model to use for generating completions (e.g. "o3-mini"). + # + # @return [String, nil] + optional :model, String + + # @!attribute sampling_params + # + # @return [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams, nil] + optional :sampling_params, + -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams } + + # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # A ResponsesRunDataSource object describing a model sampling configuration. + # + # @param source [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses] + # @param input_messages [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference] + # @param model [String] + # @param sampling_params [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams] + # @param type [Symbol, :completions] + + # A EvalResponsesSource object describing a run data source configuration. + # + # @see OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions#source + module Source + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :file_content, + -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent } + + variant :file_id, -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID } + + # A EvalResponsesSource object describing a run data source configuration. + variant :responses, + -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses } + + class FileContent < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the jsonl file. + # + # @return [Array] + required :content, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::Content] } + + # @!attribute type + # The type of jsonl source. Always `file_content`. + # + # @return [Symbol, :file_content] + required :type, const: :file_content + + # @!method initialize(content:, type: :file_content) + # @param content [Array] + # @param type [Symbol, :file_content] + + class Content < OpenAI::Internal::Type::BaseModel + # @!attribute item + # + # @return [Hash{Symbol=>Object}] + required :item, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!attribute sample + # + # @return [Hash{Symbol=>Object}, nil] + optional :sample, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!method initialize(item:, sample: nil) + # @param item [Hash{Symbol=>Object}] + # @param sample [Hash{Symbol=>Object}] + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # @!attribute id + # The identifier of the file. + # + # @return [String] + required :id, String + + # @!attribute type + # The type of jsonl source. Always `file_id`. + # + # @return [Symbol, :file_id] + required :type, const: :file_id + + # @!method initialize(id:, type: :file_id) + # @param id [String] + # @param type [Symbol, :file_id] + end + + class Responses < OpenAI::Internal::Type::BaseModel + # @!attribute type + # The type of run data source. Always `responses`. + # + # @return [Symbol, :responses] + required :type, const: :responses + + # @!attribute allow_parallel_tool_calls + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :allow_parallel_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute created_after + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_after, Integer, nil?: true + + # @!attribute created_before + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_before, Integer, nil?: true + + # @!attribute has_tool_calls + # Whether the response has tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :has_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute instructions_search + # Optional search string for instructions. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :instructions_search, String, nil?: true + + # @!attribute metadata + # Metadata filter for the responses. This is a query parameter used to select + # responses. + # + # @return [Object, nil] + optional :metadata, OpenAI::Internal::Type::Unknown, nil?: true + + # @!attribute model + # The name of the model to find responses for. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :model, String, nil?: true + + # @!attribute reasoning_effort + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + # + # @return [Symbol, OpenAI::Models::ReasoningEffort, nil] + optional :reasoning_effort, enum: -> { OpenAI::Models::ReasoningEffort }, nil?: true + + # @!attribute temperature + # Sampling temperature. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :temperature, Float, nil?: true + + # @!attribute top_p + # Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :top_p, Float, nil?: true + + # @!attribute users + # List of user identifiers. This is a query parameter used to select responses. + # + # @return [Array, nil] + optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # A EvalResponsesSource object describing a run data source configuration. + # + # @param allow_parallel_tool_calls [Boolean, nil] + # @param created_after [Integer, nil] + # @param created_before [Integer, nil] + # @param has_tool_calls [Boolean, nil] + # @param instructions_search [String, nil] + # @param metadata [Object, nil] + # @param model [String, nil] + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] + # @param temperature [Float, nil] + # @param top_p [Float, nil] + # @param users [Array, nil] + # @param type [Symbol, :responses] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses)] + end + + # @see OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions#input_messages + module InputMessages + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :template, + -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template } + + variant :item_reference, + -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference } + + class Template < OpenAI::Internal::Type::BaseModel + # @!attribute template + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + # + # @return [Array] + required :template, + -> do + OpenAI::Internal::Type::ArrayOf[ + union: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template + ] + end + + # @!attribute type + # The type of input messages. Always `template`. + # + # @return [Symbol, :template] + required :type, const: :template + + # @!method initialize(template:, type: :template) + # @param template [Array] + # @param type [Symbol, :template] + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + variant -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage } + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the message. + # + # @return [String] + required :content, String + + # @!attribute role + # The role of the message (e.g. "system", "assistant", "user"). + # + # @return [String] + required :role, String + + # @!method initialize(content:, role:) + # @param content [String] + # @param role [String] + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + required :content, + union: -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + required :role, + enum: -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type, nil] + optional :type, + enum: -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + # @param role [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + # @param type [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem)] + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # @!attribute item_reference + # A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @return [String] + required :item_reference, String + + # @!attribute type + # The type of input messages. Always `item_reference`. + # + # @return [Symbol, :item_reference] + required :type, const: :item_reference + + # @!method initialize(item_reference:, type: :item_reference) + # @param item_reference [String] + # @param type [Symbol, :item_reference] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference)] + end + + # @see OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions#sampling_params + class SamplingParams < OpenAI::Internal::Type::BaseModel + # @!attribute max_completion_tokens + # The maximum number of tokens in the generated output. + # + # @return [Integer, nil] + optional :max_completion_tokens, Integer + + # @!attribute seed + # A seed value to initialize the randomness, during sampling. + # + # @return [Integer, nil] + optional :seed, Integer + + # @!attribute temperature + # A higher temperature increases randomness in the outputs. + # + # @return [Float, nil] + optional :temperature, Float + + # @!attribute top_p + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + # + # @return [Float, nil] + optional :top_p, Float + + # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) + # @param max_completion_tokens [Integer] + # @param seed [Integer] + # @param temperature [Float] + # @param top_p [Float] + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource)] + # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions)] end class PerModelUsage < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/evals/run_create_params.rb b/lib/openai/models/evals/run_create_params.rb index 61365782..6ee4266d 100644 --- a/lib/openai/models/evals/run_create_params.rb +++ b/lib/openai/models/evals/run_create_params.rb @@ -11,7 +11,7 @@ class RunCreateParams < OpenAI::Internal::Type::BaseModel # @!attribute data_source # Details about the run's data source. # - # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] required :data_source, union: -> { OpenAI::Models::Evals::RunCreateParams::DataSource } # @!attribute metadata @@ -32,7 +32,7 @@ class RunCreateParams < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(data_source:, metadata: nil, name: nil, request_options: {}) - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] @@ -47,8 +47,475 @@ module DataSource # A CompletionsRunDataSource object describing a model sampling configuration. variant -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource } + # A ResponsesRunDataSource object describing a model sampling configuration. + variant -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource } + + class CreateEvalResponsesRunDataSource < OpenAI::Internal::Type::BaseModel + # @!attribute source + # A EvalResponsesSource object describing a run data source configuration. + # + # @return [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses] + required :source, + union: -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source } + + # @!attribute type + # The type of run data source. Always `completions`. + # + # @return [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type] + required :type, + enum: -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type } + + # @!attribute input_messages + # + # @return [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference, nil] + optional :input_messages, + union: -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages } + + # @!attribute model + # The name of the model to use for generating completions (e.g. "o3-mini"). + # + # @return [String, nil] + optional :model, String + + # @!attribute sampling_params + # + # @return [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams, nil] + optional :sampling_params, + -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams } + + # @!method initialize(source:, type:, input_messages: nil, model: nil, sampling_params: nil) + # A ResponsesRunDataSource object describing a model sampling configuration. + # + # @param source [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses] + # @param type [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type] + # @param input_messages [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference] + # @param model [String] + # @param sampling_params [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams] + + # A EvalResponsesSource object describing a run data source configuration. + # + # @see OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource#source + module Source + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :file_content, + -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent } + + variant :file_id, + -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID } + + # A EvalResponsesSource object describing a run data source configuration. + variant :responses, + -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses } + + class FileContent < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the jsonl file. + # + # @return [Array] + required :content, + -> do + OpenAI::Internal::Type::ArrayOf[ + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::Content + ] + end + + # @!attribute type + # The type of jsonl source. Always `file_content`. + # + # @return [Symbol, :file_content] + required :type, const: :file_content + + # @!method initialize(content:, type: :file_content) + # @param content [Array] + # @param type [Symbol, :file_content] + + class Content < OpenAI::Internal::Type::BaseModel + # @!attribute item + # + # @return [Hash{Symbol=>Object}] + required :item, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!attribute sample + # + # @return [Hash{Symbol=>Object}, nil] + optional :sample, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!method initialize(item:, sample: nil) + # @param item [Hash{Symbol=>Object}] + # @param sample [Hash{Symbol=>Object}] + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # @!attribute id + # The identifier of the file. + # + # @return [String] + required :id, String + + # @!attribute type + # The type of jsonl source. Always `file_id`. + # + # @return [Symbol, :file_id] + required :type, const: :file_id + + # @!method initialize(id:, type: :file_id) + # @param id [String] + # @param type [Symbol, :file_id] + end + + class Responses < OpenAI::Internal::Type::BaseModel + # @!attribute type + # The type of run data source. Always `responses`. + # + # @return [Symbol, :responses] + required :type, const: :responses + + # @!attribute allow_parallel_tool_calls + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :allow_parallel_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute created_after + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_after, Integer, nil?: true + + # @!attribute created_before + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_before, Integer, nil?: true + + # @!attribute has_tool_calls + # Whether the response has tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :has_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute instructions_search + # Optional search string for instructions. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :instructions_search, String, nil?: true + + # @!attribute metadata + # Metadata filter for the responses. This is a query parameter used to select + # responses. + # + # @return [Object, nil] + optional :metadata, OpenAI::Internal::Type::Unknown, nil?: true + + # @!attribute model + # The name of the model to find responses for. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :model, String, nil?: true + + # @!attribute reasoning_effort + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + # + # @return [Symbol, OpenAI::Models::ReasoningEffort, nil] + optional :reasoning_effort, enum: -> { OpenAI::Models::ReasoningEffort }, nil?: true + + # @!attribute temperature + # Sampling temperature. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :temperature, Float, nil?: true + + # @!attribute top_p + # Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :top_p, Float, nil?: true + + # @!attribute users + # List of user identifiers. This is a query parameter used to select responses. + # + # @return [Array, nil] + optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # A EvalResponsesSource object describing a run data source configuration. + # + # @param allow_parallel_tool_calls [Boolean, nil] + # @param created_after [Integer, nil] + # @param created_before [Integer, nil] + # @param has_tool_calls [Boolean, nil] + # @param instructions_search [String, nil] + # @param metadata [Object, nil] + # @param model [String, nil] + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] + # @param temperature [Float, nil] + # @param top_p [Float, nil] + # @param users [Array, nil] + # @param type [Symbol, :responses] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses)] + end + + # The type of run data source. Always `completions`. + # + # @see OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource#type + module Type + extend OpenAI::Internal::Type::Enum + + COMPLETIONS = :completions + + # @!method self.values + # @return [Array] + end + + # @see OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource#input_messages + module InputMessages + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :template, + -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template } + + variant :item_reference, + -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference } + + class Template < OpenAI::Internal::Type::BaseModel + # @!attribute template + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + # + # @return [Array] + required :template, + -> do + OpenAI::Internal::Type::ArrayOf[ + union: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template + ] + end + + # @!attribute type + # The type of input messages. Always `template`. + # + # @return [Symbol, :template] + required :type, const: :template + + # @!method initialize(template:, type: :template) + # @param template [Array] + # @param type [Symbol, :template] + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + variant -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage } + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the message. + # + # @return [String] + required :content, String + + # @!attribute role + # The role of the message (e.g. "system", "assistant", "user"). + # + # @return [String] + required :role, String + + # @!method initialize(content:, role:) + # @param content [String] + # @param role [String] + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText] + required :content, + union: -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role] + required :role, + enum: -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type, nil] + optional :type, + enum: -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText] + # @param role [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role] + # @param type [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem)] + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # @!attribute item_reference + # A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @return [String] + required :item_reference, String + + # @!attribute type + # The type of input messages. Always `item_reference`. + # + # @return [Symbol, :item_reference] + required :type, const: :item_reference + + # @!method initialize(item_reference:, type: :item_reference) + # @param item_reference [String] + # @param type [Symbol, :item_reference] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference)] + end + + # @see OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource#sampling_params + class SamplingParams < OpenAI::Internal::Type::BaseModel + # @!attribute max_completion_tokens + # The maximum number of tokens in the generated output. + # + # @return [Integer, nil] + optional :max_completion_tokens, Integer + + # @!attribute seed + # A seed value to initialize the randomness, during sampling. + # + # @return [Integer, nil] + optional :seed, Integer + + # @!attribute temperature + # A higher temperature increases randomness in the outputs. + # + # @return [Float, nil] + optional :temperature, Float + + # @!attribute top_p + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + # + # @return [Float, nil] + optional :top_p, Float + + # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) + # @param max_completion_tokens [Integer] + # @param seed [Integer] + # @param temperature [Float] + # @param top_p [Float] + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource)] + # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource)] end end end diff --git a/lib/openai/models/evals/run_create_response.rb b/lib/openai/models/evals/run_create_response.rb index 25892cb6..22a5752b 100644 --- a/lib/openai/models/evals/run_create_response.rb +++ b/lib/openai/models/evals/run_create_response.rb @@ -20,7 +20,7 @@ class RunCreateResponse < OpenAI::Internal::Type::BaseModel # @!attribute data_source # Information about the run's data source. # - # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions] required :data_source, union: -> { OpenAI::Models::Evals::RunCreateResponse::DataSource } # @!attribute error @@ -101,7 +101,7 @@ class RunCreateResponse < OpenAI::Internal::Type::BaseModel # # @param id [String] # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions] # @param error [OpenAI::Models::Evals::EvalAPIError] # @param eval_id [String] # @param metadata [Hash{Symbol=>String}, nil] @@ -128,8 +128,456 @@ module DataSource # A CompletionsRunDataSource object describing a model sampling configuration. variant :completions, -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource } + # A ResponsesRunDataSource object describing a model sampling configuration. + variant :completions, -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions } + + class Completions < OpenAI::Internal::Type::BaseModel + # @!attribute source + # A EvalResponsesSource object describing a run data source configuration. + # + # @return [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses] + required :source, union: -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source } + + # @!attribute type + # The type of run data source. Always `completions`. + # + # @return [Symbol, :completions] + required :type, const: :completions + + # @!attribute input_messages + # + # @return [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference, nil] + optional :input_messages, + union: -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages } + + # @!attribute model + # The name of the model to use for generating completions (e.g. "o3-mini"). + # + # @return [String, nil] + optional :model, String + + # @!attribute sampling_params + # + # @return [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams, nil] + optional :sampling_params, + -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams } + + # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # A ResponsesRunDataSource object describing a model sampling configuration. + # + # @param source [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses] + # @param input_messages [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference] + # @param model [String] + # @param sampling_params [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams] + # @param type [Symbol, :completions] + + # A EvalResponsesSource object describing a run data source configuration. + # + # @see OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions#source + module Source + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :file_content, + -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent } + + variant :file_id, -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID } + + # A EvalResponsesSource object describing a run data source configuration. + variant :responses, + -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses } + + class FileContent < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the jsonl file. + # + # @return [Array] + required :content, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::Content] } + + # @!attribute type + # The type of jsonl source. Always `file_content`. + # + # @return [Symbol, :file_content] + required :type, const: :file_content + + # @!method initialize(content:, type: :file_content) + # @param content [Array] + # @param type [Symbol, :file_content] + + class Content < OpenAI::Internal::Type::BaseModel + # @!attribute item + # + # @return [Hash{Symbol=>Object}] + required :item, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!attribute sample + # + # @return [Hash{Symbol=>Object}, nil] + optional :sample, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!method initialize(item:, sample: nil) + # @param item [Hash{Symbol=>Object}] + # @param sample [Hash{Symbol=>Object}] + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # @!attribute id + # The identifier of the file. + # + # @return [String] + required :id, String + + # @!attribute type + # The type of jsonl source. Always `file_id`. + # + # @return [Symbol, :file_id] + required :type, const: :file_id + + # @!method initialize(id:, type: :file_id) + # @param id [String] + # @param type [Symbol, :file_id] + end + + class Responses < OpenAI::Internal::Type::BaseModel + # @!attribute type + # The type of run data source. Always `responses`. + # + # @return [Symbol, :responses] + required :type, const: :responses + + # @!attribute allow_parallel_tool_calls + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :allow_parallel_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute created_after + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_after, Integer, nil?: true + + # @!attribute created_before + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_before, Integer, nil?: true + + # @!attribute has_tool_calls + # Whether the response has tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :has_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute instructions_search + # Optional search string for instructions. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :instructions_search, String, nil?: true + + # @!attribute metadata + # Metadata filter for the responses. This is a query parameter used to select + # responses. + # + # @return [Object, nil] + optional :metadata, OpenAI::Internal::Type::Unknown, nil?: true + + # @!attribute model + # The name of the model to find responses for. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :model, String, nil?: true + + # @!attribute reasoning_effort + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + # + # @return [Symbol, OpenAI::Models::ReasoningEffort, nil] + optional :reasoning_effort, enum: -> { OpenAI::Models::ReasoningEffort }, nil?: true + + # @!attribute temperature + # Sampling temperature. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :temperature, Float, nil?: true + + # @!attribute top_p + # Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :top_p, Float, nil?: true + + # @!attribute users + # List of user identifiers. This is a query parameter used to select responses. + # + # @return [Array, nil] + optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # A EvalResponsesSource object describing a run data source configuration. + # + # @param allow_parallel_tool_calls [Boolean, nil] + # @param created_after [Integer, nil] + # @param created_before [Integer, nil] + # @param has_tool_calls [Boolean, nil] + # @param instructions_search [String, nil] + # @param metadata [Object, nil] + # @param model [String, nil] + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] + # @param temperature [Float, nil] + # @param top_p [Float, nil] + # @param users [Array, nil] + # @param type [Symbol, :responses] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses)] + end + + # @see OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions#input_messages + module InputMessages + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :template, + -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template } + + variant :item_reference, + -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference } + + class Template < OpenAI::Internal::Type::BaseModel + # @!attribute template + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + # + # @return [Array] + required :template, + -> do + OpenAI::Internal::Type::ArrayOf[ + union: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template + ] + end + + # @!attribute type + # The type of input messages. Always `template`. + # + # @return [Symbol, :template] + required :type, const: :template + + # @!method initialize(template:, type: :template) + # @param template [Array] + # @param type [Symbol, :template] + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + variant -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage } + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the message. + # + # @return [String] + required :content, String + + # @!attribute role + # The role of the message (e.g. "system", "assistant", "user"). + # + # @return [String] + required :role, String + + # @!method initialize(content:, role:) + # @param content [String] + # @param role [String] + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + required :content, + union: -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + required :role, + enum: -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type, nil] + optional :type, + enum: -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + # @param role [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + # @param type [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem)] + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # @!attribute item_reference + # A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @return [String] + required :item_reference, String + + # @!attribute type + # The type of input messages. Always `item_reference`. + # + # @return [Symbol, :item_reference] + required :type, const: :item_reference + + # @!method initialize(item_reference:, type: :item_reference) + # @param item_reference [String] + # @param type [Symbol, :item_reference] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference)] + end + + # @see OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions#sampling_params + class SamplingParams < OpenAI::Internal::Type::BaseModel + # @!attribute max_completion_tokens + # The maximum number of tokens in the generated output. + # + # @return [Integer, nil] + optional :max_completion_tokens, Integer + + # @!attribute seed + # A seed value to initialize the randomness, during sampling. + # + # @return [Integer, nil] + optional :seed, Integer + + # @!attribute temperature + # A higher temperature increases randomness in the outputs. + # + # @return [Float, nil] + optional :temperature, Float + + # @!attribute top_p + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + # + # @return [Float, nil] + optional :top_p, Float + + # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) + # @param max_completion_tokens [Integer] + # @param seed [Integer] + # @param temperature [Float] + # @param top_p [Float] + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource)] + # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions)] end class PerModelUsage < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/evals/run_list_params.rb b/lib/openai/models/evals/run_list_params.rb index a2b2afb4..66cd4270 100644 --- a/lib/openai/models/evals/run_list_params.rb +++ b/lib/openai/models/evals/run_list_params.rb @@ -28,8 +28,8 @@ class RunListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::Evals::RunListParams::Order } # @!attribute status - # Filter runs by status. Use "queued" | "in_progress" | "failed" | "completed" | - # "canceled". + # Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # | `canceled`. # # @return [Symbol, OpenAI::Models::Evals::RunListParams::Status, nil] optional :status, enum: -> { OpenAI::Models::Evals::RunListParams::Status } @@ -53,8 +53,8 @@ module Order # @return [Array] end - # Filter runs by status. Use "queued" | "in_progress" | "failed" | "completed" | - # "canceled". + # Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # | `canceled`. module Status extend OpenAI::Internal::Type::Enum diff --git a/lib/openai/models/evals/run_list_response.rb b/lib/openai/models/evals/run_list_response.rb index cda98be8..941d74e1 100644 --- a/lib/openai/models/evals/run_list_response.rb +++ b/lib/openai/models/evals/run_list_response.rb @@ -20,7 +20,7 @@ class RunListResponse < OpenAI::Internal::Type::BaseModel # @!attribute data_source # Information about the run's data source. # - # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunListResponse::DataSource::Completions] required :data_source, union: -> { OpenAI::Models::Evals::RunListResponse::DataSource } # @!attribute error @@ -101,7 +101,7 @@ class RunListResponse < OpenAI::Internal::Type::BaseModel # # @param id [String] # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunListResponse::DataSource::Completions] # @param error [OpenAI::Models::Evals::EvalAPIError] # @param eval_id [String] # @param metadata [Hash{Symbol=>String}, nil] @@ -128,8 +128,452 @@ module DataSource # A CompletionsRunDataSource object describing a model sampling configuration. variant :completions, -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource } + # A ResponsesRunDataSource object describing a model sampling configuration. + variant :completions, -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions } + + class Completions < OpenAI::Internal::Type::BaseModel + # @!attribute source + # A EvalResponsesSource object describing a run data source configuration. + # + # @return [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses] + required :source, union: -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source } + + # @!attribute type + # The type of run data source. Always `completions`. + # + # @return [Symbol, :completions] + required :type, const: :completions + + # @!attribute input_messages + # + # @return [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference, nil] + optional :input_messages, + union: -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages } + + # @!attribute model + # The name of the model to use for generating completions (e.g. "o3-mini"). + # + # @return [String, nil] + optional :model, String + + # @!attribute sampling_params + # + # @return [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams, nil] + optional :sampling_params, + -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams } + + # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # A ResponsesRunDataSource object describing a model sampling configuration. + # + # @param source [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses] + # @param input_messages [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference] + # @param model [String] + # @param sampling_params [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams] + # @param type [Symbol, :completions] + + # A EvalResponsesSource object describing a run data source configuration. + # + # @see OpenAI::Models::Evals::RunListResponse::DataSource::Completions#source + module Source + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :file_content, + -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent } + + variant :file_id, -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID } + + # A EvalResponsesSource object describing a run data source configuration. + variant :responses, + -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses } + + class FileContent < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the jsonl file. + # + # @return [Array] + required :content, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::Content] } + + # @!attribute type + # The type of jsonl source. Always `file_content`. + # + # @return [Symbol, :file_content] + required :type, const: :file_content + + # @!method initialize(content:, type: :file_content) + # @param content [Array] + # @param type [Symbol, :file_content] + + class Content < OpenAI::Internal::Type::BaseModel + # @!attribute item + # + # @return [Hash{Symbol=>Object}] + required :item, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!attribute sample + # + # @return [Hash{Symbol=>Object}, nil] + optional :sample, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!method initialize(item:, sample: nil) + # @param item [Hash{Symbol=>Object}] + # @param sample [Hash{Symbol=>Object}] + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # @!attribute id + # The identifier of the file. + # + # @return [String] + required :id, String + + # @!attribute type + # The type of jsonl source. Always `file_id`. + # + # @return [Symbol, :file_id] + required :type, const: :file_id + + # @!method initialize(id:, type: :file_id) + # @param id [String] + # @param type [Symbol, :file_id] + end + + class Responses < OpenAI::Internal::Type::BaseModel + # @!attribute type + # The type of run data source. Always `responses`. + # + # @return [Symbol, :responses] + required :type, const: :responses + + # @!attribute allow_parallel_tool_calls + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :allow_parallel_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute created_after + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_after, Integer, nil?: true + + # @!attribute created_before + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_before, Integer, nil?: true + + # @!attribute has_tool_calls + # Whether the response has tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :has_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute instructions_search + # Optional search string for instructions. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :instructions_search, String, nil?: true + + # @!attribute metadata + # Metadata filter for the responses. This is a query parameter used to select + # responses. + # + # @return [Object, nil] + optional :metadata, OpenAI::Internal::Type::Unknown, nil?: true + + # @!attribute model + # The name of the model to find responses for. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :model, String, nil?: true + + # @!attribute reasoning_effort + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + # + # @return [Symbol, OpenAI::Models::ReasoningEffort, nil] + optional :reasoning_effort, enum: -> { OpenAI::Models::ReasoningEffort }, nil?: true + + # @!attribute temperature + # Sampling temperature. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :temperature, Float, nil?: true + + # @!attribute top_p + # Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :top_p, Float, nil?: true + + # @!attribute users + # List of user identifiers. This is a query parameter used to select responses. + # + # @return [Array, nil] + optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # A EvalResponsesSource object describing a run data source configuration. + # + # @param allow_parallel_tool_calls [Boolean, nil] + # @param created_after [Integer, nil] + # @param created_before [Integer, nil] + # @param has_tool_calls [Boolean, nil] + # @param instructions_search [String, nil] + # @param metadata [Object, nil] + # @param model [String, nil] + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] + # @param temperature [Float, nil] + # @param top_p [Float, nil] + # @param users [Array, nil] + # @param type [Symbol, :responses] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses)] + end + + # @see OpenAI::Models::Evals::RunListResponse::DataSource::Completions#input_messages + module InputMessages + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :template, + -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template } + + variant :item_reference, + -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference } + + class Template < OpenAI::Internal::Type::BaseModel + # @!attribute template + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + # + # @return [Array] + required :template, + -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template] } + + # @!attribute type + # The type of input messages. Always `template`. + # + # @return [Symbol, :template] + required :type, const: :template + + # @!method initialize(template:, type: :template) + # @param template [Array] + # @param type [Symbol, :template] + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + variant -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage } + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the message. + # + # @return [String] + required :content, String + + # @!attribute role + # The role of the message (e.g. "system", "assistant", "user"). + # + # @return [String] + required :role, String + + # @!method initialize(content:, role:) + # @param content [String] + # @param role [String] + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + required :content, + union: -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + required :role, + enum: -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type, nil] + optional :type, + enum: -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + # @param role [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + # @param type [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem)] + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # @!attribute item_reference + # A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @return [String] + required :item_reference, String + + # @!attribute type + # The type of input messages. Always `item_reference`. + # + # @return [Symbol, :item_reference] + required :type, const: :item_reference + + # @!method initialize(item_reference:, type: :item_reference) + # @param item_reference [String] + # @param type [Symbol, :item_reference] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference)] + end + + # @see OpenAI::Models::Evals::RunListResponse::DataSource::Completions#sampling_params + class SamplingParams < OpenAI::Internal::Type::BaseModel + # @!attribute max_completion_tokens + # The maximum number of tokens in the generated output. + # + # @return [Integer, nil] + optional :max_completion_tokens, Integer + + # @!attribute seed + # A seed value to initialize the randomness, during sampling. + # + # @return [Integer, nil] + optional :seed, Integer + + # @!attribute temperature + # A higher temperature increases randomness in the outputs. + # + # @return [Float, nil] + optional :temperature, Float + + # @!attribute top_p + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + # + # @return [Float, nil] + optional :top_p, Float + + # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) + # @param max_completion_tokens [Integer] + # @param seed [Integer] + # @param temperature [Float] + # @param top_p [Float] + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource)] + # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunListResponse::DataSource::Completions)] end class PerModelUsage < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/evals/run_retrieve_response.rb b/lib/openai/models/evals/run_retrieve_response.rb index dabdd0a5..55c35341 100644 --- a/lib/openai/models/evals/run_retrieve_response.rb +++ b/lib/openai/models/evals/run_retrieve_response.rb @@ -20,7 +20,7 @@ class RunRetrieveResponse < OpenAI::Internal::Type::BaseModel # @!attribute data_source # Information about the run's data source. # - # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @return [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions] required :data_source, union: -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource } # @!attribute error @@ -101,7 +101,7 @@ class RunRetrieveResponse < OpenAI::Internal::Type::BaseModel # # @param id [String] # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions] # @param error [OpenAI::Models::Evals::EvalAPIError] # @param eval_id [String] # @param metadata [Hash{Symbol=>String}, nil] @@ -128,8 +128,458 @@ module DataSource # A CompletionsRunDataSource object describing a model sampling configuration. variant :completions, -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource } + # A ResponsesRunDataSource object describing a model sampling configuration. + variant :completions, -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions } + + class Completions < OpenAI::Internal::Type::BaseModel + # @!attribute source + # A EvalResponsesSource object describing a run data source configuration. + # + # @return [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses] + required :source, + union: -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source } + + # @!attribute type + # The type of run data source. Always `completions`. + # + # @return [Symbol, :completions] + required :type, const: :completions + + # @!attribute input_messages + # + # @return [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference, nil] + optional :input_messages, + union: -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages } + + # @!attribute model + # The name of the model to use for generating completions (e.g. "o3-mini"). + # + # @return [String, nil] + optional :model, String + + # @!attribute sampling_params + # + # @return [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams, nil] + optional :sampling_params, + -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams } + + # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # A ResponsesRunDataSource object describing a model sampling configuration. + # + # @param source [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses] + # @param input_messages [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference] + # @param model [String] + # @param sampling_params [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams] + # @param type [Symbol, :completions] + + # A EvalResponsesSource object describing a run data source configuration. + # + # @see OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions#source + module Source + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :file_content, + -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent } + + variant :file_id, + -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID } + + # A EvalResponsesSource object describing a run data source configuration. + variant :responses, + -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses } + + class FileContent < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the jsonl file. + # + # @return [Array] + required :content, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::Content] } + + # @!attribute type + # The type of jsonl source. Always `file_content`. + # + # @return [Symbol, :file_content] + required :type, const: :file_content + + # @!method initialize(content:, type: :file_content) + # @param content [Array] + # @param type [Symbol, :file_content] + + class Content < OpenAI::Internal::Type::BaseModel + # @!attribute item + # + # @return [Hash{Symbol=>Object}] + required :item, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!attribute sample + # + # @return [Hash{Symbol=>Object}, nil] + optional :sample, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] + + # @!method initialize(item:, sample: nil) + # @param item [Hash{Symbol=>Object}] + # @param sample [Hash{Symbol=>Object}] + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # @!attribute id + # The identifier of the file. + # + # @return [String] + required :id, String + + # @!attribute type + # The type of jsonl source. Always `file_id`. + # + # @return [Symbol, :file_id] + required :type, const: :file_id + + # @!method initialize(id:, type: :file_id) + # @param id [String] + # @param type [Symbol, :file_id] + end + + class Responses < OpenAI::Internal::Type::BaseModel + # @!attribute type + # The type of run data source. Always `responses`. + # + # @return [Symbol, :responses] + required :type, const: :responses + + # @!attribute allow_parallel_tool_calls + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :allow_parallel_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute created_after + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_after, Integer, nil?: true + + # @!attribute created_before + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + # + # @return [Integer, nil] + optional :created_before, Integer, nil?: true + + # @!attribute has_tool_calls + # Whether the response has tool calls. This is a query parameter used to select + # responses. + # + # @return [Boolean, nil] + optional :has_tool_calls, OpenAI::Internal::Type::Boolean, nil?: true + + # @!attribute instructions_search + # Optional search string for instructions. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :instructions_search, String, nil?: true + + # @!attribute metadata + # Metadata filter for the responses. This is a query parameter used to select + # responses. + # + # @return [Object, nil] + optional :metadata, OpenAI::Internal::Type::Unknown, nil?: true + + # @!attribute model + # The name of the model to find responses for. This is a query parameter used to + # select responses. + # + # @return [String, nil] + optional :model, String, nil?: true + + # @!attribute reasoning_effort + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + # + # @return [Symbol, OpenAI::Models::ReasoningEffort, nil] + optional :reasoning_effort, enum: -> { OpenAI::Models::ReasoningEffort }, nil?: true + + # @!attribute temperature + # Sampling temperature. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :temperature, Float, nil?: true + + # @!attribute top_p + # Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @return [Float, nil] + optional :top_p, Float, nil?: true + + # @!attribute users + # List of user identifiers. This is a query parameter used to select responses. + # + # @return [Array, nil] + optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # A EvalResponsesSource object describing a run data source configuration. + # + # @param allow_parallel_tool_calls [Boolean, nil] + # @param created_after [Integer, nil] + # @param created_before [Integer, nil] + # @param has_tool_calls [Boolean, nil] + # @param instructions_search [String, nil] + # @param metadata [Object, nil] + # @param model [String, nil] + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] + # @param temperature [Float, nil] + # @param top_p [Float, nil] + # @param users [Array, nil] + # @param type [Symbol, :responses] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses)] + end + + # @see OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions#input_messages + module InputMessages + extend OpenAI::Internal::Type::Union + + discriminator :type + + variant :template, + -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template } + + variant :item_reference, + -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference } + + class Template < OpenAI::Internal::Type::BaseModel + # @!attribute template + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + # + # @return [Array] + required :template, + -> do + OpenAI::Internal::Type::ArrayOf[ + union: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template + ] + end + + # @!attribute type + # The type of input messages. Always `template`. + # + # @return [Symbol, :template] + required :type, const: :template + + # @!method initialize(template:, type: :template) + # @param template [Array] + # @param type [Symbol, :template] + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + variant -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage } + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + variant -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # @!attribute content + # The content of the message. + # + # @return [String] + required :content, String + + # @!attribute role + # The role of the message (e.g. "system", "assistant", "user"). + # + # @return [String] + required :role, String + + # @!method initialize(content:, role:) + # @param content [String] + # @param role [String] + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # @!attribute content + # Text inputs to the model - can contain template strings. + # + # @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + required :content, + union: -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content } + + # @!attribute role + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @return [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + required :role, + enum: -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role } + + # @!attribute type + # The type of the message input. Always `message`. + # + # @return [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type, nil] + optional :type, + enum: -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } + + # @!method initialize(content:, role:, type: nil) + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + # + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + # @param role [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] + # @param type [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + + # Text inputs to the model - can contain template strings. + # + # @see OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#content + module Content + extend OpenAI::Internal::Type::Union + + # A text input to the model. + variant String + + # A text input to the model. + variant -> { OpenAI::Models::Responses::ResponseInputText } + + # A text output from the model. + variant -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText } + + class OutputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text output from the model. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the output text. Always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(text:, type: :output_text) + # A text output from the model. + # + # @param text [String] + # @param type [Symbol, :output_text] + end + + # @!method self.variants + # @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText)] + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + # + # @see OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#role + module Role + extend OpenAI::Internal::Type::Enum + + USER = :user + ASSISTANT = :assistant + SYSTEM = :system + DEVELOPER = :developer + + # @!method self.values + # @return [Array] + end + + # The type of the message input. Always `message`. + # + # @see OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem#type + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE = :message + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem)] + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # @!attribute item_reference + # A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @return [String] + required :item_reference, String + + # @!attribute type + # The type of input messages. Always `item_reference`. + # + # @return [Symbol, :item_reference] + required :type, const: :item_reference + + # @!method initialize(item_reference:, type: :item_reference) + # @param item_reference [String] + # @param type [Symbol, :item_reference] + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference)] + end + + # @see OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions#sampling_params + class SamplingParams < OpenAI::Internal::Type::BaseModel + # @!attribute max_completion_tokens + # The maximum number of tokens in the generated output. + # + # @return [Integer, nil] + optional :max_completion_tokens, Integer + + # @!attribute seed + # A seed value to initialize the randomness, during sampling. + # + # @return [Integer, nil] + optional :seed, Integer + + # @!attribute temperature + # A higher temperature increases randomness in the outputs. + # + # @return [Float, nil] + optional :temperature, Float + + # @!attribute top_p + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + # + # @return [Float, nil] + optional :top_p, Float + + # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) + # @param max_completion_tokens [Integer] + # @param seed [Integer] + # @param temperature [Float] + # @param top_p [Float] + end + end + # @!method self.variants - # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource)] + # @return [Array(OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions)] end class PerModelUsage < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rb b/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rb index 339cc7ea..402eb4c2 100644 --- a/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rb +++ b/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rb @@ -9,7 +9,13 @@ class PermissionDeleteParams < OpenAI::Internal::Type::BaseModel extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - # @!method initialize(request_options: {}) + # @!attribute fine_tuned_model_checkpoint + # + # @return [String] + required :fine_tuned_model_checkpoint, String + + # @!method initialize(fine_tuned_model_checkpoint:, request_options: {}) + # @param fine_tuned_model_checkpoint [String] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/image.rb b/lib/openai/models/image.rb index d76cb186..52ace3e6 100644 --- a/lib/openai/models/image.rb +++ b/lib/openai/models/image.rb @@ -4,27 +4,29 @@ module OpenAI module Models class Image < OpenAI::Internal::Type::BaseModel # @!attribute b64_json - # The base64-encoded JSON of the generated image, if `response_format` is - # `b64_json`. + # The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, + # and only present if `response_format` is set to `b64_json` for `dall-e-2` and + # `dall-e-3`. # # @return [String, nil] optional :b64_json, String # @!attribute revised_prompt - # The prompt that was used to generate the image, if there was any revision to the - # prompt. + # For `dall-e-3` only, the revised prompt that was used to generate the image. # # @return [String, nil] optional :revised_prompt, String # @!attribute url - # The URL of the generated image, if `response_format` is `url` (default). + # When using `dall-e-2` or `dall-e-3`, the URL of the generated image if + # `response_format` is set to `url` (default value). Unsupported for + # `gpt-image-1`. # # @return [String, nil] optional :url, String # @!method initialize(b64_json: nil, revised_prompt: nil, url: nil) - # Represents the url or the content of an image generated by the OpenAI API. + # Represents the content or the URL of an image generated by the OpenAI API. # # @param b64_json [String] # @param revised_prompt [String] diff --git a/lib/openai/models/image_create_variation_params.rb b/lib/openai/models/image_create_variation_params.rb index 763a9b9a..4a665cb8 100644 --- a/lib/openai/models/image_create_variation_params.rb +++ b/lib/openai/models/image_create_variation_params.rb @@ -22,8 +22,7 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel optional :model, union: -> { OpenAI::Models::ImageCreateVariationParams::Model }, nil?: true # @!attribute n - # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only - # `n=1` is supported. + # The number of images to generate. Must be between 1 and 10. # # @return [Integer, nil] optional :n, Integer, nil?: true diff --git a/lib/openai/models/image_edit_params.rb b/lib/openai/models/image_edit_params.rb index 19525b78..7abf3372 100644 --- a/lib/openai/models/image_edit_params.rb +++ b/lib/openai/models/image_edit_params.rb @@ -8,30 +8,34 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel include OpenAI::Internal::Type::RequestParameters # @!attribute image - # The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask - # is not provided, image must have transparency, which will be used as the mask. + # The image(s) to edit. Must be a supported image file or an array of images. For + # `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square + # `png` file less than 4MB. # - # @return [Pathname, StringIO] - required :image, OpenAI::Internal::Type::IOLike + # @return [Pathname, StringIO, Array] + required :image, union: -> { OpenAI::Models::ImageEditParams::Image } # @!attribute prompt # A text description of the desired image(s). The maximum length is 1000 - # characters. + # characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. # # @return [String] required :prompt, String # @!attribute mask # An additional image whose fully transparent areas (e.g. where alpha is zero) - # indicate where `image` should be edited. Must be a valid PNG file, less than + # indicate where `image` should be edited. If there are multiple images provided, + # the mask will be applied on the first image. Must be a valid PNG file, less than # 4MB, and have the same dimensions as `image`. # # @return [Pathname, StringIO, nil] optional :mask, OpenAI::Internal::Type::IOLike # @!attribute model - # The model to use for image generation. Only `dall-e-2` is supported at this - # time. + # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are + # supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` + # is used. # # @return [String, Symbol, OpenAI::Models::ImageModel, nil] optional :model, union: -> { OpenAI::Models::ImageEditParams::Model }, nil?: true @@ -42,17 +46,27 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # @return [Integer, nil] optional :n, Integer, nil?: true + # @!attribute quality + # The quality of the image that will be generated. `high`, `medium` and `low` are + # only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. + # Defaults to `auto`. + # + # @return [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] + optional :quality, enum: -> { OpenAI::Models::ImageEditParams::Quality }, nil?: true + # @!attribute response_format # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` + # will always return base64-encoded images. # # @return [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] optional :response_format, enum: -> { OpenAI::Models::ImageEditParams::ResponseFormat }, nil?: true # @!attribute size - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024`. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. # # @return [Symbol, OpenAI::Models::ImageEditParams::Size, nil] optional :size, enum: -> { OpenAI::Models::ImageEditParams::Size }, nil?: true @@ -65,34 +79,70 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # @return [String, nil] optional :user, String - # @!method initialize(image:, prompt:, mask: nil, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) - # @param image [Pathname, StringIO] + # @!method initialize(image:, prompt:, mask: nil, model: nil, n: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {}) + # @param image [Pathname, StringIO, Array] # @param prompt [String] # @param mask [Pathname, StringIO] # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] # @param n [Integer, nil] + # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] # @param size [Symbol, OpenAI::Models::ImageEditParams::Size, nil] # @param user [String] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] - # The model to use for image generation. Only `dall-e-2` is supported at this - # time. + # The image(s) to edit. Must be a supported image file or an array of images. For + # `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square + # `png` file less than 4MB. + module Image + extend OpenAI::Internal::Type::Union + + variant OpenAI::Internal::Type::IOLike + + variant -> { OpenAI::Models::ImageEditParams::Image::StringArray } + + # @!method self.variants + # @return [Array(StringIO, Array)] + + StringArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::IOLike] + end + + # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are + # supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` + # is used. module Model extend OpenAI::Internal::Type::Union variant String - # The model to use for image generation. Only `dall-e-2` is supported at this time. + # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used. variant enum: -> { OpenAI::Models::ImageModel } # @!method self.variants # @return [Array(String, Symbol, OpenAI::Models::ImageModel)] end + # The quality of the image that will be generated. `high`, `medium` and `low` are + # only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. + # Defaults to `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + STANDARD = :standard + LOW = :low + MEDIUM = :medium + HIGH = :high + AUTO = :auto + + # @!method self.values + # @return [Array] + end + # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` + # will always return base64-encoded images. module ResponseFormat extend OpenAI::Internal::Type::Enum @@ -103,8 +153,9 @@ module ResponseFormat # @return [Array] end - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024`. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. module Size extend OpenAI::Internal::Type::Enum diff --git a/lib/openai/models/image_generate_params.rb b/lib/openai/models/image_generate_params.rb index 9e5550f1..56986585 100644 --- a/lib/openai/models/image_generate_params.rb +++ b/lib/openai/models/image_generate_params.rb @@ -8,18 +8,40 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel include OpenAI::Internal::Type::RequestParameters # @!attribute prompt - # A text description of the desired image(s). The maximum length is 1000 - # characters for `dall-e-2` and 4000 characters for `dall-e-3`. + # A text description of the desired image(s). The maximum length is 32000 + # characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters + # for `dall-e-3`. # # @return [String] required :prompt, String + # @!attribute background + # Allows to set transparency for the background of the generated image(s). This + # parameter is only supported for `gpt-image-1`. Must be one of `transparent`, + # `opaque` or `auto` (default value). When `auto` is used, the model will + # automatically determine the best background for the image. + # + # If `transparent`, the output format needs to support transparency, so it should + # be set to either `png` (default value) or `webp`. + # + # @return [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] + optional :background, enum: -> { OpenAI::Models::ImageGenerateParams::Background }, nil?: true + # @!attribute model - # The model to use for image generation. + # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or + # `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to + # `gpt-image-1` is used. # # @return [String, Symbol, OpenAI::Models::ImageModel, nil] optional :model, union: -> { OpenAI::Models::ImageGenerateParams::Model }, nil?: true + # @!attribute moderation + # Control the content-moderation level for images generated by `gpt-image-1`. Must + # be either `low` for less restrictive filtering or `auto` (default value). + # + # @return [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil] + optional :moderation, enum: -> { OpenAI::Models::ImageGenerateParams::Moderation }, nil?: true + # @!attribute n # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only # `n=1` is supported. @@ -27,35 +49,56 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # @return [Integer, nil] optional :n, Integer, nil?: true + # @!attribute output_compression + # The compression level (0-100%) for the generated images. This parameter is only + # supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + # defaults to 100. + # + # @return [Integer, nil] + optional :output_compression, Integer, nil?: true + + # @!attribute output_format + # The format in which the generated images are returned. This parameter is only + # supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + # + # @return [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil] + optional :output_format, enum: -> { OpenAI::Models::ImageGenerateParams::OutputFormat }, nil?: true + # @!attribute quality - # The quality of the image that will be generated. `hd` creates images with finer - # details and greater consistency across the image. This param is only supported - # for `dall-e-3`. + # The quality of the image that will be generated. + # + # - `auto` (default value) will automatically select the best quality for the + # given model. + # - `high`, `medium` and `low` are supported for `gpt-image-1`. + # - `hd` and `standard` are supported for `dall-e-3`. + # - `standard` is the only option for `dall-e-2`. # # @return [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil] - optional :quality, enum: -> { OpenAI::Models::ImageGenerateParams::Quality } + optional :quality, enum: -> { OpenAI::Models::ImageGenerateParams::Quality }, nil?: true # @!attribute response_format - # The format in which the generated images are returned. Must be one of `url` or - # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # The format in which generated images with `dall-e-2` and `dall-e-3` are + # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes + # after the image has been generated. This parameter isn't supported for + # `gpt-image-1` which will always return base64-encoded images. # # @return [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] optional :response_format, enum: -> { OpenAI::Models::ImageGenerateParams::ResponseFormat }, nil?: true # @!attribute size - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or - # `1024x1792` for `dall-e-3` models. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and + # one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. # # @return [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] optional :size, enum: -> { OpenAI::Models::ImageGenerateParams::Size }, nil?: true # @!attribute style - # The style of the generated images. Must be one of `vivid` or `natural`. Vivid - # causes the model to lean towards generating hyper-real and dramatic images. - # Natural causes the model to produce more natural, less hyper-real looking - # images. This param is only supported for `dall-e-3`. + # The style of the generated images. This parameter is only supported for + # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean + # towards generating hyper-real and dramatic images. Natural causes the model to + # produce more natural, less hyper-real looking images. # # @return [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] optional :style, enum: -> { OpenAI::Models::ImageGenerateParams::Style }, nil?: true @@ -68,46 +111,104 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # @return [String, nil] optional :user, String - # @!method initialize(prompt:, model: nil, n: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {}) + # @!method initialize(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {}) # @param prompt [String] + # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] + # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil] # @param n [Integer, nil] - # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality] + # @param output_compression [Integer, nil] + # @param output_format [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil] + # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil] # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] # @param size [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] # @param user [String] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] - # The model to use for image generation. + # Allows to set transparency for the background of the generated image(s). This + # parameter is only supported for `gpt-image-1`. Must be one of `transparent`, + # `opaque` or `auto` (default value). When `auto` is used, the model will + # automatically determine the best background for the image. + # + # If `transparent`, the output format needs to support transparency, so it should + # be set to either `png` (default value) or `webp`. + module Background + extend OpenAI::Internal::Type::Enum + + TRANSPARENT = :transparent + OPAQUE = :opaque + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or + # `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to + # `gpt-image-1` is used. module Model extend OpenAI::Internal::Type::Union variant String - # The model to use for image generation. + # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used. variant enum: -> { OpenAI::Models::ImageModel } # @!method self.variants # @return [Array(String, Symbol, OpenAI::Models::ImageModel)] end - # The quality of the image that will be generated. `hd` creates images with finer - # details and greater consistency across the image. This param is only supported - # for `dall-e-3`. + # Control the content-moderation level for images generated by `gpt-image-1`. Must + # be either `low` for less restrictive filtering or `auto` (default value). + module Moderation + extend OpenAI::Internal::Type::Enum + + LOW = :low + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The format in which the generated images are returned. This parameter is only + # supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + module OutputFormat + extend OpenAI::Internal::Type::Enum + + PNG = :png + JPEG = :jpeg + WEBP = :webp + + # @!method self.values + # @return [Array] + end + + # The quality of the image that will be generated. + # + # - `auto` (default value) will automatically select the best quality for the + # given model. + # - `high`, `medium` and `low` are supported for `gpt-image-1`. + # - `hd` and `standard` are supported for `dall-e-3`. + # - `standard` is the only option for `dall-e-2`. module Quality extend OpenAI::Internal::Type::Enum STANDARD = :standard HD = :hd + LOW = :low + MEDIUM = :medium + HIGH = :high + AUTO = :auto # @!method self.values # @return [Array] end - # The format in which the generated images are returned. Must be one of `url` or - # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # The format in which generated images with `dall-e-2` and `dall-e-3` are + # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes + # after the image has been generated. This parameter isn't supported for + # `gpt-image-1` which will always return base64-encoded images. module ResponseFormat extend OpenAI::Internal::Type::Enum @@ -118,15 +219,19 @@ module ResponseFormat # @return [Array] end - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or - # `1024x1792` for `dall-e-3` models. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and + # one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. module Size extend OpenAI::Internal::Type::Enum + AUTO = :auto + SIZE_1024X1024 = :"1024x1024" + SIZE_1536X1024 = :"1536x1024" + SIZE_1024X1536 = :"1024x1536" SIZE_256X256 = :"256x256" SIZE_512X512 = :"512x512" - SIZE_1024X1024 = :"1024x1024" SIZE_1792X1024 = :"1792x1024" SIZE_1024X1792 = :"1024x1792" @@ -134,10 +239,10 @@ module Size # @return [Array] end - # The style of the generated images. Must be one of `vivid` or `natural`. Vivid - # causes the model to lean towards generating hyper-real and dramatic images. - # Natural causes the model to produce more natural, less hyper-real looking - # images. This param is only supported for `dall-e-3`. + # The style of the generated images. This parameter is only supported for + # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean + # towards generating hyper-real and dramatic images. Natural causes the model to + # produce more natural, less hyper-real looking images. module Style extend OpenAI::Internal::Type::Enum diff --git a/lib/openai/models/image_model.rb b/lib/openai/models/image_model.rb index 4b6ca64c..0bd2690e 100644 --- a/lib/openai/models/image_model.rb +++ b/lib/openai/models/image_model.rb @@ -7,6 +7,7 @@ module ImageModel DALL_E_2 = :"dall-e-2" DALL_E_3 = :"dall-e-3" + GPT_IMAGE_1 = :"gpt-image-1" # @!method self.values # @return [Array] diff --git a/lib/openai/models/images_response.rb b/lib/openai/models/images_response.rb index 8816ee07..90c77f01 100644 --- a/lib/openai/models/images_response.rb +++ b/lib/openai/models/images_response.rb @@ -5,18 +5,85 @@ module Models # @see OpenAI::Resources::Images#create_variation class ImagesResponse < OpenAI::Internal::Type::BaseModel # @!attribute created + # The Unix timestamp (in seconds) of when the image was created. # # @return [Integer] required :created, Integer # @!attribute data + # The list of generated images. # - # @return [Array] - required :data, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image] } + # @return [Array, nil] + optional :data, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image] } - # @!method initialize(created:, data:) + # @!attribute usage + # For `gpt-image-1` only, the token usage information for the image generation. + # + # @return [OpenAI::Models::ImagesResponse::Usage, nil] + optional :usage, -> { OpenAI::Models::ImagesResponse::Usage } + + # @!method initialize(created:, data: nil, usage: nil) + # The response from the image generation endpoint. + # # @param created [Integer] # @param data [Array] + # @param usage [OpenAI::Models::ImagesResponse::Usage] + + # @see OpenAI::Models::ImagesResponse#usage + class Usage < OpenAI::Internal::Type::BaseModel + # @!attribute input_tokens + # The number of tokens (images and text) in the input prompt. + # + # @return [Integer] + required :input_tokens, Integer + + # @!attribute input_tokens_details + # The input tokens detailed information for the image generation. + # + # @return [OpenAI::Models::ImagesResponse::Usage::InputTokensDetails] + required :input_tokens_details, -> { OpenAI::Models::ImagesResponse::Usage::InputTokensDetails } + + # @!attribute output_tokens + # The number of image tokens in the output image. + # + # @return [Integer] + required :output_tokens, Integer + + # @!attribute total_tokens + # The total number of tokens (images and text) used for the image generation. + # + # @return [Integer] + required :total_tokens, Integer + + # @!method initialize(input_tokens:, input_tokens_details:, output_tokens:, total_tokens:) + # For `gpt-image-1` only, the token usage information for the image generation. + # + # @param input_tokens [Integer] + # @param input_tokens_details [OpenAI::Models::ImagesResponse::Usage::InputTokensDetails] + # @param output_tokens [Integer] + # @param total_tokens [Integer] + + # @see OpenAI::Models::ImagesResponse::Usage#input_tokens_details + class InputTokensDetails < OpenAI::Internal::Type::BaseModel + # @!attribute image_tokens + # The number of image tokens in the input prompt. + # + # @return [Integer] + required :image_tokens, Integer + + # @!attribute text_tokens + # The number of text tokens in the input prompt. + # + # @return [Integer] + required :text_tokens, Integer + + # @!method initialize(image_tokens:, text_tokens:) + # The input tokens detailed information for the image generation. + # + # @param image_tokens [Integer] + # @param text_tokens [Integer] + end + end end end end diff --git a/lib/openai/models/responses/response_reasoning_summary_part_added_event.rb b/lib/openai/models/responses/response_reasoning_summary_part_added_event.rb new file mode 100644 index 00000000..a7f42ec3 --- /dev/null +++ b/lib/openai/models/responses/response_reasoning_summary_part_added_event.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryPartAddedEvent < OpenAI::Internal::Type::BaseModel + # @!attribute item_id + # The ID of the item this summary part is associated with. + # + # @return [String] + required :item_id, String + + # @!attribute output_index + # The index of the output item this summary part is associated with. + # + # @return [Integer] + required :output_index, Integer + + # @!attribute part + # The summary part that was added. + # + # @return [OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part] + required :part, -> { OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part } + + # @!attribute summary_index + # The index of the summary part within the reasoning summary. + # + # @return [Integer] + required :summary_index, Integer + + # @!attribute type + # The type of the event. Always `response.reasoning_summary_part.added`. + # + # @return [Symbol, :"response.reasoning_summary_part.added"] + required :type, const: :"response.reasoning_summary_part.added" + + # @!method initialize(item_id:, output_index:, part:, summary_index:, type: :"response.reasoning_summary_part.added") + # Emitted when a new reasoning summary part is added. + # + # @param item_id [String] + # @param output_index [Integer] + # @param part [OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part] + # @param summary_index [Integer] + # @param type [Symbol, :"response.reasoning_summary_part.added"] + + # @see OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent#part + class Part < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text of the summary part. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the summary part. Always `summary_text`. + # + # @return [Symbol, :summary_text] + required :type, const: :summary_text + + # @!method initialize(text:, type: :summary_text) + # The summary part that was added. + # + # @param text [String] + # @param type [Symbol, :summary_text] + end + end + end + end +end diff --git a/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb b/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb new file mode 100644 index 00000000..c868638f --- /dev/null +++ b/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryPartDoneEvent < OpenAI::Internal::Type::BaseModel + # @!attribute item_id + # The ID of the item this summary part is associated with. + # + # @return [String] + required :item_id, String + + # @!attribute output_index + # The index of the output item this summary part is associated with. + # + # @return [Integer] + required :output_index, Integer + + # @!attribute part + # The completed summary part. + # + # @return [OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part] + required :part, -> { OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part } + + # @!attribute summary_index + # The index of the summary part within the reasoning summary. + # + # @return [Integer] + required :summary_index, Integer + + # @!attribute type + # The type of the event. Always `response.reasoning_summary_part.done`. + # + # @return [Symbol, :"response.reasoning_summary_part.done"] + required :type, const: :"response.reasoning_summary_part.done" + + # @!method initialize(item_id:, output_index:, part:, summary_index:, type: :"response.reasoning_summary_part.done") + # Emitted when a reasoning summary part is completed. + # + # @param item_id [String] + # @param output_index [Integer] + # @param part [OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part] + # @param summary_index [Integer] + # @param type [Symbol, :"response.reasoning_summary_part.done"] + + # @see OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent#part + class Part < OpenAI::Internal::Type::BaseModel + # @!attribute text + # The text of the summary part. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the summary part. Always `summary_text`. + # + # @return [Symbol, :summary_text] + required :type, const: :summary_text + + # @!method initialize(text:, type: :summary_text) + # The completed summary part. + # + # @param text [String] + # @param type [Symbol, :summary_text] + end + end + end + end +end diff --git a/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb b/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb new file mode 100644 index 00000000..d816e961 --- /dev/null +++ b/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryTextDeltaEvent < OpenAI::Internal::Type::BaseModel + # @!attribute delta + # The text delta that was added to the summary. + # + # @return [String] + required :delta, String + + # @!attribute item_id + # The ID of the item this summary text delta is associated with. + # + # @return [String] + required :item_id, String + + # @!attribute output_index + # The index of the output item this summary text delta is associated with. + # + # @return [Integer] + required :output_index, Integer + + # @!attribute summary_index + # The index of the summary part within the reasoning summary. + # + # @return [Integer] + required :summary_index, Integer + + # @!attribute type + # The type of the event. Always `response.reasoning_summary_text.delta`. + # + # @return [Symbol, :"response.reasoning_summary_text.delta"] + required :type, const: :"response.reasoning_summary_text.delta" + + # @!method initialize(delta:, item_id:, output_index:, summary_index:, type: :"response.reasoning_summary_text.delta") + # Emitted when a delta is added to a reasoning summary text. + # + # @param delta [String] + # @param item_id [String] + # @param output_index [Integer] + # @param summary_index [Integer] + # @param type [Symbol, :"response.reasoning_summary_text.delta"] + end + end + end +end diff --git a/lib/openai/models/responses/response_reasoning_summary_text_done_event.rb b/lib/openai/models/responses/response_reasoning_summary_text_done_event.rb new file mode 100644 index 00000000..93e8cadc --- /dev/null +++ b/lib/openai/models/responses/response_reasoning_summary_text_done_event.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryTextDoneEvent < OpenAI::Internal::Type::BaseModel + # @!attribute item_id + # The ID of the item this summary text is associated with. + # + # @return [String] + required :item_id, String + + # @!attribute output_index + # The index of the output item this summary text is associated with. + # + # @return [Integer] + required :output_index, Integer + + # @!attribute summary_index + # The index of the summary part within the reasoning summary. + # + # @return [Integer] + required :summary_index, Integer + + # @!attribute text + # The full text of the completed reasoning summary. + # + # @return [String] + required :text, String + + # @!attribute type + # The type of the event. Always `response.reasoning_summary_text.done`. + # + # @return [Symbol, :"response.reasoning_summary_text.done"] + required :type, const: :"response.reasoning_summary_text.done" + + # @!method initialize(item_id:, output_index:, summary_index:, text:, type: :"response.reasoning_summary_text.done") + # Emitted when a reasoning summary text is completed. + # + # @param item_id [String] + # @param output_index [Integer] + # @param summary_index [Integer] + # @param text [String] + # @param type [Symbol, :"response.reasoning_summary_text.done"] + end + end + end +end diff --git a/lib/openai/models/responses/response_stream_event.rb b/lib/openai/models/responses/response_stream_event.rb index d6c7fee7..95156d56 100644 --- a/lib/openai/models/responses/response_stream_event.rb +++ b/lib/openai/models/responses/response_stream_event.rb @@ -93,6 +93,22 @@ module ResponseStreamEvent # Emitted when an output item is marked done. variant :"response.output_item.done", -> { OpenAI::Models::Responses::ResponseOutputItemDoneEvent } + # Emitted when a new reasoning summary part is added. + variant :"response.reasoning_summary_part.added", + -> { OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent } + + # Emitted when a reasoning summary part is completed. + variant :"response.reasoning_summary_part.done", + -> { OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent } + + # Emitted when a delta is added to a reasoning summary text. + variant :"response.reasoning_summary_text.delta", + -> { OpenAI::Models::Responses::ResponseReasoningSummaryTextDeltaEvent } + + # Emitted when a reasoning summary text is completed. + variant :"response.reasoning_summary_text.done", + -> { OpenAI::Models::Responses::ResponseReasoningSummaryTextDoneEvent } + # Emitted when there is a partial refusal text. variant :"response.refusal.delta", -> { OpenAI::Models::Responses::ResponseRefusalDeltaEvent } @@ -122,7 +138,7 @@ module ResponseStreamEvent -> { OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent } # @!method self.variants - # @return [Array(OpenAI::Models::Responses::ResponseAudioDeltaEvent, OpenAI::Models::Responses::ResponseAudioDoneEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent, OpenAI::Models::Responses::ResponseCompletedEvent, OpenAI::Models::Responses::ResponseContentPartAddedEvent, OpenAI::Models::Responses::ResponseContentPartDoneEvent, OpenAI::Models::Responses::ResponseCreatedEvent, OpenAI::Models::Responses::ResponseErrorEvent, OpenAI::Models::Responses::ResponseFileSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseFileSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseFileSearchCallSearchingEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Responses::ResponseInProgressEvent, OpenAI::Models::Responses::ResponseFailedEvent, OpenAI::Models::Responses::ResponseIncompleteEvent, OpenAI::Models::Responses::ResponseOutputItemAddedEvent, OpenAI::Models::Responses::ResponseOutputItemDoneEvent, OpenAI::Models::Responses::ResponseRefusalDeltaEvent, OpenAI::Models::Responses::ResponseRefusalDoneEvent, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent, OpenAI::Models::Responses::ResponseTextDeltaEvent, OpenAI::Models::Responses::ResponseTextDoneEvent, OpenAI::Models::Responses::ResponseWebSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseWebSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent)] + # @return [Array(OpenAI::Models::Responses::ResponseAudioDeltaEvent, OpenAI::Models::Responses::ResponseAudioDoneEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent, OpenAI::Models::Responses::ResponseCompletedEvent, OpenAI::Models::Responses::ResponseContentPartAddedEvent, OpenAI::Models::Responses::ResponseContentPartDoneEvent, OpenAI::Models::Responses::ResponseCreatedEvent, OpenAI::Models::Responses::ResponseErrorEvent, OpenAI::Models::Responses::ResponseFileSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseFileSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseFileSearchCallSearchingEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Responses::ResponseInProgressEvent, OpenAI::Models::Responses::ResponseFailedEvent, OpenAI::Models::Responses::ResponseIncompleteEvent, OpenAI::Models::Responses::ResponseOutputItemAddedEvent, OpenAI::Models::Responses::ResponseOutputItemDoneEvent, OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent, OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent, OpenAI::Models::Responses::ResponseReasoningSummaryTextDeltaEvent, OpenAI::Models::Responses::ResponseReasoningSummaryTextDoneEvent, OpenAI::Models::Responses::ResponseRefusalDeltaEvent, OpenAI::Models::Responses::ResponseRefusalDoneEvent, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent, OpenAI::Models::Responses::ResponseTextDeltaEvent, OpenAI::Models::Responses::ResponseTextDoneEvent, OpenAI::Models::Responses::ResponseWebSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseWebSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent)] end end end diff --git a/lib/openai/resources/evals.rb b/lib/openai/resources/evals.rb index 070c5958..2996ff10 100644 --- a/lib/openai/resources/evals.rb +++ b/lib/openai/resources/evals.rb @@ -12,13 +12,12 @@ class Evals # We support several types of graders and datasources. For more information, see # the [Evals guide](https://platform.openai.com/docs/guides/evals). # - # @overload create(data_source_config:, testing_criteria:, metadata: nil, name: nil, share_with_openai: nil, request_options: {}) + # @overload create(data_source_config:, testing_criteria:, metadata: nil, name: nil, request_options: {}) # - # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions] - # @param testing_criteria [Array] + # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] + # @param testing_criteria [Array] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] - # @param share_with_openai [Boolean] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::EvalCreateResponse] diff --git a/lib/openai/resources/evals/runs.rb b/lib/openai/resources/evals/runs.rb index ce05aca8..77980ec8 100644 --- a/lib/openai/resources/evals/runs.rb +++ b/lib/openai/resources/evals/runs.rb @@ -12,7 +12,7 @@ class Runs # @overload create(eval_id, data_source:, metadata: nil, name: nil, request_options: {}) # # @param eval_id [String] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] # @param metadata [Hash{Symbol=>String}, nil] # @param name [String] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/openai/resources/fine_tuning/checkpoints/permissions.rb b/lib/openai/resources/fine_tuning/checkpoints/permissions.rb index 47a1d9b0..38c9fe03 100644 --- a/lib/openai/resources/fine_tuning/checkpoints/permissions.rb +++ b/lib/openai/resources/fine_tuning/checkpoints/permissions.rb @@ -64,20 +64,30 @@ def retrieve(fine_tuned_model_checkpoint, params = {}) # Organization owners can use this endpoint to delete a permission for a # fine-tuned model checkpoint. # - # @overload delete(fine_tuned_model_checkpoint, request_options: {}) + # @overload delete(permission_id, fine_tuned_model_checkpoint:, request_options: {}) # + # @param permission_id [String] # @param fine_tuned_model_checkpoint [String] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteResponse] # # @see OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteParams - def delete(fine_tuned_model_checkpoint, params = {}) + def delete(permission_id, params) + parsed, options = OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteParams.dump_request(params) + fine_tuned_model_checkpoint = + parsed.delete(:fine_tuned_model_checkpoint) do + raise ArgumentError.new("missing required path argument #{_1}") + end @client.request( method: :delete, - path: ["fine_tuning/checkpoints/%1$s/permissions", fine_tuned_model_checkpoint], + path: [ + "fine_tuning/checkpoints/%1$s/permissions/%2$s", + fine_tuned_model_checkpoint, + permission_id + ], model: OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteResponse, - options: params[:request_options] + options: options ) end diff --git a/lib/openai/resources/images.rb b/lib/openai/resources/images.rb index 886a0efb..40bfb0e5 100644 --- a/lib/openai/resources/images.rb +++ b/lib/openai/resources/images.rb @@ -3,7 +3,7 @@ module OpenAI module Resources class Images - # Creates a variation of a given image. + # Creates a variation of a given image. This endpoint only supports `dall-e-2`. # # @overload create_variation(image:, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) # @@ -30,15 +30,17 @@ def create_variation(params) ) end - # Creates an edited or extended image given an original image and a prompt. + # Creates an edited or extended image given one or more source images and a + # prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`. # - # @overload edit(image:, prompt:, mask: nil, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) + # @overload edit(image:, prompt:, mask: nil, model: nil, n: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {}) # - # @param image [Pathname, StringIO] + # @param image [Pathname, StringIO, Array] # @param prompt [String] # @param mask [Pathname, StringIO] # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] # @param n [Integer, nil] + # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] # @param size [Symbol, OpenAI::Models::ImageEditParams::Size, nil] # @param user [String] @@ -60,13 +62,18 @@ def edit(params) end # Creates an image given a prompt. + # [Learn more](https://platform.openai.com/docs/guides/images). # - # @overload generate(prompt:, model: nil, n: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {}) + # @overload generate(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {}) # # @param prompt [String] + # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] + # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil] # @param n [Integer, nil] - # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality] + # @param output_compression [Integer, nil] + # @param output_format [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil] + # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil] # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] # @param size [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] diff --git a/lib/openai/resources/responses.rb b/lib/openai/resources/responses.rb index 86d77f6a..350e7a3f 100644 --- a/lib/openai/resources/responses.rb +++ b/lib/openai/resources/responses.rb @@ -100,7 +100,7 @@ def stream # @param user [String] # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [OpenAI::Internal::Stream] + # @return [OpenAI::Internal::Stream] # # @see OpenAI::Models::Responses::ResponseCreateParams def stream_raw(params) diff --git a/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi b/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi index 091a1cab..ef54ba30 100644 --- a/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi +++ b/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi @@ -1018,18 +1018,6 @@ module OpenAI end end - module Tool - extend OpenAI::Internal::Type::Union - - sig do - override - .returns( - [OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool] - ) - end - def self.variants; end - end - class TruncationStrategy < OpenAI::Internal::Type::BaseModel # The truncation strategy to use for the thread. The default is `auto`. If set to # `last_messages`, the thread will be truncated to the n most recent messages in diff --git a/rbi/lib/openai/models/eval_create_params.rbi b/rbi/lib/openai/models/eval_create_params.rbi index dbec61df..32befe9a 100644 --- a/rbi/lib/openai/models/eval_create_params.rbi +++ b/rbi/lib/openai/models/eval_create_params.rbi @@ -11,7 +11,7 @@ module OpenAI returns( T.any( OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, - OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions + OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs ) ) end @@ -24,7 +24,9 @@ module OpenAI T.any( OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalCreateParams::TestingCriterion::Python, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel ) ] ) @@ -47,61 +49,50 @@ module OpenAI sig { params(name: String).void } attr_writer :name - # Indicates whether the evaluation is shared with OpenAI. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :share_with_openai - - sig { params(share_with_openai: T::Boolean).void } - attr_writer :share_with_openai - sig do params( data_source_config: T.any( OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Internal::AnyHash, - OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions + OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs ), testing_criteria: T::Array[ T.any( OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Internal::AnyHash, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalCreateParams::TestingCriterion::Python, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel ) ], metadata: T.nilable(T::Hash[Symbol, String]), name: String, - share_with_openai: T::Boolean, request_options: T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash) ) .returns(T.attached_class) end - def self.new( - data_source_config:, - testing_criteria:, - metadata: nil, - name: nil, - share_with_openai: nil, - request_options: {} - ); end + def self.new(data_source_config:, testing_criteria:, metadata: nil, name: nil, request_options: {}); end + sig do override .returns( { data_source_config: T.any( OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, - OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions + OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs ), testing_criteria: T::Array[ T.any( OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalCreateParams::TestingCriterion::Python, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel ) ], metadata: T.nilable(T::Hash[Symbol, String]), name: String, - share_with_openai: T::Boolean, request_options: OpenAI::RequestOptions } ) @@ -113,7 +104,7 @@ module OpenAI extend OpenAI::Internal::Type::Union class Custom < OpenAI::Internal::Type::BaseModel - # The json schema for the run data source items. + # The json schema for each row in the data source. sig { returns(T::Hash[Symbol, T.anything]) } attr_accessor :item_schema @@ -121,7 +112,8 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type - # Whether to include the sample schema in the data source. + # Whether the eval should expect you to populate the sample namespace (ie, by + # generating responses off of your data source) sig { returns(T.nilable(T::Boolean)) } attr_reader :include_sample_schema @@ -151,34 +143,32 @@ module OpenAI def to_hash; end end - class StoredCompletions < OpenAI::Internal::Type::BaseModel - # The type of data source. Always `stored_completions`. + class Logs < OpenAI::Internal::Type::BaseModel + # The type of data source. Always `logs`. sig { returns(Symbol) } attr_accessor :type - # Set of 16 key-value pairs that can be attached to an object. This can be useful - # for storing additional information about the object in a structured format, and - # querying for objects via API or the dashboard. - # - # Keys are strings with a maximum length of 64 characters. Values are strings with - # a maximum length of 512 characters. - sig { returns(T.nilable(T::Hash[Symbol, String])) } - attr_accessor :metadata + # Metadata filters for the logs data source. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :metadata + + sig { params(metadata: T::Hash[Symbol, T.anything]).void } + attr_writer :metadata # A data source config which specifies the metadata property of your stored # completions query. This is usually metadata like `usecase=chatbot` or # `prompt-version=v2`, etc. - sig { params(metadata: T.nilable(T::Hash[Symbol, String]), type: Symbol).returns(T.attached_class) } - def self.new(metadata: nil, type: :stored_completions); end + sig { params(metadata: T::Hash[Symbol, T.anything], type: Symbol).returns(T.attached_class) } + def self.new(metadata: nil, type: :logs); end - sig { override.returns({type: Symbol, metadata: T.nilable(T::Hash[Symbol, String])}) } + sig { override.returns({type: Symbol, metadata: T::Hash[Symbol, T.anything]}) } def to_hash; end end sig do override .returns( - [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions] + [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] ) end def self.variants; end @@ -190,13 +180,14 @@ module OpenAI extend OpenAI::Internal::Type::Union class LabelModel < OpenAI::Internal::Type::BaseModel + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. sig do returns( T::Array[ T.any( OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem ) ] ) @@ -231,8 +222,7 @@ module OpenAI T.any( OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, OpenAI::Internal::AnyHash, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem ) ], labels: T::Array[String], @@ -252,8 +242,7 @@ module OpenAI input: T::Array[ T.any( OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem ) ], labels: T::Array[String], @@ -266,6 +255,8 @@ module OpenAI end def to_hash; end + # A chat message that makes up the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. module Input extend OpenAI::Internal::Type::Union @@ -285,358 +276,455 @@ module OpenAI def to_hash; end end - class InputMessage < OpenAI::Internal::Type::BaseModel - sig { returns(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content) } - attr_reader :content - + class EvalItem < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. sig do - params( - content: T.any( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content, - OpenAI::Internal::AnyHash + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText ) ) - .void end - attr_writer :content + attr_accessor :content - # The role of the message. One of `user`, `system`, or `developer`. + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig { returns(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::OrSymbol) } + attr_accessor :role + + # The type of the message input. Always `message`. sig do returns( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role::OrSymbol + T.nilable(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type::OrSymbol) ) end - attr_accessor :role + attr_reader :type - # The type of item, which is always `message`. sig do - returns( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type::OrSymbol + params( + type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type::OrSymbol ) + .void end - attr_accessor :type + attr_writer :type + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. sig do params( content: T.any( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content, - OpenAI::Internal::AnyHash + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText ), - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role::OrSymbol, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type::OrSymbol + role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::OrSymbol, + type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type::OrSymbol ) .returns(T.attached_class) end - def self.new(content:, role:, type:); end + def self.new(content:, role:, type: nil); end sig do override .returns( { - content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content, - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role::OrSymbol, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type::OrSymbol + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText + ), + role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::OrSymbol, + type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type::OrSymbol } ) end def to_hash; end - class Content < OpenAI::Internal::Type::BaseModel - # The text content. - sig { returns(String) } - attr_accessor :text + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union - # The type of content, which is always `input_text`. - sig do - returns( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type::OrSymbol - ) - end - attr_accessor :type + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text - sig do - params( - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type::OrSymbol - ) - .returns(T.attached_class) + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end end - def self.new(text:, type:); end sig do override .returns( - { - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type::OrSymbol - } + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText] ) end - def to_hash; end - - # The type of content, which is always `input_text`. - module Type - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - INPUT_TEXT = - T.let( - :input_text, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type::TaggedSymbol - ) - - sig do - override - .returns( - T::Array[ - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::Type::TaggedSymbol - ] - ) - end - def self.values; end - end + def self.variants; end end - # The role of the message. One of `user`, `system`, or `developer`. + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. module Role extend OpenAI::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role) } + T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role) } OrSymbol = T.type_alias { T.any(Symbol, String) } USER = T.let( :user, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role::TaggedSymbol + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::TaggedSymbol ) SYSTEM = T.let( :system, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role::TaggedSymbol + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::TaggedSymbol ) DEVELOPER = T.let( :developer, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role::TaggedSymbol + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::TaggedSymbol ) sig do override .returns( - T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Role::TaggedSymbol] + T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role::TaggedSymbol] ) end def self.values; end end - # The type of item, which is always `message`. + # The type of the message input. Always `message`. module Type extend OpenAI::Internal::Type::Enum TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type) } + T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type) } OrSymbol = T.type_alias { T.any(Symbol, String) } MESSAGE = T.let( :message, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type::TaggedSymbol + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type::TaggedSymbol ) sig do override .returns( - T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Type::TaggedSymbol] + T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type::TaggedSymbol] ) end def self.values; end end end - class OutputMessage < OpenAI::Internal::Type::BaseModel - sig { returns(OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content) } - attr_reader :content - - sig do - params( - content: T.any( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content, - OpenAI::Internal::AnyHash - ) + sig do + override + .returns( + [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem] ) - .void - end - attr_writer :content + end + def self.variants; end + end + end - # The role of the message. Must be `assistant` for output. - sig do - returns( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role::OrSymbol - ) - end - attr_accessor :role + class Python < OpenAI::Internal::Type::BaseModel + # The name of the grader. + sig { returns(String) } + attr_accessor :name - # The type of item, which is always `message`. - sig do - returns( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type::OrSymbol - ) - end - attr_accessor :type + # The source code of the python script. + sig { returns(String) } + attr_accessor :source - sig do - params( - content: T.any( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content, - OpenAI::Internal::AnyHash - ), - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role::OrSymbol, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type::OrSymbol - ) - .returns(T.attached_class) - end - def self.new(content:, role:, type:); end + # The object type, which is always `python`. + sig { returns(Symbol) } + attr_accessor :type - sig do - override - .returns( - { - content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content, - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role::OrSymbol, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type::OrSymbol - } - ) - end - def to_hash; end + # The image tag to use for the python script. + sig { returns(T.nilable(String)) } + attr_reader :image_tag - class Content < OpenAI::Internal::Type::BaseModel - # The text content. - sig { returns(String) } - attr_accessor :text + sig { params(image_tag: String).void } + attr_writer :image_tag - # The type of content, which is always `output_text`. - sig do - returns( - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type::OrSymbol - ) - end - attr_accessor :type + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold - sig do - params( - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type::OrSymbol - ) - .returns(T.attached_class) - end - def self.new(text:, type:); end + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold - sig do - override - .returns( - { - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type::OrSymbol - } - ) - end - def to_hash; end + # A PythonGrader object that runs a python script on the input. + sig do + params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) + .returns(T.attached_class) + end + def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end - # The type of content, which is always `output_text`. - module Type - extend OpenAI::Internal::Type::Enum + sig do + override.returns( + { + name: String, + source: String, + type: Symbol, + image_tag: String, + pass_threshold: Float + } + ) + end + def to_hash; end + end - TaggedSymbol = - T.type_alias do - T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } + class ScoreModel < OpenAI::Internal::Type::BaseModel + # The input text. This may include template strings. + sig { returns(T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input]) } + attr_accessor :input - OUTPUT_TEXT = - T.let( - :output_text, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type::TaggedSymbol - ) + # The model to use for the evaluation. + sig { returns(String) } + attr_accessor :model - sig do - override - .returns( - T::Array[ - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::Type::TaggedSymbol - ] - ) - end - def self.values; end - end - end + # The name of the grader. + sig { returns(String) } + attr_accessor :name - # The role of the message. Must be `assistant` for output. - module Role - extend OpenAI::Internal::Type::Enum + # The object type, which is always `score_model`. + sig { returns(Symbol) } + attr_accessor :type - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role) } - OrSymbol = T.type_alias { T.any(Symbol, String) } + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold - ASSISTANT = - T.let( - :assistant, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role::TaggedSymbol - ) + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold - sig do - override - .returns( - T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Role::TaggedSymbol] - ) - end - def self.values; end - end + # The range of the score. Defaults to `[0, 1]`. + sig { returns(T.nilable(T::Array[Float])) } + attr_reader :range - # The type of item, which is always `message`. - module Type - extend OpenAI::Internal::Type::Enum + sig { params(range: T::Array[Float]).void } + attr_writer :range - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } + # The sampling parameters for the model. + sig { returns(T.nilable(T.anything)) } + attr_reader :sampling_params - MESSAGE = - T.let( - :message, - OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type::TaggedSymbol - ) + sig { params(sampling_params: T.anything).void } + attr_writer :sampling_params - sig do - override - .returns( - T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Type::TaggedSymbol] - ) - end - def self.values; end - end + # A ScoreModelGrader object that uses a model to assign a score to the input. + sig do + params( + input: T::Array[T.any(OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input, OpenAI::Internal::AnyHash)], + model: String, + name: String, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything, + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + input:, + model:, + name:, + pass_threshold: nil, + range: nil, + sampling_params: nil, + type: :score_model + ) + end + + sig do + override + .returns( + { + input: T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: Symbol, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything + } + ) + end + def to_hash; end + + class Input < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText + ) + ) end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig { returns(OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::OrSymbol) } + attr_accessor :role + + # The type of the message input. Always `message`. + sig { returns(T.nilable(OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type::OrSymbol)) } + attr_reader :type + + sig { params(type: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type::OrSymbol).void } + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::OrSymbol, + type: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end sig do override .returns( - [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage] + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::OrSymbol, + type: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type::OrSymbol + } ) end - def self.variants; end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let(:user, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + SYSTEM = + T.let(:system, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let(:message, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol] + ) + end + def self.values; end + end end end sig do override .returns( - [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalCreateParams::TestingCriterion::Python, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel] ) end def self.variants; end diff --git a/rbi/lib/openai/models/eval_create_response.rbi b/rbi/lib/openai/models/eval_create_response.rbi index c35f9e03..c812a4d5 100644 --- a/rbi/lib/openai/models/eval_create_response.rbi +++ b/rbi/lib/openai/models/eval_create_response.rbi @@ -36,10 +36,6 @@ module OpenAI sig { returns(Symbol) } attr_accessor :object - # Indicates whether the evaluation is shared with OpenAI. - sig { returns(T::Boolean) } - attr_accessor :share_with_openai - # A list of testing criteria. sig do returns( @@ -47,7 +43,9 @@ module OpenAI T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalCreateResponse::TestingCriterion::Python, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel ) ] ) @@ -71,29 +69,23 @@ module OpenAI ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Internal::AnyHash, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalCreateResponse::TestingCriterion::Python, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel ) ], object: Symbol ) .returns(T.attached_class) end - def self.new( - id:, - created_at:, - data_source_config:, - metadata:, - name:, - share_with_openai:, - testing_criteria:, - object: :eval - ); end + def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + end + sig do override .returns( @@ -104,12 +96,13 @@ module OpenAI metadata: T.nilable(T::Hash[Symbol, String]), name: String, object: Symbol, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalCreateResponse::TestingCriterion::Python, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel ) ] } @@ -135,10 +128,292 @@ module OpenAI module TestingCriterion extend OpenAI::Internal::Type::Union + class Python < OpenAI::Internal::Type::BaseModel + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The source code of the python script. + sig { returns(String) } + attr_accessor :source + + # The object type, which is always `python`. + sig { returns(Symbol) } + attr_accessor :type + + # The image tag to use for the python script. + sig { returns(T.nilable(String)) } + attr_reader :image_tag + + sig { params(image_tag: String).void } + attr_writer :image_tag + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # A PythonGrader object that runs a python script on the input. + sig do + params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) + .returns(T.attached_class) + end + def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end + + sig do + override.returns( + { + name: String, + source: String, + type: Symbol, + image_tag: String, + pass_threshold: Float + } + ) + end + def to_hash; end + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # The input text. This may include template strings. + sig { returns(T::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input]) } + attr_accessor :input + + # The model to use for the evaluation. + sig { returns(String) } + attr_accessor :model + + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The object type, which is always `score_model`. + sig { returns(Symbol) } + attr_accessor :type + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # The range of the score. Defaults to `[0, 1]`. + sig { returns(T.nilable(T::Array[Float])) } + attr_reader :range + + sig { params(range: T::Array[Float]).void } + attr_writer :range + + # The sampling parameters for the model. + sig { returns(T.nilable(T.anything)) } + attr_reader :sampling_params + + sig { params(sampling_params: T.anything).void } + attr_writer :sampling_params + + # A ScoreModelGrader object that uses a model to assign a score to the input. + sig do + params( + input: T::Array[T.any(OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input, OpenAI::Internal::AnyHash)], + model: String, + name: String, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything, + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + input:, + model:, + name:, + pass_threshold: nil, + range: nil, + sampling_params: nil, + type: :score_model + ) + end + + sig do + override + .returns( + { + input: T::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: Symbol, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything + } + ) + end + def to_hash; end + + class Input < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig { returns(OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) } + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable(OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol) + ) + end + attr_reader :type + + sig { params(type: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol).void } + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::OrSymbol, + type: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol, + type: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let(:user, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol] + ) + end + def self.values; end + end + end + end + sig do override .returns( - [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalCreateResponse::TestingCriterion::Python, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel] ) end def self.variants; end diff --git a/rbi/lib/openai/models/eval_label_model_grader.rbi b/rbi/lib/openai/models/eval_label_model_grader.rbi index 40ab0320..8e02688e 100644 --- a/rbi/lib/openai/models/eval_label_model_grader.rbi +++ b/rbi/lib/openai/models/eval_label_model_grader.rbi @@ -3,16 +3,7 @@ module OpenAI module Models class EvalLabelModelGrader < OpenAI::Internal::Type::BaseModel - sig do - returns( - T::Array[ - T.any( - OpenAI::Models::EvalLabelModelGrader::Input::Assistant, - OpenAI::Models::EvalLabelModelGrader::Input::InputMessage - ) - ] - ) - end + sig { returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input]) } attr_accessor :input # The labels to assign to each item in the evaluation. @@ -39,13 +30,7 @@ module OpenAI # the evaluation. sig do params( - input: T::Array[ - T.any( - OpenAI::Models::EvalLabelModelGrader::Input::Assistant, - OpenAI::Internal::AnyHash, - OpenAI::Models::EvalLabelModelGrader::Input::InputMessage - ) - ], + input: T::Array[T.any(OpenAI::Models::EvalLabelModelGrader::Input, OpenAI::Internal::AnyHash)], labels: T::Array[String], model: String, name: String, @@ -60,12 +45,7 @@ module OpenAI override .returns( { - input: T::Array[ - T.any( - OpenAI::Models::EvalLabelModelGrader::Input::Assistant, - OpenAI::Models::EvalLabelModelGrader::Input::InputMessage - ) - ], + input: T::Array[OpenAI::Models::EvalLabelModelGrader::Input], labels: T::Array[String], model: String, name: String, @@ -76,238 +56,126 @@ module OpenAI end def to_hash; end - # An item can either be an input message or an output message. - module Input - extend OpenAI::Internal::Type::Union + class Input < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText + ) + ) + end + attr_accessor :content - class InputMessage < OpenAI::Internal::Type::BaseModel - sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content) } - attr_reader :content + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::Role::TaggedSymbol) } + attr_accessor :role - sig do - params( - content: T.any(OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content, OpenAI::Internal::AnyHash) - ) - .void - end - attr_writer :content + # The type of the message input. Always `message`. + sig { returns(T.nilable(OpenAI::Models::EvalLabelModelGrader::Input::Type::TaggedSymbol)) } + attr_reader :type - # The role of the message. One of `user`, `system`, or `developer`. - sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role::TaggedSymbol) } - attr_accessor :role + sig { params(type: OpenAI::Models::EvalLabelModelGrader::Input::Type::OrSymbol).void } + attr_writer :type - # The type of item, which is always `message`. - sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type::TaggedSymbol) } - attr_accessor :type + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText + ), + role: OpenAI::Models::EvalLabelModelGrader::Input::Role::OrSymbol, + type: OpenAI::Models::EvalLabelModelGrader::Input::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end - sig do - params( - content: T.any(OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content, OpenAI::Internal::AnyHash), - role: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role::OrSymbol, - type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type::OrSymbol + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText + ), + role: OpenAI::Models::EvalLabelModelGrader::Input::Role::TaggedSymbol, + type: OpenAI::Models::EvalLabelModelGrader::Input::Type::TaggedSymbol + } ) - .returns(T.attached_class) - end - def self.new(content:, role:, type:); end + end + def to_hash; end - sig do - override - .returns( - { - content: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content, - role: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role::TaggedSymbol, - type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type::TaggedSymbol - } - ) - end - def to_hash; end + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union - class Content < OpenAI::Internal::Type::BaseModel - # The text content. + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. sig { returns(String) } attr_accessor :text - # The type of content, which is always `input_text`. - sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type::TaggedSymbol) } + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } attr_accessor :type - sig do - params( - text: String, - type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type::OrSymbol - ) - .returns(T.attached_class) - end - def self.new(text:, type:); end + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end - sig do - override - .returns( - {text: String, type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type::TaggedSymbol} - ) - end + sig { override.returns({text: String, type: Symbol}) } def to_hash; end - - # The type of content, which is always `input_text`. - module Type - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - INPUT_TEXT = - T.let(:input_text, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type::TaggedSymbol) - - sig do - override - .returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::Type::TaggedSymbol]) - end - def self.values; end - end end - # The role of the message. One of `user`, `system`, or `developer`. - module Role - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - USER = T.let(:user, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role::TaggedSymbol) - SYSTEM = T.let(:system, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role::TaggedSymbol) - DEVELOPER = - T.let(:developer, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role::TaggedSymbol) - - sig { override.returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Role::TaggedSymbol]) } - def self.values; end - end - - # The type of item, which is always `message`. - module Type - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MESSAGE = T.let(:message, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type::TaggedSymbol) - - sig { override.returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Type::TaggedSymbol]) } - def self.values; end - end - end - - class Assistant < OpenAI::Internal::Type::BaseModel - sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content) } - attr_reader :content - - sig do - params( - content: T.any(OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content, OpenAI::Internal::AnyHash) - ) - .void - end - attr_writer :content - - # The role of the message. Must be `assistant` for output. - sig { returns(Symbol) } - attr_accessor :role - - # The type of item, which is always `message`. - sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type::TaggedSymbol) } - attr_accessor :type - - sig do - params( - content: T.any(OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content, OpenAI::Internal::AnyHash), - type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type::OrSymbol, - role: Symbol - ) - .returns(T.attached_class) - end - def self.new(content:, type:, role: :assistant); end - sig do override .returns( - { - content: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content, - role: Symbol, - type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type::TaggedSymbol - } + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText] ) end - def to_hash; end - - class Content < OpenAI::Internal::Type::BaseModel - # The text content. - sig { returns(String) } - attr_accessor :text - - # The type of content, which is always `output_text`. - sig { returns(OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type::TaggedSymbol) } - attr_accessor :type - - sig do - params( - text: String, - type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type::OrSymbol - ) - .returns(T.attached_class) - end - def self.new(text:, type:); end - - sig do - override - .returns( - {text: String, type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type::TaggedSymbol} - ) - end - def to_hash; end - - # The type of content, which is always `output_text`. - module Type - extend OpenAI::Internal::Type::Enum + def self.variants; end + end - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum - OUTPUT_TEXT = - T.let(:output_text, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type::TaggedSymbol) + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Role) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - sig do - override - .returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::Type::TaggedSymbol]) - end - def self.values; end - end - end + USER = T.let(:user, OpenAI::Models::EvalLabelModelGrader::Input::Role::TaggedSymbol) + ASSISTANT = T.let(:assistant, OpenAI::Models::EvalLabelModelGrader::Input::Role::TaggedSymbol) + SYSTEM = T.let(:system, OpenAI::Models::EvalLabelModelGrader::Input::Role::TaggedSymbol) + DEVELOPER = T.let(:developer, OpenAI::Models::EvalLabelModelGrader::Input::Role::TaggedSymbol) - # The type of item, which is always `message`. - module Type - extend OpenAI::Internal::Type::Enum + sig { override.returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input::Role::TaggedSymbol]) } + def self.values; end + end - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum - MESSAGE = T.let(:message, OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type::TaggedSymbol) + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } - sig { override.returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Type::TaggedSymbol]) } - def self.values; end - end - end + MESSAGE = T.let(:message, OpenAI::Models::EvalLabelModelGrader::Input::Type::TaggedSymbol) - sig do - override - .returns( - [OpenAI::Models::EvalLabelModelGrader::Input::Assistant, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage] - ) + sig { override.returns(T::Array[OpenAI::Models::EvalLabelModelGrader::Input::Type::TaggedSymbol]) } + def self.values; end end - def self.variants; end end end end diff --git a/rbi/lib/openai/models/eval_list_response.rbi b/rbi/lib/openai/models/eval_list_response.rbi index 7ea59a6c..08a0827f 100644 --- a/rbi/lib/openai/models/eval_list_response.rbi +++ b/rbi/lib/openai/models/eval_list_response.rbi @@ -36,10 +36,6 @@ module OpenAI sig { returns(Symbol) } attr_accessor :object - # Indicates whether the evaluation is shared with OpenAI. - sig { returns(T::Boolean) } - attr_accessor :share_with_openai - # A list of testing criteria. sig do returns( @@ -47,7 +43,9 @@ module OpenAI T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalListResponse::TestingCriterion::Python, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel ) ] ) @@ -71,29 +69,23 @@ module OpenAI ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Internal::AnyHash, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalListResponse::TestingCriterion::Python, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel ) ], object: Symbol ) .returns(T.attached_class) end - def self.new( - id:, - created_at:, - data_source_config:, - metadata:, - name:, - share_with_openai:, - testing_criteria:, - object: :eval - ); end + def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + end + sig do override .returns( @@ -104,12 +96,13 @@ module OpenAI metadata: T.nilable(T::Hash[Symbol, String]), name: String, object: Symbol, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalListResponse::TestingCriterion::Python, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel ) ] } @@ -135,10 +128,286 @@ module OpenAI module TestingCriterion extend OpenAI::Internal::Type::Union + class Python < OpenAI::Internal::Type::BaseModel + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The source code of the python script. + sig { returns(String) } + attr_accessor :source + + # The object type, which is always `python`. + sig { returns(Symbol) } + attr_accessor :type + + # The image tag to use for the python script. + sig { returns(T.nilable(String)) } + attr_reader :image_tag + + sig { params(image_tag: String).void } + attr_writer :image_tag + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # A PythonGrader object that runs a python script on the input. + sig do + params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) + .returns(T.attached_class) + end + def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end + + sig do + override.returns( + { + name: String, + source: String, + type: Symbol, + image_tag: String, + pass_threshold: Float + } + ) + end + def to_hash; end + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # The input text. This may include template strings. + sig { returns(T::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input]) } + attr_accessor :input + + # The model to use for the evaluation. + sig { returns(String) } + attr_accessor :model + + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The object type, which is always `score_model`. + sig { returns(Symbol) } + attr_accessor :type + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # The range of the score. Defaults to `[0, 1]`. + sig { returns(T.nilable(T::Array[Float])) } + attr_reader :range + + sig { params(range: T::Array[Float]).void } + attr_writer :range + + # The sampling parameters for the model. + sig { returns(T.nilable(T.anything)) } + attr_reader :sampling_params + + sig { params(sampling_params: T.anything).void } + attr_writer :sampling_params + + # A ScoreModelGrader object that uses a model to assign a score to the input. + sig do + params( + input: T::Array[T.any(OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input, OpenAI::Internal::AnyHash)], + model: String, + name: String, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything, + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + input:, + model:, + name:, + pass_threshold: nil, + range: nil, + sampling_params: nil, + type: :score_model + ) + end + + sig do + override + .returns( + { + input: T::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: Symbol, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything + } + ) + end + def to_hash; end + + class Input < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig { returns(OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) } + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable(OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol) + ) + end + attr_reader :type + + sig { params(type: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol).void } + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::OrSymbol, + type: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol, + type: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let(:user, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + SYSTEM = + T.let(:system, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let(:message, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol] + ) + end + def self.values; end + end + end + end + sig do override .returns( - [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalListResponse::TestingCriterion::Python, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel] ) end def self.variants; end diff --git a/rbi/lib/openai/models/eval_retrieve_response.rbi b/rbi/lib/openai/models/eval_retrieve_response.rbi index 721a617e..a84f25d8 100644 --- a/rbi/lib/openai/models/eval_retrieve_response.rbi +++ b/rbi/lib/openai/models/eval_retrieve_response.rbi @@ -36,10 +36,6 @@ module OpenAI sig { returns(Symbol) } attr_accessor :object - # Indicates whether the evaluation is shared with OpenAI. - sig { returns(T::Boolean) } - attr_accessor :share_with_openai - # A list of testing criteria. sig do returns( @@ -47,7 +43,9 @@ module OpenAI T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel ) ] ) @@ -71,29 +69,23 @@ module OpenAI ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Internal::AnyHash, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel ) ], object: Symbol ) .returns(T.attached_class) end - def self.new( - id:, - created_at:, - data_source_config:, - metadata:, - name:, - share_with_openai:, - testing_criteria:, - object: :eval - ); end + def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + end + sig do override .returns( @@ -104,12 +96,13 @@ module OpenAI metadata: T.nilable(T::Hash[Symbol, String]), name: String, object: Symbol, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel ) ] } @@ -135,10 +128,303 @@ module OpenAI module TestingCriterion extend OpenAI::Internal::Type::Union + class Python < OpenAI::Internal::Type::BaseModel + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The source code of the python script. + sig { returns(String) } + attr_accessor :source + + # The object type, which is always `python`. + sig { returns(Symbol) } + attr_accessor :type + + # The image tag to use for the python script. + sig { returns(T.nilable(String)) } + attr_reader :image_tag + + sig { params(image_tag: String).void } + attr_writer :image_tag + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # A PythonGrader object that runs a python script on the input. + sig do + params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) + .returns(T.attached_class) + end + def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end + + sig do + override.returns( + { + name: String, + source: String, + type: Symbol, + image_tag: String, + pass_threshold: Float + } + ) + end + def to_hash; end + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # The input text. This may include template strings. + sig { returns(T::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input]) } + attr_accessor :input + + # The model to use for the evaluation. + sig { returns(String) } + attr_accessor :model + + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The object type, which is always `score_model`. + sig { returns(Symbol) } + attr_accessor :type + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # The range of the score. Defaults to `[0, 1]`. + sig { returns(T.nilable(T::Array[Float])) } + attr_reader :range + + sig { params(range: T::Array[Float]).void } + attr_writer :range + + # The sampling parameters for the model. + sig { returns(T.nilable(T.anything)) } + attr_reader :sampling_params + + sig { params(sampling_params: T.anything).void } + attr_writer :sampling_params + + # A ScoreModelGrader object that uses a model to assign a score to the input. + sig do + params( + input: T::Array[ + T.any( + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input, + OpenAI::Internal::AnyHash + ) + ], + model: String, + name: String, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything, + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + input:, + model:, + name:, + pass_threshold: nil, + range: nil, + sampling_params: nil, + type: :score_model + ) + end + + sig do + override + .returns( + { + input: T::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: Symbol, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything + } + ) + end + def to_hash; end + + class Input < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig { returns(OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) } + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable(OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol) + ) + end + attr_reader :type + + sig do + params(type: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol) + .void + end + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::OrSymbol, + type: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol, + type: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol] + ) + end + def self.values; end + end + end + end + sig do override .returns( - [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel] ) end def self.variants; end diff --git a/rbi/lib/openai/models/eval_text_similarity_grader.rbi b/rbi/lib/openai/models/eval_text_similarity_grader.rbi index 460cab97..f3675e7a 100644 --- a/rbi/lib/openai/models/eval_text_similarity_grader.rbi +++ b/rbi/lib/openai/models/eval_text_similarity_grader.rbi @@ -3,8 +3,8 @@ module OpenAI module Models class EvalTextSimilarityGrader < OpenAI::Internal::Type::BaseModel - # The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`, - # `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. + # The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, + # `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. sig { returns(OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric::OrSymbol) } attr_accessor :evaluation_metric @@ -68,8 +68,8 @@ module OpenAI end def to_hash; end - # The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`, - # `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. + # The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, + # `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. module EvaluationMetric extend OpenAI::Internal::Type::Enum @@ -87,7 +87,6 @@ module OpenAI ROUGE_4 = T.let(:rouge_4, OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric::TaggedSymbol) ROUGE_5 = T.let(:rouge_5, OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric::TaggedSymbol) ROUGE_L = T.let(:rouge_l, OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric::TaggedSymbol) - COSINE = T.let(:cosine, OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric::TaggedSymbol) sig { override.returns(T::Array[OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric::TaggedSymbol]) } def self.values; end diff --git a/rbi/lib/openai/models/eval_update_response.rbi b/rbi/lib/openai/models/eval_update_response.rbi index 0025fbad..53a41e65 100644 --- a/rbi/lib/openai/models/eval_update_response.rbi +++ b/rbi/lib/openai/models/eval_update_response.rbi @@ -36,10 +36,6 @@ module OpenAI sig { returns(Symbol) } attr_accessor :object - # Indicates whether the evaluation is shared with OpenAI. - sig { returns(T::Boolean) } - attr_accessor :share_with_openai - # A list of testing criteria. sig do returns( @@ -47,7 +43,9 @@ module OpenAI T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel ) ] ) @@ -71,29 +69,23 @@ module OpenAI ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Internal::AnyHash, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel ) ], object: Symbol ) .returns(T.attached_class) end - def self.new( - id:, - created_at:, - data_source_config:, - metadata:, - name:, - share_with_openai:, - testing_criteria:, - object: :eval - ); end + def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + end + sig do override .returns( @@ -104,12 +96,13 @@ module OpenAI metadata: T.nilable(T::Hash[Symbol, String]), name: String, object: Symbol, - share_with_openai: T::Boolean, testing_criteria: T::Array[ T.any( OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel ) ] } @@ -135,10 +128,292 @@ module OpenAI module TestingCriterion extend OpenAI::Internal::Type::Union + class Python < OpenAI::Internal::Type::BaseModel + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The source code of the python script. + sig { returns(String) } + attr_accessor :source + + # The object type, which is always `python`. + sig { returns(Symbol) } + attr_accessor :type + + # The image tag to use for the python script. + sig { returns(T.nilable(String)) } + attr_reader :image_tag + + sig { params(image_tag: String).void } + attr_writer :image_tag + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # A PythonGrader object that runs a python script on the input. + sig do + params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) + .returns(T.attached_class) + end + def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end + + sig do + override.returns( + { + name: String, + source: String, + type: Symbol, + image_tag: String, + pass_threshold: Float + } + ) + end + def to_hash; end + end + + class ScoreModel < OpenAI::Internal::Type::BaseModel + # The input text. This may include template strings. + sig { returns(T::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input]) } + attr_accessor :input + + # The model to use for the evaluation. + sig { returns(String) } + attr_accessor :model + + # The name of the grader. + sig { returns(String) } + attr_accessor :name + + # The object type, which is always `score_model`. + sig { returns(Symbol) } + attr_accessor :type + + # The threshold for the score. + sig { returns(T.nilable(Float)) } + attr_reader :pass_threshold + + sig { params(pass_threshold: Float).void } + attr_writer :pass_threshold + + # The range of the score. Defaults to `[0, 1]`. + sig { returns(T.nilable(T::Array[Float])) } + attr_reader :range + + sig { params(range: T::Array[Float]).void } + attr_writer :range + + # The sampling parameters for the model. + sig { returns(T.nilable(T.anything)) } + attr_reader :sampling_params + + sig { params(sampling_params: T.anything).void } + attr_writer :sampling_params + + # A ScoreModelGrader object that uses a model to assign a score to the input. + sig do + params( + input: T::Array[T.any(OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input, OpenAI::Internal::AnyHash)], + model: String, + name: String, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything, + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + input:, + model:, + name:, + pass_threshold: nil, + range: nil, + sampling_params: nil, + type: :score_model + ) + end + + sig do + override + .returns( + { + input: T::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: Symbol, + pass_threshold: Float, + range: T::Array[Float], + sampling_params: T.anything + } + ) + end + def to_hash; end + + class Input < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig { returns(OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) } + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable(OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol) + ) + end + attr_reader :type + + sig { params(type: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol).void } + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::OrSymbol, + type: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + ), + role: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol, + type: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let(:user, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role::TaggedSymbol] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type::TaggedSymbol] + ) + end + def self.values; end + end + end + end + sig do override .returns( - [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel] ) end def self.variants; end diff --git a/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi b/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi index 83b73c77..6e2ac631 100644 --- a/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi +++ b/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi @@ -4,20 +4,6 @@ module OpenAI module Models module Evals class CreateEvalCompletionsRunDataSource < OpenAI::Internal::Type::BaseModel - sig do - returns( - T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference - ) - ) - end - attr_accessor :input_messages - - # The name of the model to use for generating completions (e.g. "o3-mini"). - sig { returns(String) } - attr_accessor :model - # A StoredCompletionsRunDataSource configuration describing a set of filters sig do returns( @@ -34,6 +20,37 @@ module OpenAI sig { returns(OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type::OrSymbol) } attr_accessor :type + sig do + returns( + T.nilable( + T.any( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference + ) + ) + ) + end + attr_reader :input_messages + + sig do + params( + input_messages: T.any( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference + ) + ) + .void + end + attr_writer :input_messages + + # The name of the model to use for generating completions (e.g. "o3-mini"). + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + sig { returns(T.nilable(OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams)) } attr_reader :sampling_params @@ -51,12 +68,6 @@ module OpenAI # A CompletionsRunDataSource object describing a model sampling configuration. sig do params( - input_messages: T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, - OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference - ), - model: String, source: T.any( OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Internal::AnyHash, @@ -64,6 +75,12 @@ module OpenAI OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions ), type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type::OrSymbol, + input_messages: T.any( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference + ), + model: String, sampling_params: T.any( OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams, OpenAI::Internal::AnyHash @@ -71,29 +88,200 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input_messages:, model:, source:, type:, sampling_params: nil); end + def self.new(source:, type:, input_messages: nil, model: nil, sampling_params: nil); end sig do override .returns( { - input_messages: T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference - ), - model: String, source: T.any( OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions ), type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type::OrSymbol, + input_messages: T.any( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference + ), + model: String, sampling_params: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams } ) end def to_hash; end + # A StoredCompletionsRunDataSource configuration describing a set of filters + module Source + extend OpenAI::Internal::Type::Union + + class FileContent < OpenAI::Internal::Type::BaseModel + # The content of the jsonl file. + sig { returns(T::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content]) } + attr_accessor :content + + # The type of jsonl source. Always `file_content`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + content: T::Array[ + T.any( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content, + OpenAI::Internal::AnyHash + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(content:, type: :file_content); end + + sig do + override + .returns( + { + content: T::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content], + type: Symbol + } + ) + end + def to_hash; end + + class Content < OpenAI::Internal::Type::BaseModel + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :item + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :sample + + sig { params(sample: T::Hash[Symbol, T.anything]).void } + attr_writer :sample + + sig do + params( + item: T::Hash[Symbol, T.anything], + sample: T::Hash[Symbol, T.anything] + ).returns(T.attached_class) + end + def self.new(item:, sample: nil); end + + sig do + override.returns({item: T::Hash[Symbol, T.anything], sample: T::Hash[Symbol, T.anything]}) + end + def to_hash; end + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # The identifier of the file. + sig { returns(String) } + attr_accessor :id + + # The type of jsonl source. Always `file_id`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(id: String, type: Symbol).returns(T.attached_class) } + def self.new(id:, type: :file_id); end + + sig { override.returns({id: String, type: Symbol}) } + def to_hash; end + end + + class StoredCompletions < OpenAI::Internal::Type::BaseModel + # The type of source. Always `stored_completions`. + sig { returns(Symbol) } + attr_accessor :type + + # An optional Unix timestamp to filter items created after this time. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_after + + # An optional Unix timestamp to filter items created before this time. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_before + + # An optional maximum number of items to return. + sig { returns(T.nilable(Integer)) } + attr_accessor :limit + + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_accessor :metadata + + # An optional model to filter by (e.g., 'gpt-4o'). + sig { returns(T.nilable(String)) } + attr_accessor :model + + # A StoredCompletionsRunDataSource configuration describing a set of filters + sig do + params( + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + limit: T.nilable(Integer), + metadata: T.nilable(T::Hash[Symbol, String]), + model: T.nilable(String), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + created_after: nil, + created_before: nil, + limit: nil, + metadata: nil, + model: nil, + type: :stored_completions + ) + end + + sig do + override + .returns( + { + type: Symbol, + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + limit: T.nilable(Integer), + metadata: T.nilable(T::Hash[Symbol, String]), + model: T.nilable(String) + } + ) + end + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions] + ) + end + def self.variants; end + end + + # The type of run data source. Always `completions`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPLETIONS = + T.let(:completions, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type::TaggedSymbol]) } + def self.values; end + end + module InputMessages extend OpenAI::Internal::Type::Union @@ -104,9 +292,8 @@ module OpenAI returns( T::Array[ T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage + OpenAI::Models::Responses::EasyInputMessage, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message ) ] ) @@ -121,10 +308,9 @@ module OpenAI params( template: T::Array[ T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Responses::EasyInputMessage, OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message ) ], type: Symbol @@ -139,9 +325,8 @@ module OpenAI { template: T::Array[ T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage + OpenAI::Models::Responses::EasyInputMessage, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message ) ], type: Symbol @@ -150,380 +335,184 @@ module OpenAI end def to_hash; end + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. module Template extend OpenAI::Internal::Type::Union - class ChatMessage < OpenAI::Internal::Type::BaseModel - # The content of the message. - sig { returns(String) } - attr_accessor :content - - # The role of the message (e.g. "system", "assistant", "user"). - sig { returns(String) } - attr_accessor :role - - sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - - sig { override.returns({content: String, role: String}) } - def to_hash; end - end - - class InputMessage < OpenAI::Internal::Type::BaseModel + class Message < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. sig do returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText + ) ) end - attr_reader :content + attr_accessor :content + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. sig do - params( - content: T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content, - OpenAI::Internal::AnyHash - ) + returns( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::OrSymbol ) - .void end - attr_writer :content + attr_accessor :role - # The role of the message. One of `user`, `system`, or `developer`. + # The type of the message input. Always `message`. sig do returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role::OrSymbol + T.nilable( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol + ) ) end - attr_accessor :role + attr_reader :type - # The type of item, which is always `message`. sig do - returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type::OrSymbol + params( + type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol ) + .void end - attr_accessor :type + attr_writer :type + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. sig do params( content: T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content, - OpenAI::Internal::AnyHash + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText ), - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role::OrSymbol, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type::OrSymbol + role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::OrSymbol, + type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol ) .returns(T.attached_class) end - def self.new(content:, role:, type:); end + def self.new(content:, role:, type: nil); end sig do override .returns( { - content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content, - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role::OrSymbol, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type::OrSymbol + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText + ), + role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::OrSymbol, + type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol } ) end def to_hash; end - class Content < OpenAI::Internal::Type::BaseModel - # The text content. - sig { returns(String) } - attr_accessor :text + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union - # The type of content, which is always `input_text`. - sig do - returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type::OrSymbol - ) - end - attr_accessor :type + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text - sig do - params( - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type::OrSymbol - ) - .returns(T.attached_class) + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end end - def self.new(text:, type:); end sig do override .returns( - { - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type::OrSymbol - } - ) - end - def to_hash; end - - # The type of content, which is always `input_text`. - module Type - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - INPUT_TEXT = - T.let( - :input_text, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type::TaggedSymbol + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText] ) - - sig do - override - .returns( - T::Array[ - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::Type::TaggedSymbol - ] - ) - end - def self.values; end end + def self.variants; end end - # The role of the message. One of `user`, `system`, or `developer`. + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. module Role extend OpenAI::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role) + T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role) end OrSymbol = T.type_alias { T.any(Symbol, String) } USER = T.let( :user, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role::TaggedSymbol + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol ) SYSTEM = T.let( :system, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role::TaggedSymbol + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol ) DEVELOPER = T.let( :developer, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role::TaggedSymbol + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol ) sig do override .returns( T::Array[ - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Role::TaggedSymbol + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol ] ) end def self.values; end end - # The type of item, which is always `message`. + # The type of the message input. Always `message`. module Type extend OpenAI::Internal::Type::Enum TaggedSymbol = T.type_alias do - T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type) + T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type) end OrSymbol = T.type_alias { T.any(Symbol, String) } MESSAGE = T.let( :message, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type::TaggedSymbol + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::TaggedSymbol ) sig do override .returns( T::Array[ - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Type::TaggedSymbol - ] - ) - end - def self.values; end - end - end - - class OutputMessage < OpenAI::Internal::Type::BaseModel - sig do - returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content - ) - end - attr_reader :content - - sig do - params( - content: T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content, - OpenAI::Internal::AnyHash - ) - ) - .void - end - attr_writer :content - - # The role of the message. Must be `assistant` for output. - sig do - returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role::OrSymbol - ) - end - attr_accessor :role - - # The type of item, which is always `message`. - sig do - returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type::OrSymbol - ) - end - attr_accessor :type - - sig do - params( - content: T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content, - OpenAI::Internal::AnyHash - ), - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role::OrSymbol, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type::OrSymbol - ) - .returns(T.attached_class) - end - def self.new(content:, role:, type:); end - - sig do - override - .returns( - { - content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content, - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role::OrSymbol, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type::OrSymbol - } - ) - end - def to_hash; end - - class Content < OpenAI::Internal::Type::BaseModel - # The text content. - sig { returns(String) } - attr_accessor :text - - # The type of content, which is always `output_text`. - sig do - returns( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type::OrSymbol - ) - end - attr_accessor :type - - sig do - params( - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type::OrSymbol - ) - .returns(T.attached_class) - end - def self.new(text:, type:); end - - sig do - override - .returns( - { - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type::OrSymbol - } - ) - end - def to_hash; end - - # The type of content, which is always `output_text`. - module Type - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OUTPUT_TEXT = - T.let( - :output_text, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type::TaggedSymbol - ) - - sig do - override - .returns( - T::Array[ - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::Type::TaggedSymbol - ] - ) - end - def self.values; end - end - end - - # The role of the message. Must be `assistant` for output. - module Role - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ASSISTANT = - T.let( - :assistant, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role::TaggedSymbol - ) - - sig do - override - .returns( - T::Array[ - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Role::TaggedSymbol - ] - ) - end - def self.values; end - end - - # The type of item, which is always `message`. - module Type - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MESSAGE = - T.let( - :message, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type::TaggedSymbol - ) - - sig do - override - .returns( - T::Array[ - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Type::TaggedSymbol + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::TaggedSymbol ] ) end @@ -534,7 +523,7 @@ module OpenAI sig do override .returns( - [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage] + [OpenAI::Models::Responses::EasyInputMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message] ) end def self.variants; end @@ -566,177 +555,6 @@ module OpenAI def self.variants; end end - # A StoredCompletionsRunDataSource configuration describing a set of filters - module Source - extend OpenAI::Internal::Type::Union - - class FileContent < OpenAI::Internal::Type::BaseModel - # The content of the jsonl file. - sig { returns(T::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content]) } - attr_accessor :content - - # The type of jsonl source. Always `file_content`. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - content: T::Array[ - T.any( - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content, - OpenAI::Internal::AnyHash - ) - ], - type: Symbol - ) - .returns(T.attached_class) - end - def self.new(content:, type: :file_content); end - - sig do - override - .returns( - { - content: T::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content], - type: Symbol - } - ) - end - def to_hash; end - - class Content < OpenAI::Internal::Type::BaseModel - sig { returns(T::Hash[Symbol, T.anything]) } - attr_accessor :item - - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :sample - - sig { params(sample: T::Hash[Symbol, T.anything]).void } - attr_writer :sample - - sig do - params( - item: T::Hash[Symbol, T.anything], - sample: T::Hash[Symbol, T.anything] - ).returns(T.attached_class) - end - def self.new(item:, sample: nil); end - - sig do - override.returns({item: T::Hash[Symbol, T.anything], sample: T::Hash[Symbol, T.anything]}) - end - def to_hash; end - end - end - - class FileID < OpenAI::Internal::Type::BaseModel - # The identifier of the file. - sig { returns(String) } - attr_accessor :id - - # The type of jsonl source. Always `file_id`. - sig { returns(Symbol) } - attr_accessor :type - - sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - - sig { override.returns({id: String, type: Symbol}) } - def to_hash; end - end - - class StoredCompletions < OpenAI::Internal::Type::BaseModel - # An optional Unix timestamp to filter items created after this time. - sig { returns(T.nilable(Integer)) } - attr_accessor :created_after - - # An optional Unix timestamp to filter items created before this time. - sig { returns(T.nilable(Integer)) } - attr_accessor :created_before - - # An optional maximum number of items to return. - sig { returns(T.nilable(Integer)) } - attr_accessor :limit - - # Set of 16 key-value pairs that can be attached to an object. This can be useful - # for storing additional information about the object in a structured format, and - # querying for objects via API or the dashboard. - # - # Keys are strings with a maximum length of 64 characters. Values are strings with - # a maximum length of 512 characters. - sig { returns(T.nilable(T::Hash[Symbol, String])) } - attr_accessor :metadata - - # An optional model to filter by (e.g., 'gpt-4o'). - sig { returns(T.nilable(String)) } - attr_accessor :model - - # The type of source. Always `stored_completions`. - sig { returns(Symbol) } - attr_accessor :type - - # A StoredCompletionsRunDataSource configuration describing a set of filters - sig do - params( - created_after: T.nilable(Integer), - created_before: T.nilable(Integer), - limit: T.nilable(Integer), - metadata: T.nilable(T::Hash[Symbol, String]), - model: T.nilable(String), - type: Symbol - ) - .returns(T.attached_class) - end - def self.new( - created_after:, - created_before:, - limit:, - metadata:, - model:, - type: :stored_completions - ) - end - - sig do - override - .returns( - { - created_after: T.nilable(Integer), - created_before: T.nilable(Integer), - limit: T.nilable(Integer), - metadata: T.nilable(T::Hash[Symbol, String]), - model: T.nilable(String), - type: Symbol - } - ) - end - def to_hash; end - end - - sig do - override - .returns( - [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions] - ) - end - def self.variants; end - end - - # The type of run data source. Always `completions`. - module Type - extend OpenAI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - COMPLETIONS = - T.let(:completions, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type::TaggedSymbol) - - sig { override.returns(T::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type::TaggedSymbol]) } - def self.values; end - end - class SamplingParams < OpenAI::Internal::Type::BaseModel # The maximum number of tokens in the generated output. sig { returns(T.nilable(Integer)) } diff --git a/rbi/lib/openai/models/evals/run_cancel_response.rbi b/rbi/lib/openai/models/evals/run_cancel_response.rbi index bc2ac3bd..35e93b1b 100644 --- a/rbi/lib/openai/models/evals/run_cancel_response.rbi +++ b/rbi/lib/openai/models/evals/run_cancel_response.rbi @@ -17,7 +17,8 @@ module OpenAI returns( T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions ) ) end @@ -91,7 +92,8 @@ module OpenAI data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions ), error: T.any(OpenAI::Models::Evals::EvalAPIError, OpenAI::Internal::AnyHash), eval_id: String, @@ -131,7 +133,8 @@ module OpenAI created_at: Integer, data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions ), error: OpenAI::Models::Evals::EvalAPIError, eval_id: String, @@ -153,10 +156,661 @@ module OpenAI module DataSource extend OpenAI::Internal::Type::Union + class Completions < OpenAI::Internal::Type::BaseModel + # A EvalResponsesSource object describing a run data source configuration. + sig do + returns( + T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses + ) + ) + end + attr_accessor :source + + # The type of run data source. Always `completions`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + returns( + T.nilable( + T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + ) + end + attr_reader :input_messages + + sig do + params( + input_messages: T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + .void + end + attr_writer :input_messages + + # The name of the model to use for generating completions (e.g. "o3-mini"). + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + sig { returns(T.nilable(OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams)) } + attr_reader :sampling_params + + sig do + params( + sampling_params: T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ) + ) + .void + end + attr_writer :sampling_params + + # A ResponsesRunDataSource object describing a model sampling configuration. + sig do + params( + source: T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses + ), + input_messages: T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + end + + sig do + override + .returns( + { + source: T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses + ), + type: Symbol, + input_messages: T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams + } + ) + end + def to_hash; end + + # A EvalResponsesSource object describing a run data source configuration. + module Source + extend OpenAI::Internal::Type::Union + + class FileContent < OpenAI::Internal::Type::BaseModel + # The content of the jsonl file. + sig do + returns( + T::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::Content] + ) + end + attr_accessor :content + + # The type of jsonl source. Always `file_content`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + content: T::Array[ + T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::Content, + OpenAI::Internal::AnyHash + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(content:, type: :file_content); end + + sig do + override + .returns( + { + content: T::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::Content], + type: Symbol + } + ) + end + def to_hash; end + + class Content < OpenAI::Internal::Type::BaseModel + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :item + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :sample + + sig { params(sample: T::Hash[Symbol, T.anything]).void } + attr_writer :sample + + sig do + params( + item: T::Hash[Symbol, T.anything], + sample: T::Hash[Symbol, + T.anything] + ).returns(T.attached_class) + end + def self.new(item:, sample: nil); end + + sig do + override.returns({item: T::Hash[Symbol, T.anything], sample: T::Hash[Symbol, T.anything]}) + end + def to_hash; end + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # The identifier of the file. + sig { returns(String) } + attr_accessor :id + + # The type of jsonl source. Always `file_id`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(id: String, type: Symbol).returns(T.attached_class) } + def self.new(id:, type: :file_id); end + + sig { override.returns({id: String, type: Symbol}) } + def to_hash; end + end + + class Responses < OpenAI::Internal::Type::BaseModel + # The type of run data source. Always `responses`. + sig { returns(Symbol) } + attr_accessor :type + + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :allow_parallel_tool_calls + + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_after + + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_before + + # Whether the response has tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :has_tool_calls + + # Optional search string for instructions. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :instructions_search + + # Metadata filter for the responses. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # The name of the model to find responses for. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :model + + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol)) } + attr_accessor :reasoning_effort + + # Sampling temperature. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :temperature + + # Nucleus sampling parameter. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :top_p + + # List of user identifiers. This is a query parameter used to select responses. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :users + + # A EvalResponsesSource object describing a run data source configuration. + sig do + params( + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + allow_parallel_tool_calls: nil, + created_after: nil, + created_before: nil, + has_tool_calls: nil, + instructions_search: nil, + metadata: nil, + model: nil, + reasoning_effort: nil, + temperature: nil, + top_p: nil, + users: nil, + type: :responses + ); end + sig do + override + .returns( + { + type: Symbol, + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]) + } + ) + end + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses] + ) + end + def self.variants; end + end + + module InputMessages + extend OpenAI::Internal::Type::Union + + class Template < OpenAI::Internal::Type::BaseModel + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + sig do + returns( + T::Array[ + T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ] + ) + end + attr_accessor :template + + # The type of input messages. Always `template`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(template:, type: :template); end + + sig do + override + .returns( + { + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + } + ) + end + def to_hash; end + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # The content of the message. + sig { returns(String) } + attr_accessor :content + + # The role of the message (e.g. "system", "assistant", "user"). + sig { returns(String) } + attr_accessor :role + + sig { params(content: String, role: String).returns(T.attached_class) } + def self.new(content:, role:); end + + sig { override.returns({content: String, role: String}) } + def to_hash; end + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig do + returns( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + end + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .void + end + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::OrSymbol, + type: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol, + type: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ] + ) + end + def self.values; end + end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + ) + end + def self.variants; end + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # A reference to a variable in the "item" namespace. Ie, "item.name" + sig { returns(String) } + attr_accessor :item_reference + + # The type of input messages. Always `item_reference`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } + def self.new(item_reference:, type: :item_reference); end + + sig { override.returns({item_reference: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference] + ) + end + def self.variants; end + end + + class SamplingParams < OpenAI::Internal::Type::BaseModel + # The maximum number of tokens in the generated output. + sig { returns(T.nilable(Integer)) } + attr_reader :max_completion_tokens + + sig { params(max_completion_tokens: Integer).void } + attr_writer :max_completion_tokens + + # A seed value to initialize the randomness, during sampling. + sig { returns(T.nilable(Integer)) } + attr_reader :seed + + sig { params(seed: Integer).void } + attr_writer :seed + + # A higher temperature increases randomness in the outputs. + sig { returns(T.nilable(Float)) } + attr_reader :temperature + + sig { params(temperature: Float).void } + attr_writer :temperature + + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + sig { returns(T.nilable(Float)) } + attr_reader :top_p + + sig { params(top_p: Float).void } + attr_writer :top_p + + sig do + params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) + .returns(T.attached_class) + end + def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end + + sig do + override.returns( + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + ) + end + def to_hash; end + end + end + sig do override .returns( - [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions] ) end def self.variants; end diff --git a/rbi/lib/openai/models/evals/run_create_params.rbi b/rbi/lib/openai/models/evals/run_create_params.rbi index 0f0fd8b0..c995c3ef 100644 --- a/rbi/lib/openai/models/evals/run_create_params.rbi +++ b/rbi/lib/openai/models/evals/run_create_params.rbi @@ -12,7 +12,8 @@ module OpenAI returns( T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource ) ) end @@ -39,7 +40,8 @@ module OpenAI data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, @@ -55,7 +57,8 @@ module OpenAI { data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, @@ -69,10 +72,697 @@ module OpenAI module DataSource extend OpenAI::Internal::Type::Union + class CreateEvalResponsesRunDataSource < OpenAI::Internal::Type::BaseModel + # A EvalResponsesSource object describing a run data source configuration. + sig do + returns( + T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses + ) + ) + end + attr_accessor :source + + # The type of run data source. Always `completions`. + sig do + returns( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type::OrSymbol + ) + end + attr_accessor :type + + sig do + returns( + T.nilable( + T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference + ) + ) + ) + end + attr_reader :input_messages + + sig do + params( + input_messages: T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference + ) + ) + .void + end + attr_writer :input_messages + + # The name of the model to use for generating completions (e.g. "o3-mini"). + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + sig do + returns( + T.nilable( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams + ) + ) + end + attr_reader :sampling_params + + sig do + params( + sampling_params: T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams, + OpenAI::Internal::AnyHash + ) + ) + .void + end + attr_writer :sampling_params + + # A ResponsesRunDataSource object describing a model sampling configuration. + sig do + params( + source: T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses + ), + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type::OrSymbol, + input_messages: T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference + ), + model: String, + sampling_params: T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams, + OpenAI::Internal::AnyHash + ) + ) + .returns(T.attached_class) + end + def self.new(source:, type:, input_messages: nil, model: nil, sampling_params: nil); end + + sig do + override + .returns( + { + source: T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses + ), + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type::OrSymbol, + input_messages: T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference + ), + model: String, + sampling_params: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams + } + ) + end + def to_hash; end + + # A EvalResponsesSource object describing a run data source configuration. + module Source + extend OpenAI::Internal::Type::Union + + class FileContent < OpenAI::Internal::Type::BaseModel + # The content of the jsonl file. + sig do + returns( + T::Array[ + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::Content + ] + ) + end + attr_accessor :content + + # The type of jsonl source. Always `file_content`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + content: T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::Content, + OpenAI::Internal::AnyHash + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(content:, type: :file_content); end + + sig do + override + .returns( + { + content: T::Array[ + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::Content + ], + type: Symbol + } + ) + end + def to_hash; end + + class Content < OpenAI::Internal::Type::BaseModel + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :item + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :sample + + sig { params(sample: T::Hash[Symbol, T.anything]).void } + attr_writer :sample + + sig do + params( + item: T::Hash[Symbol, T.anything], + sample: T::Hash[Symbol, + T.anything] + ).returns(T.attached_class) + end + def self.new(item:, sample: nil); end + + sig do + override.returns({item: T::Hash[Symbol, T.anything], sample: T::Hash[Symbol, T.anything]}) + end + def to_hash; end + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # The identifier of the file. + sig { returns(String) } + attr_accessor :id + + # The type of jsonl source. Always `file_id`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(id: String, type: Symbol).returns(T.attached_class) } + def self.new(id:, type: :file_id); end + + sig { override.returns({id: String, type: Symbol}) } + def to_hash; end + end + + class Responses < OpenAI::Internal::Type::BaseModel + # The type of run data source. Always `responses`. + sig { returns(Symbol) } + attr_accessor :type + + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :allow_parallel_tool_calls + + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_after + + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_before + + # Whether the response has tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :has_tool_calls + + # Optional search string for instructions. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :instructions_search + + # Metadata filter for the responses. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # The name of the model to find responses for. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :model + + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) } + attr_accessor :reasoning_effort + + # Sampling temperature. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :temperature + + # Nucleus sampling parameter. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :top_p + + # List of user identifiers. This is a query parameter used to select responses. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :users + + # A EvalResponsesSource object describing a run data source configuration. + sig do + params( + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + allow_parallel_tool_calls: nil, + created_after: nil, + created_before: nil, + has_tool_calls: nil, + instructions_search: nil, + metadata: nil, + model: nil, + reasoning_effort: nil, + temperature: nil, + top_p: nil, + users: nil, + type: :responses + ); end + sig do + override + .returns( + { + type: Symbol, + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]) + } + ) + end + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses] + ) + end + def self.variants; end + end + + # The type of run data source. Always `completions`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPLETIONS = + T.let( + :completions, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type::TaggedSymbol] + ) + end + def self.values; end + end + + module InputMessages + extend OpenAI::Internal::Type::Union + + class Template < OpenAI::Internal::Type::BaseModel + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + sig do + returns( + T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem + ) + ] + ) + end + attr_accessor :template + + # The type of input messages. Always `template`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(template:, type: :template); end + + sig do + override + .returns( + { + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + } + ) + end + def to_hash; end + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # The content of the message. + sig { returns(String) } + attr_accessor :content + + # The role of the message (e.g. "system", "assistant", "user"). + sig { returns(String) } + attr_accessor :role + + sig { params(content: String, role: String).returns(T.attached_class) } + def self.new(content:, role:); end + + sig { override.returns({content: String, role: String}) } + def to_hash; end + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig do + returns( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol + ) + end + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .void + end + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol, + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol, + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ] + ) + end + def self.values; end + end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem] + ) + end + def self.variants; end + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # A reference to a variable in the "item" namespace. Ie, "item.name" + sig { returns(String) } + attr_accessor :item_reference + + # The type of input messages. Always `item_reference`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } + def self.new(item_reference:, type: :item_reference); end + + sig { override.returns({item_reference: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference] + ) + end + def self.variants; end + end + + class SamplingParams < OpenAI::Internal::Type::BaseModel + # The maximum number of tokens in the generated output. + sig { returns(T.nilable(Integer)) } + attr_reader :max_completion_tokens + + sig { params(max_completion_tokens: Integer).void } + attr_writer :max_completion_tokens + + # A seed value to initialize the randomness, during sampling. + sig { returns(T.nilable(Integer)) } + attr_reader :seed + + sig { params(seed: Integer).void } + attr_writer :seed + + # A higher temperature increases randomness in the outputs. + sig { returns(T.nilable(Float)) } + attr_reader :temperature + + sig { params(temperature: Float).void } + attr_writer :temperature + + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + sig { returns(T.nilable(Float)) } + attr_reader :top_p + + sig { params(top_p: Float).void } + attr_writer :top_p + + sig do + params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) + .returns(T.attached_class) + end + def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end + + sig do + override.returns( + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + ) + end + def to_hash; end + end + end + sig do override .returns( - [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] ) end def self.variants; end diff --git a/rbi/lib/openai/models/evals/run_create_response.rbi b/rbi/lib/openai/models/evals/run_create_response.rbi index 8999012b..40364127 100644 --- a/rbi/lib/openai/models/evals/run_create_response.rbi +++ b/rbi/lib/openai/models/evals/run_create_response.rbi @@ -17,7 +17,8 @@ module OpenAI returns( T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions ) ) end @@ -91,7 +92,8 @@ module OpenAI data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions ), error: T.any(OpenAI::Models::Evals::EvalAPIError, OpenAI::Internal::AnyHash), eval_id: String, @@ -131,7 +133,8 @@ module OpenAI created_at: Integer, data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions ), error: OpenAI::Models::Evals::EvalAPIError, eval_id: String, @@ -153,10 +156,661 @@ module OpenAI module DataSource extend OpenAI::Internal::Type::Union + class Completions < OpenAI::Internal::Type::BaseModel + # A EvalResponsesSource object describing a run data source configuration. + sig do + returns( + T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses + ) + ) + end + attr_accessor :source + + # The type of run data source. Always `completions`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + returns( + T.nilable( + T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + ) + end + attr_reader :input_messages + + sig do + params( + input_messages: T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + .void + end + attr_writer :input_messages + + # The name of the model to use for generating completions (e.g. "o3-mini"). + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + sig { returns(T.nilable(OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams)) } + attr_reader :sampling_params + + sig do + params( + sampling_params: T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ) + ) + .void + end + attr_writer :sampling_params + + # A ResponsesRunDataSource object describing a model sampling configuration. + sig do + params( + source: T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses + ), + input_messages: T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + end + + sig do + override + .returns( + { + source: T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses + ), + type: Symbol, + input_messages: T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams + } + ) + end + def to_hash; end + + # A EvalResponsesSource object describing a run data source configuration. + module Source + extend OpenAI::Internal::Type::Union + + class FileContent < OpenAI::Internal::Type::BaseModel + # The content of the jsonl file. + sig do + returns( + T::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::Content] + ) + end + attr_accessor :content + + # The type of jsonl source. Always `file_content`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + content: T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::Content, + OpenAI::Internal::AnyHash + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(content:, type: :file_content); end + + sig do + override + .returns( + { + content: T::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::Content], + type: Symbol + } + ) + end + def to_hash; end + + class Content < OpenAI::Internal::Type::BaseModel + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :item + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :sample + + sig { params(sample: T::Hash[Symbol, T.anything]).void } + attr_writer :sample + + sig do + params( + item: T::Hash[Symbol, T.anything], + sample: T::Hash[Symbol, + T.anything] + ).returns(T.attached_class) + end + def self.new(item:, sample: nil); end + + sig do + override.returns({item: T::Hash[Symbol, T.anything], sample: T::Hash[Symbol, T.anything]}) + end + def to_hash; end + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # The identifier of the file. + sig { returns(String) } + attr_accessor :id + + # The type of jsonl source. Always `file_id`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(id: String, type: Symbol).returns(T.attached_class) } + def self.new(id:, type: :file_id); end + + sig { override.returns({id: String, type: Symbol}) } + def to_hash; end + end + + class Responses < OpenAI::Internal::Type::BaseModel + # The type of run data source. Always `responses`. + sig { returns(Symbol) } + attr_accessor :type + + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :allow_parallel_tool_calls + + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_after + + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_before + + # Whether the response has tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :has_tool_calls + + # Optional search string for instructions. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :instructions_search + + # Metadata filter for the responses. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # The name of the model to find responses for. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :model + + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol)) } + attr_accessor :reasoning_effort + + # Sampling temperature. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :temperature + + # Nucleus sampling parameter. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :top_p + + # List of user identifiers. This is a query parameter used to select responses. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :users + + # A EvalResponsesSource object describing a run data source configuration. + sig do + params( + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + allow_parallel_tool_calls: nil, + created_after: nil, + created_before: nil, + has_tool_calls: nil, + instructions_search: nil, + metadata: nil, + model: nil, + reasoning_effort: nil, + temperature: nil, + top_p: nil, + users: nil, + type: :responses + ); end + sig do + override + .returns( + { + type: Symbol, + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]) + } + ) + end + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses] + ) + end + def self.variants; end + end + + module InputMessages + extend OpenAI::Internal::Type::Union + + class Template < OpenAI::Internal::Type::BaseModel + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + sig do + returns( + T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ] + ) + end + attr_accessor :template + + # The type of input messages. Always `template`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(template:, type: :template); end + + sig do + override + .returns( + { + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + } + ) + end + def to_hash; end + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # The content of the message. + sig { returns(String) } + attr_accessor :content + + # The role of the message (e.g. "system", "assistant", "user"). + sig { returns(String) } + attr_accessor :role + + sig { params(content: String, role: String).returns(T.attached_class) } + def self.new(content:, role:); end + + sig { override.returns({content: String, role: String}) } + def to_hash; end + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig do + returns( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + end + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .void + end + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::OrSymbol, + type: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol, + type: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ] + ) + end + def self.values; end + end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + ) + end + def self.variants; end + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # A reference to a variable in the "item" namespace. Ie, "item.name" + sig { returns(String) } + attr_accessor :item_reference + + # The type of input messages. Always `item_reference`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } + def self.new(item_reference:, type: :item_reference); end + + sig { override.returns({item_reference: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference] + ) + end + def self.variants; end + end + + class SamplingParams < OpenAI::Internal::Type::BaseModel + # The maximum number of tokens in the generated output. + sig { returns(T.nilable(Integer)) } + attr_reader :max_completion_tokens + + sig { params(max_completion_tokens: Integer).void } + attr_writer :max_completion_tokens + + # A seed value to initialize the randomness, during sampling. + sig { returns(T.nilable(Integer)) } + attr_reader :seed + + sig { params(seed: Integer).void } + attr_writer :seed + + # A higher temperature increases randomness in the outputs. + sig { returns(T.nilable(Float)) } + attr_reader :temperature + + sig { params(temperature: Float).void } + attr_writer :temperature + + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + sig { returns(T.nilable(Float)) } + attr_reader :top_p + + sig { params(top_p: Float).void } + attr_writer :top_p + + sig do + params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) + .returns(T.attached_class) + end + def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end + + sig do + override.returns( + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + ) + end + def to_hash; end + end + end + sig do override .returns( - [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions] ) end def self.variants; end diff --git a/rbi/lib/openai/models/evals/run_list_params.rbi b/rbi/lib/openai/models/evals/run_list_params.rbi index 5e68c583..c3cf6599 100644 --- a/rbi/lib/openai/models/evals/run_list_params.rbi +++ b/rbi/lib/openai/models/evals/run_list_params.rbi @@ -29,8 +29,8 @@ module OpenAI sig { params(order: OpenAI::Models::Evals::RunListParams::Order::OrSymbol).void } attr_writer :order - # Filter runs by status. Use "queued" | "in_progress" | "failed" | "completed" | - # "canceled". + # Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # | `canceled`. sig { returns(T.nilable(OpenAI::Models::Evals::RunListParams::Status::OrSymbol)) } attr_reader :status @@ -78,8 +78,8 @@ module OpenAI def self.values; end end - # Filter runs by status. Use "queued" | "in_progress" | "failed" | "completed" | - # "canceled". + # Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # | `canceled`. module Status extend OpenAI::Internal::Type::Enum diff --git a/rbi/lib/openai/models/evals/run_list_response.rbi b/rbi/lib/openai/models/evals/run_list_response.rbi index 01e8f33b..f264782f 100644 --- a/rbi/lib/openai/models/evals/run_list_response.rbi +++ b/rbi/lib/openai/models/evals/run_list_response.rbi @@ -17,7 +17,8 @@ module OpenAI returns( T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions ) ) end @@ -91,7 +92,8 @@ module OpenAI data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions ), error: T.any(OpenAI::Models::Evals::EvalAPIError, OpenAI::Internal::AnyHash), eval_id: String, @@ -131,7 +133,8 @@ module OpenAI created_at: Integer, data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions ), error: OpenAI::Models::Evals::EvalAPIError, eval_id: String, @@ -153,10 +156,661 @@ module OpenAI module DataSource extend OpenAI::Internal::Type::Union + class Completions < OpenAI::Internal::Type::BaseModel + # A EvalResponsesSource object describing a run data source configuration. + sig do + returns( + T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses + ) + ) + end + attr_accessor :source + + # The type of run data source. Always `completions`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + returns( + T.nilable( + T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + ) + end + attr_reader :input_messages + + sig do + params( + input_messages: T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + .void + end + attr_writer :input_messages + + # The name of the model to use for generating completions (e.g. "o3-mini"). + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + sig { returns(T.nilable(OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams)) } + attr_reader :sampling_params + + sig do + params( + sampling_params: T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ) + ) + .void + end + attr_writer :sampling_params + + # A ResponsesRunDataSource object describing a model sampling configuration. + sig do + params( + source: T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses + ), + input_messages: T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + end + + sig do + override + .returns( + { + source: T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses + ), + type: Symbol, + input_messages: T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams + } + ) + end + def to_hash; end + + # A EvalResponsesSource object describing a run data source configuration. + module Source + extend OpenAI::Internal::Type::Union + + class FileContent < OpenAI::Internal::Type::BaseModel + # The content of the jsonl file. + sig do + returns( + T::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::Content] + ) + end + attr_accessor :content + + # The type of jsonl source. Always `file_content`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + content: T::Array[ + T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::Content, + OpenAI::Internal::AnyHash + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(content:, type: :file_content); end + + sig do + override + .returns( + { + content: T::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::Content], + type: Symbol + } + ) + end + def to_hash; end + + class Content < OpenAI::Internal::Type::BaseModel + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :item + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :sample + + sig { params(sample: T::Hash[Symbol, T.anything]).void } + attr_writer :sample + + sig do + params( + item: T::Hash[Symbol, T.anything], + sample: T::Hash[Symbol, + T.anything] + ).returns(T.attached_class) + end + def self.new(item:, sample: nil); end + + sig do + override.returns({item: T::Hash[Symbol, T.anything], sample: T::Hash[Symbol, T.anything]}) + end + def to_hash; end + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # The identifier of the file. + sig { returns(String) } + attr_accessor :id + + # The type of jsonl source. Always `file_id`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(id: String, type: Symbol).returns(T.attached_class) } + def self.new(id:, type: :file_id); end + + sig { override.returns({id: String, type: Symbol}) } + def to_hash; end + end + + class Responses < OpenAI::Internal::Type::BaseModel + # The type of run data source. Always `responses`. + sig { returns(Symbol) } + attr_accessor :type + + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :allow_parallel_tool_calls + + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_after + + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_before + + # Whether the response has tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :has_tool_calls + + # Optional search string for instructions. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :instructions_search + + # Metadata filter for the responses. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # The name of the model to find responses for. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :model + + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol)) } + attr_accessor :reasoning_effort + + # Sampling temperature. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :temperature + + # Nucleus sampling parameter. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :top_p + + # List of user identifiers. This is a query parameter used to select responses. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :users + + # A EvalResponsesSource object describing a run data source configuration. + sig do + params( + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + allow_parallel_tool_calls: nil, + created_after: nil, + created_before: nil, + has_tool_calls: nil, + instructions_search: nil, + metadata: nil, + model: nil, + reasoning_effort: nil, + temperature: nil, + top_p: nil, + users: nil, + type: :responses + ); end + sig do + override + .returns( + { + type: Symbol, + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]) + } + ) + end + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses] + ) + end + def self.variants; end + end + + module InputMessages + extend OpenAI::Internal::Type::Union + + class Template < OpenAI::Internal::Type::BaseModel + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + sig do + returns( + T::Array[ + T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ] + ) + end + attr_accessor :template + + # The type of input messages. Always `template`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(template:, type: :template); end + + sig do + override + .returns( + { + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + } + ) + end + def to_hash; end + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # The content of the message. + sig { returns(String) } + attr_accessor :content + + # The role of the message (e.g. "system", "assistant", "user"). + sig { returns(String) } + attr_accessor :role + + sig { params(content: String, role: String).returns(T.attached_class) } + def self.new(content:, role:); end + + sig { override.returns({content: String, role: String}) } + def to_hash; end + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig do + returns( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + end + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .void + end + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::OrSymbol, + type: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol, + type: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ] + ) + end + def self.values; end + end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + ) + end + def self.variants; end + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # A reference to a variable in the "item" namespace. Ie, "item.name" + sig { returns(String) } + attr_accessor :item_reference + + # The type of input messages. Always `item_reference`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } + def self.new(item_reference:, type: :item_reference); end + + sig { override.returns({item_reference: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference] + ) + end + def self.variants; end + end + + class SamplingParams < OpenAI::Internal::Type::BaseModel + # The maximum number of tokens in the generated output. + sig { returns(T.nilable(Integer)) } + attr_reader :max_completion_tokens + + sig { params(max_completion_tokens: Integer).void } + attr_writer :max_completion_tokens + + # A seed value to initialize the randomness, during sampling. + sig { returns(T.nilable(Integer)) } + attr_reader :seed + + sig { params(seed: Integer).void } + attr_writer :seed + + # A higher temperature increases randomness in the outputs. + sig { returns(T.nilable(Float)) } + attr_reader :temperature + + sig { params(temperature: Float).void } + attr_writer :temperature + + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + sig { returns(T.nilable(Float)) } + attr_reader :top_p + + sig { params(top_p: Float).void } + attr_writer :top_p + + sig do + params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) + .returns(T.attached_class) + end + def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end + + sig do + override.returns( + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + ) + end + def to_hash; end + end + end + sig do override .returns( - [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunListResponse::DataSource::Completions] ) end def self.variants; end diff --git a/rbi/lib/openai/models/evals/run_retrieve_response.rbi b/rbi/lib/openai/models/evals/run_retrieve_response.rbi index 85db5714..405a83cf 100644 --- a/rbi/lib/openai/models/evals/run_retrieve_response.rbi +++ b/rbi/lib/openai/models/evals/run_retrieve_response.rbi @@ -17,7 +17,8 @@ module OpenAI returns( T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions ) ) end @@ -91,7 +92,8 @@ module OpenAI data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions ), error: T.any(OpenAI::Models::Evals::EvalAPIError, OpenAI::Internal::AnyHash), eval_id: String, @@ -131,7 +133,8 @@ module OpenAI created_at: Integer, data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions ), error: OpenAI::Models::Evals::EvalAPIError, eval_id: String, @@ -153,10 +156,661 @@ module OpenAI module DataSource extend OpenAI::Internal::Type::Union + class Completions < OpenAI::Internal::Type::BaseModel + # A EvalResponsesSource object describing a run data source configuration. + sig do + returns( + T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses + ) + ) + end + attr_accessor :source + + # The type of run data source. Always `completions`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + returns( + T.nilable( + T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + ) + end + attr_reader :input_messages + + sig do + params( + input_messages: T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference + ) + ) + .void + end + attr_writer :input_messages + + # The name of the model to use for generating completions (e.g. "o3-mini"). + sig { returns(T.nilable(String)) } + attr_reader :model + + sig { params(model: String).void } + attr_writer :model + + sig { returns(T.nilable(OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams)) } + attr_reader :sampling_params + + sig do + params( + sampling_params: T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ) + ) + .void + end + attr_writer :sampling_params + + # A ResponsesRunDataSource object describing a model sampling configuration. + sig do + params( + source: T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses + ), + input_messages: T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams, + OpenAI::Internal::AnyHash + ), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + end + + sig do + override + .returns( + { + source: T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses + ), + type: Symbol, + input_messages: T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference + ), + model: String, + sampling_params: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams + } + ) + end + def to_hash; end + + # A EvalResponsesSource object describing a run data source configuration. + module Source + extend OpenAI::Internal::Type::Union + + class FileContent < OpenAI::Internal::Type::BaseModel + # The content of the jsonl file. + sig do + returns( + T::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::Content] + ) + end + attr_accessor :content + + # The type of jsonl source. Always `file_content`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + content: T::Array[ + T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::Content, + OpenAI::Internal::AnyHash + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(content:, type: :file_content); end + + sig do + override + .returns( + { + content: T::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::Content], + type: Symbol + } + ) + end + def to_hash; end + + class Content < OpenAI::Internal::Type::BaseModel + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :item + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :sample + + sig { params(sample: T::Hash[Symbol, T.anything]).void } + attr_writer :sample + + sig do + params( + item: T::Hash[Symbol, T.anything], + sample: T::Hash[Symbol, + T.anything] + ).returns(T.attached_class) + end + def self.new(item:, sample: nil); end + + sig do + override.returns({item: T::Hash[Symbol, T.anything], sample: T::Hash[Symbol, T.anything]}) + end + def to_hash; end + end + end + + class FileID < OpenAI::Internal::Type::BaseModel + # The identifier of the file. + sig { returns(String) } + attr_accessor :id + + # The type of jsonl source. Always `file_id`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(id: String, type: Symbol).returns(T.attached_class) } + def self.new(id:, type: :file_id); end + + sig { override.returns({id: String, type: Symbol}) } + def to_hash; end + end + + class Responses < OpenAI::Internal::Type::BaseModel + # The type of run data source. Always `responses`. + sig { returns(Symbol) } + attr_accessor :type + + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :allow_parallel_tool_calls + + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_after + + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :created_before + + # Whether the response has tool calls. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :has_tool_calls + + # Optional search string for instructions. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :instructions_search + + # Metadata filter for the responses. This is a query parameter used to select + # responses. + sig { returns(T.nilable(T.anything)) } + attr_accessor :metadata + + # The name of the model to find responses for. This is a query parameter used to + # select responses. + sig { returns(T.nilable(String)) } + attr_accessor :model + + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. + sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol)) } + attr_accessor :reasoning_effort + + # Sampling temperature. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :temperature + + # Nucleus sampling parameter. This is a query parameter used to select responses. + sig { returns(T.nilable(Float)) } + attr_accessor :top_p + + # List of user identifiers. This is a query parameter used to select responses. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :users + + # A EvalResponsesSource object describing a run data source configuration. + sig do + params( + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]), + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + allow_parallel_tool_calls: nil, + created_after: nil, + created_before: nil, + has_tool_calls: nil, + instructions_search: nil, + metadata: nil, + model: nil, + reasoning_effort: nil, + temperature: nil, + top_p: nil, + users: nil, + type: :responses + ); end + sig do + override + .returns( + { + type: Symbol, + allow_parallel_tool_calls: T.nilable(T::Boolean), + created_after: T.nilable(Integer), + created_before: T.nilable(Integer), + has_tool_calls: T.nilable(T::Boolean), + instructions_search: T.nilable(String), + metadata: T.nilable(T.anything), + model: T.nilable(String), + reasoning_effort: T.nilable(OpenAI::Models::ReasoningEffort::TaggedSymbol), + temperature: T.nilable(Float), + top_p: T.nilable(Float), + users: T.nilable(T::Array[String]) + } + ) + end + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses] + ) + end + def self.variants; end + end + + module InputMessages + extend OpenAI::Internal::Type::Union + + class Template < OpenAI::Internal::Type::BaseModel + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + sig do + returns( + T::Array[ + T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ] + ) + end + attr_accessor :template + + # The type of input messages. Always `template`. + sig { returns(Symbol) } + attr_accessor :type + + sig do + params( + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + ) + .returns(T.attached_class) + end + def self.new(template:, type: :template); end + + sig do + override + .returns( + { + template: T::Array[ + T.any( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + ) + ], + type: Symbol + } + ) + end + def to_hash; end + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + module Template + extend OpenAI::Internal::Type::Union + + class ChatMessage < OpenAI::Internal::Type::BaseModel + # The content of the message. + sig { returns(String) } + attr_accessor :content + + # The role of the message (e.g. "system", "assistant", "user"). + sig { returns(String) } + attr_accessor :role + + sig { params(content: String, role: String).returns(T.attached_class) } + def self.new(content:, role:); end + + sig { override.returns({content: String, role: String}) } + def to_hash; end + end + + class EvalItem < OpenAI::Internal::Type::BaseModel + # Text inputs to the model - can contain template strings. + sig do + returns( + T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ) + ) + end + attr_accessor :content + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + sig do + returns( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + end + attr_accessor :role + + # The type of the message input. Always `message`. + sig do + returns( + T.nilable( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + ) + end + attr_reader :type + + sig do + params( + type: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .void + end + attr_writer :type + + # A message input to the model with a role indicating instruction following + # hierarchy. Instructions given with the `developer` or `system` role take + # precedence over instructions given with the `user` role. Messages with the + # `assistant` role are presumed to have been generated by the model in previous + # interactions. + sig do + params( + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Internal::AnyHash, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::OrSymbol, + type: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::OrSymbol + ) + .returns(T.attached_class) + end + def self.new(content:, role:, type: nil); end + + sig do + override + .returns( + { + content: T.any( + String, + OpenAI::Models::Responses::ResponseInputText, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + ), + role: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol, + type: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + } + ) + end + def to_hash; end + + # Text inputs to the model - can contain template strings. + module Content + extend OpenAI::Internal::Type::Union + + class OutputText < OpenAI::Internal::Type::BaseModel + # The text output from the model. + sig { returns(String) } + attr_accessor :text + + # The type of the output text. Always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # A text output from the model. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :output_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + ) + end + def self.variants; end + end + + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + module Role + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + ASSISTANT = + T.let( + :assistant, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + DEVELOPER = + T.let( + :developer, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol + ] + ) + end + def self.values; end + end + + # The type of the message input. Always `message`. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MESSAGE = + T.let( + :message, + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ) + + sig do + override + .returns( + T::Array[ + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol + ] + ) + end + def self.values; end + end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + ) + end + def self.variants; end + end + end + + class ItemReference < OpenAI::Internal::Type::BaseModel + # A reference to a variable in the "item" namespace. Ie, "item.name" + sig { returns(String) } + attr_accessor :item_reference + + # The type of input messages. Always `item_reference`. + sig { returns(Symbol) } + attr_accessor :type + + sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } + def self.new(item_reference:, type: :item_reference); end + + sig { override.returns({item_reference: String, type: Symbol}) } + def to_hash; end + end + + sig do + override + .returns( + [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference] + ) + end + def self.variants; end + end + + class SamplingParams < OpenAI::Internal::Type::BaseModel + # The maximum number of tokens in the generated output. + sig { returns(T.nilable(Integer)) } + attr_reader :max_completion_tokens + + sig { params(max_completion_tokens: Integer).void } + attr_writer :max_completion_tokens + + # A seed value to initialize the randomness, during sampling. + sig { returns(T.nilable(Integer)) } + attr_reader :seed + + sig { params(seed: Integer).void } + attr_writer :seed + + # A higher temperature increases randomness in the outputs. + sig { returns(T.nilable(Float)) } + attr_reader :temperature + + sig { params(temperature: Float).void } + attr_writer :temperature + + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + sig { returns(T.nilable(Float)) } + attr_reader :top_p + + sig { params(top_p: Float).void } + attr_writer :top_p + + sig do + params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) + .returns(T.attached_class) + end + def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end + + sig do + override.returns( + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + ) + end + def to_hash; end + end + end + sig do override .returns( - [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions] ) end def self.variants; end diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi index 69429e05..b762881f 100644 --- a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi @@ -8,17 +8,21 @@ module OpenAI extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters + sig { returns(String) } + attr_accessor :fine_tuned_model_checkpoint + sig do params( - request_options: T.any( - OpenAI::RequestOptions, - OpenAI::Internal::AnyHash - ) - ).returns(T.attached_class) + fine_tuned_model_checkpoint: String, + request_options: T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash) + ) + .returns(T.attached_class) end - def self.new(request_options: {}); end + def self.new(fine_tuned_model_checkpoint:, request_options: {}); end - sig { override.returns({request_options: OpenAI::RequestOptions}) } + sig do + override.returns({fine_tuned_model_checkpoint: String, request_options: OpenAI::RequestOptions}) + end def to_hash; end end end diff --git a/rbi/lib/openai/models/image.rbi b/rbi/lib/openai/models/image.rbi index 3a2f3c67..cf15fc93 100644 --- a/rbi/lib/openai/models/image.rbi +++ b/rbi/lib/openai/models/image.rbi @@ -3,30 +3,32 @@ module OpenAI module Models class Image < OpenAI::Internal::Type::BaseModel - # The base64-encoded JSON of the generated image, if `response_format` is - # `b64_json`. + # The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, + # and only present if `response_format` is set to `b64_json` for `dall-e-2` and + # `dall-e-3`. sig { returns(T.nilable(String)) } attr_reader :b64_json sig { params(b64_json: String).void } attr_writer :b64_json - # The prompt that was used to generate the image, if there was any revision to the - # prompt. + # For `dall-e-3` only, the revised prompt that was used to generate the image. sig { returns(T.nilable(String)) } attr_reader :revised_prompt sig { params(revised_prompt: String).void } attr_writer :revised_prompt - # The URL of the generated image, if `response_format` is `url` (default). + # When using `dall-e-2` or `dall-e-3`, the URL of the generated image if + # `response_format` is set to `url` (default value). Unsupported for + # `gpt-image-1`. sig { returns(T.nilable(String)) } attr_reader :url sig { params(url: String).void } attr_writer :url - # Represents the url or the content of an image generated by the OpenAI API. + # Represents the content or the URL of an image generated by the OpenAI API. sig { params(b64_json: String, revised_prompt: String, url: String).returns(T.attached_class) } def self.new(b64_json: nil, revised_prompt: nil, url: nil); end diff --git a/rbi/lib/openai/models/image_create_variation_params.rbi b/rbi/lib/openai/models/image_create_variation_params.rbi index 44cd2758..c2d38787 100644 --- a/rbi/lib/openai/models/image_create_variation_params.rbi +++ b/rbi/lib/openai/models/image_create_variation_params.rbi @@ -16,8 +16,7 @@ module OpenAI sig { returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) } attr_accessor :model - # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only - # `n=1` is supported. + # The number of images to generate. Must be between 1 and 10. sig { returns(T.nilable(Integer)) } attr_accessor :n diff --git a/rbi/lib/openai/models/image_edit_params.rbi b/rbi/lib/openai/models/image_edit_params.rbi index 616662cf..922d5db6 100644 --- a/rbi/lib/openai/models/image_edit_params.rbi +++ b/rbi/lib/openai/models/image_edit_params.rbi @@ -6,18 +6,21 @@ module OpenAI extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - # The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask - # is not provided, image must have transparency, which will be used as the mask. - sig { returns(T.any(Pathname, StringIO)) } + # The image(s) to edit. Must be a supported image file or an array of images. For + # `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square + # `png` file less than 4MB. + sig { returns(T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)])) } attr_accessor :image # A text description of the desired image(s). The maximum length is 1000 - # characters. + # characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. sig { returns(String) } attr_accessor :prompt # An additional image whose fully transparent areas (e.g. where alpha is zero) - # indicate where `image` should be edited. Must be a valid PNG file, less than + # indicate where `image` should be edited. If there are multiple images provided, + # the mask will be applied on the first image. Must be a valid PNG file, less than # 4MB, and have the same dimensions as `image`. sig { returns(T.nilable(T.any(Pathname, StringIO))) } attr_reader :mask @@ -25,8 +28,9 @@ module OpenAI sig { params(mask: T.any(Pathname, StringIO)).void } attr_writer :mask - # The model to use for image generation. Only `dall-e-2` is supported at this - # time. + # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are + # supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` + # is used. sig { returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) } attr_accessor :model @@ -34,14 +38,22 @@ module OpenAI sig { returns(T.nilable(Integer)) } attr_accessor :n + # The quality of the image that will be generated. `high`, `medium` and `low` are + # only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. + # Defaults to `auto`. + sig { returns(T.nilable(OpenAI::Models::ImageEditParams::Quality::OrSymbol)) } + attr_accessor :quality + # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` + # will always return base64-encoded images. sig { returns(T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol)) } attr_accessor :response_format - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024`. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. sig { returns(T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol)) } attr_accessor :size @@ -56,11 +68,12 @@ module OpenAI sig do params( - image: T.any(Pathname, StringIO), + image: T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)]), prompt: String, mask: T.any(Pathname, StringIO), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), + quality: T.nilable(OpenAI::Models::ImageEditParams::Quality::OrSymbol), response_format: T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol), user: String, @@ -74,6 +87,7 @@ module OpenAI mask: nil, model: nil, n: nil, + quality: nil, response_format: nil, size: nil, user: nil, @@ -83,11 +97,12 @@ module OpenAI override .returns( { - image: T.any(Pathname, StringIO), + image: T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)]), prompt: String, mask: T.any(Pathname, StringIO), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), + quality: T.nilable(OpenAI::Models::ImageEditParams::Quality::OrSymbol), response_format: T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol), user: String, @@ -97,8 +112,26 @@ module OpenAI end def to_hash; end - # The model to use for image generation. Only `dall-e-2` is supported at this - # time. + # The image(s) to edit. Must be a supported image file or an array of images. For + # `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square + # `png` file less than 4MB. + module Image + extend OpenAI::Internal::Type::Union + + sig { override.returns([StringIO, T::Array[StringIO]]) } + def self.variants; end + + StringArray = + T.let( + OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::IOLike], + OpenAI::Internal::Type::Converter + ) + end + + # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are + # supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` + # is used. module Model extend OpenAI::Internal::Type::Union @@ -106,9 +139,29 @@ module OpenAI def self.variants; end end + # The quality of the image that will be generated. `high`, `medium` and `low` are + # only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. + # Defaults to `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::ImageEditParams::Quality) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STANDARD = T.let(:standard, OpenAI::Models::ImageEditParams::Quality::TaggedSymbol) + LOW = T.let(:low, OpenAI::Models::ImageEditParams::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Models::ImageEditParams::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Models::ImageEditParams::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Models::ImageEditParams::Quality::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::Models::ImageEditParams::Quality::TaggedSymbol]) } + def self.values; end + end + # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` + # will always return base64-encoded images. module ResponseFormat extend OpenAI::Internal::Type::Enum @@ -122,8 +175,9 @@ module OpenAI def self.values; end end - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024`. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. module Size extend OpenAI::Internal::Type::Enum diff --git a/rbi/lib/openai/models/image_generate_params.rbi b/rbi/lib/openai/models/image_generate_params.rbi index d35fb1e2..0ee05de0 100644 --- a/rbi/lib/openai/models/image_generate_params.rbi +++ b/rbi/lib/openai/models/image_generate_params.rbi @@ -6,45 +6,77 @@ module OpenAI extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - # A text description of the desired image(s). The maximum length is 1000 - # characters for `dall-e-2` and 4000 characters for `dall-e-3`. + # A text description of the desired image(s). The maximum length is 32000 + # characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters + # for `dall-e-3`. sig { returns(String) } attr_accessor :prompt - # The model to use for image generation. + # Allows to set transparency for the background of the generated image(s). This + # parameter is only supported for `gpt-image-1`. Must be one of `transparent`, + # `opaque` or `auto` (default value). When `auto` is used, the model will + # automatically determine the best background for the image. + # + # If `transparent`, the output format needs to support transparency, so it should + # be set to either `png` (default value) or `webp`. + sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Background::OrSymbol)) } + attr_accessor :background + + # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or + # `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to + # `gpt-image-1` is used. sig { returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) } attr_accessor :model + # Control the content-moderation level for images generated by `gpt-image-1`. Must + # be either `low` for less restrictive filtering or `auto` (default value). + sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Moderation::OrSymbol)) } + attr_accessor :moderation + # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only # `n=1` is supported. sig { returns(T.nilable(Integer)) } attr_accessor :n - # The quality of the image that will be generated. `hd` creates images with finer - # details and greater consistency across the image. This param is only supported - # for `dall-e-3`. - sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Quality::OrSymbol)) } - attr_reader :quality + # The compression level (0-100%) for the generated images. This parameter is only + # supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + # defaults to 100. + sig { returns(T.nilable(Integer)) } + attr_accessor :output_compression + + # The format in which the generated images are returned. This parameter is only + # supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::OutputFormat::OrSymbol)) } + attr_accessor :output_format - sig { params(quality: OpenAI::Models::ImageGenerateParams::Quality::OrSymbol).void } - attr_writer :quality + # The quality of the image that will be generated. + # + # - `auto` (default value) will automatically select the best quality for the + # given model. + # - `high`, `medium` and `low` are supported for `gpt-image-1`. + # - `hd` and `standard` are supported for `dall-e-3`. + # - `standard` is the only option for `dall-e-2`. + sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Quality::OrSymbol)) } + attr_accessor :quality - # The format in which the generated images are returned. Must be one of `url` or - # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # The format in which generated images with `dall-e-2` and `dall-e-3` are + # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes + # after the image has been generated. This parameter isn't supported for + # `gpt-image-1` which will always return base64-encoded images. sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::ResponseFormat::OrSymbol)) } attr_accessor :response_format - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or - # `1024x1792` for `dall-e-3` models. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and + # one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol)) } attr_accessor :size - # The style of the generated images. Must be one of `vivid` or `natural`. Vivid - # causes the model to lean towards generating hyper-real and dramatic images. - # Natural causes the model to produce more natural, less hyper-real looking - # images. This param is only supported for `dall-e-3`. + # The style of the generated images. This parameter is only supported for + # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean + # towards generating hyper-real and dramatic images. Natural causes the model to + # produce more natural, less hyper-real looking images. sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol)) } attr_accessor :style @@ -60,9 +92,13 @@ module OpenAI sig do params( prompt: String, + background: T.nilable(OpenAI::Models::ImageGenerateParams::Background::OrSymbol), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), + moderation: T.nilable(OpenAI::Models::ImageGenerateParams::Moderation::OrSymbol), n: T.nilable(Integer), - quality: OpenAI::Models::ImageGenerateParams::Quality::OrSymbol, + output_compression: T.nilable(Integer), + output_format: T.nilable(OpenAI::Models::ImageGenerateParams::OutputFormat::OrSymbol), + quality: T.nilable(OpenAI::Models::ImageGenerateParams::Quality::OrSymbol), response_format: T.nilable(OpenAI::Models::ImageGenerateParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol), style: T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol), @@ -73,8 +109,12 @@ module OpenAI end def self.new( prompt:, + background: nil, model: nil, + moderation: nil, n: nil, + output_compression: nil, + output_format: nil, quality: nil, response_format: nil, size: nil, @@ -87,9 +127,13 @@ module OpenAI .returns( { prompt: String, + background: T.nilable(OpenAI::Models::ImageGenerateParams::Background::OrSymbol), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), + moderation: T.nilable(OpenAI::Models::ImageGenerateParams::Moderation::OrSymbol), n: T.nilable(Integer), - quality: OpenAI::Models::ImageGenerateParams::Quality::OrSymbol, + output_compression: T.nilable(Integer), + output_format: T.nilable(OpenAI::Models::ImageGenerateParams::OutputFormat::OrSymbol), + quality: T.nilable(OpenAI::Models::ImageGenerateParams::Quality::OrSymbol), response_format: T.nilable(OpenAI::Models::ImageGenerateParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol), style: T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol), @@ -100,7 +144,30 @@ module OpenAI end def to_hash; end - # The model to use for image generation. + # Allows to set transparency for the background of the generated image(s). This + # parameter is only supported for `gpt-image-1`. Must be one of `transparent`, + # `opaque` or `auto` (default value). When `auto` is used, the model will + # automatically determine the best background for the image. + # + # If `transparent`, the output format needs to support transparency, so it should + # be set to either `png` (default value) or `webp`. + module Background + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::ImageGenerateParams::Background) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSPARENT = T.let(:transparent, OpenAI::Models::ImageGenerateParams::Background::TaggedSymbol) + OPAQUE = T.let(:opaque, OpenAI::Models::ImageGenerateParams::Background::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Models::ImageGenerateParams::Background::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::Models::ImageGenerateParams::Background::TaggedSymbol]) } + def self.values; end + end + + # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or + # `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to + # `gpt-image-1` is used. module Model extend OpenAI::Internal::Type::Union @@ -108,9 +175,44 @@ module OpenAI def self.variants; end end - # The quality of the image that will be generated. `hd` creates images with finer - # details and greater consistency across the image. This param is only supported - # for `dall-e-3`. + # Control the content-moderation level for images generated by `gpt-image-1`. Must + # be either `low` for less restrictive filtering or `auto` (default value). + module Moderation + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::ImageGenerateParams::Moderation) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Models::ImageGenerateParams::Moderation::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Models::ImageGenerateParams::Moderation::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::Models::ImageGenerateParams::Moderation::TaggedSymbol]) } + def self.values; end + end + + # The format in which the generated images are returned. This parameter is only + # supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + module OutputFormat + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PNG = T.let(:png, OpenAI::Models::ImageGenerateParams::OutputFormat::TaggedSymbol) + JPEG = T.let(:jpeg, OpenAI::Models::ImageGenerateParams::OutputFormat::TaggedSymbol) + WEBP = T.let(:webp, OpenAI::Models::ImageGenerateParams::OutputFormat::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::Models::ImageGenerateParams::OutputFormat::TaggedSymbol]) } + def self.values; end + end + + # The quality of the image that will be generated. + # + # - `auto` (default value) will automatically select the best quality for the + # given model. + # - `high`, `medium` and `low` are supported for `gpt-image-1`. + # - `hd` and `standard` are supported for `dall-e-3`. + # - `standard` is the only option for `dall-e-2`. module Quality extend OpenAI::Internal::Type::Enum @@ -119,14 +221,19 @@ module OpenAI STANDARD = T.let(:standard, OpenAI::Models::ImageGenerateParams::Quality::TaggedSymbol) HD = T.let(:hd, OpenAI::Models::ImageGenerateParams::Quality::TaggedSymbol) + LOW = T.let(:low, OpenAI::Models::ImageGenerateParams::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Models::ImageGenerateParams::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Models::ImageGenerateParams::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Models::ImageGenerateParams::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::Models::ImageGenerateParams::Quality::TaggedSymbol]) } def self.values; end end - # The format in which the generated images are returned. Must be one of `url` or - # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # The format in which generated images with `dall-e-2` and `dall-e-3` are + # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes + # after the image has been generated. This parameter isn't supported for + # `gpt-image-1` which will always return base64-encoded images. module ResponseFormat extend OpenAI::Internal::Type::Enum @@ -140,18 +247,22 @@ module OpenAI def self.values; end end - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or - # `1024x1792` for `dall-e-3` models. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and + # one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. module Size extend OpenAI::Internal::Type::Enum TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::ImageGenerateParams::Size) } OrSymbol = T.type_alias { T.any(Symbol, String) } + AUTO = T.let(:auto, OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) + SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) + SIZE_1536X1024 = T.let(:"1536x1024", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) + SIZE_1024X1536 = T.let(:"1024x1536", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) SIZE_256X256 = T.let(:"256x256", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) SIZE_512X512 = T.let(:"512x512", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) - SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) SIZE_1792X1024 = T.let(:"1792x1024", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) SIZE_1024X1792 = T.let(:"1024x1792", OpenAI::Models::ImageGenerateParams::Size::TaggedSymbol) @@ -159,10 +270,10 @@ module OpenAI def self.values; end end - # The style of the generated images. Must be one of `vivid` or `natural`. Vivid - # causes the model to lean towards generating hyper-real and dramatic images. - # Natural causes the model to produce more natural, less hyper-real looking - # images. This param is only supported for `dall-e-3`. + # The style of the generated images. This parameter is only supported for + # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean + # towards generating hyper-real and dramatic images. Natural causes the model to + # produce more natural, less hyper-real looking images. module Style extend OpenAI::Internal::Type::Enum diff --git a/rbi/lib/openai/models/image_model.rbi b/rbi/lib/openai/models/image_model.rbi index 2dd50c7c..bf52f382 100644 --- a/rbi/lib/openai/models/image_model.rbi +++ b/rbi/lib/openai/models/image_model.rbi @@ -10,6 +10,7 @@ module OpenAI DALL_E_2 = T.let(:"dall-e-2", OpenAI::Models::ImageModel::TaggedSymbol) DALL_E_3 = T.let(:"dall-e-3", OpenAI::Models::ImageModel::TaggedSymbol) + GPT_IMAGE_1 = T.let(:"gpt-image-1", OpenAI::Models::ImageModel::TaggedSymbol) sig { override.returns(T::Array[OpenAI::Models::ImageModel::TaggedSymbol]) } def self.values; end diff --git a/rbi/lib/openai/models/images_response.rbi b/rbi/lib/openai/models/images_response.rbi index cb594826..be9cfe0e 100644 --- a/rbi/lib/openai/models/images_response.rbi +++ b/rbi/lib/openai/models/images_response.rbi @@ -3,20 +3,110 @@ module OpenAI module Models class ImagesResponse < OpenAI::Internal::Type::BaseModel + # The Unix timestamp (in seconds) of when the image was created. sig { returns(Integer) } attr_accessor :created - sig { returns(T::Array[OpenAI::Models::Image]) } - attr_accessor :data + # The list of generated images. + sig { returns(T.nilable(T::Array[OpenAI::Models::Image])) } + attr_reader :data + sig { params(data: T::Array[T.any(OpenAI::Models::Image, OpenAI::Internal::AnyHash)]).void } + attr_writer :data + + # For `gpt-image-1` only, the token usage information for the image generation. + sig { returns(T.nilable(OpenAI::Models::ImagesResponse::Usage)) } + attr_reader :usage + + sig { params(usage: T.any(OpenAI::Models::ImagesResponse::Usage, OpenAI::Internal::AnyHash)).void } + attr_writer :usage + + # The response from the image generation endpoint. sig do - params(created: Integer, data: T::Array[T.any(OpenAI::Models::Image, OpenAI::Internal::AnyHash)]) + params( + created: Integer, + data: T::Array[T.any(OpenAI::Models::Image, OpenAI::Internal::AnyHash)], + usage: T.any(OpenAI::Models::ImagesResponse::Usage, OpenAI::Internal::AnyHash) + ) .returns(T.attached_class) end - def self.new(created:, data:); end + def self.new(created:, data: nil, usage: nil); end - sig { override.returns({created: Integer, data: T::Array[OpenAI::Models::Image]}) } + sig do + override + .returns( + {created: Integer, data: T::Array[OpenAI::Models::Image], usage: OpenAI::Models::ImagesResponse::Usage} + ) + end def to_hash; end + + class Usage < OpenAI::Internal::Type::BaseModel + # The number of tokens (images and text) in the input prompt. + sig { returns(Integer) } + attr_accessor :input_tokens + + # The input tokens detailed information for the image generation. + sig { returns(OpenAI::Models::ImagesResponse::Usage::InputTokensDetails) } + attr_reader :input_tokens_details + + sig do + params( + input_tokens_details: T.any(OpenAI::Models::ImagesResponse::Usage::InputTokensDetails, OpenAI::Internal::AnyHash) + ) + .void + end + attr_writer :input_tokens_details + + # The number of image tokens in the output image. + sig { returns(Integer) } + attr_accessor :output_tokens + + # The total number of tokens (images and text) used for the image generation. + sig { returns(Integer) } + attr_accessor :total_tokens + + # For `gpt-image-1` only, the token usage information for the image generation. + sig do + params( + input_tokens: Integer, + input_tokens_details: T.any(OpenAI::Models::ImagesResponse::Usage::InputTokensDetails, OpenAI::Internal::AnyHash), + output_tokens: Integer, + total_tokens: Integer + ) + .returns(T.attached_class) + end + def self.new(input_tokens:, input_tokens_details:, output_tokens:, total_tokens:); end + + sig do + override + .returns( + { + input_tokens: Integer, + input_tokens_details: OpenAI::Models::ImagesResponse::Usage::InputTokensDetails, + output_tokens: Integer, + total_tokens: Integer + } + ) + end + def to_hash; end + + class InputTokensDetails < OpenAI::Internal::Type::BaseModel + # The number of image tokens in the input prompt. + sig { returns(Integer) } + attr_accessor :image_tokens + + # The number of text tokens in the input prompt. + sig { returns(Integer) } + attr_accessor :text_tokens + + # The input tokens detailed information for the image generation. + sig { params(image_tokens: Integer, text_tokens: Integer).returns(T.attached_class) } + def self.new(image_tokens:, text_tokens:); end + + sig { override.returns({image_tokens: Integer, text_tokens: Integer}) } + def to_hash; end + end + end end end end diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi new file mode 100644 index 00000000..2a08cbdb --- /dev/null +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryPartAddedEvent < OpenAI::Internal::Type::BaseModel + # The ID of the item this summary part is associated with. + sig { returns(String) } + attr_accessor :item_id + + # The index of the output item this summary part is associated with. + sig { returns(Integer) } + attr_accessor :output_index + + # The summary part that was added. + sig { returns(OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part) } + attr_reader :part + + sig do + params( + part: T.any(OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part, OpenAI::Internal::AnyHash) + ) + .void + end + attr_writer :part + + # The index of the summary part within the reasoning summary. + sig { returns(Integer) } + attr_accessor :summary_index + + # The type of the event. Always `response.reasoning_summary_part.added`. + sig { returns(Symbol) } + attr_accessor :type + + # Emitted when a new reasoning summary part is added. + sig do + params( + item_id: String, + output_index: Integer, + part: T.any(OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part, OpenAI::Internal::AnyHash), + summary_index: Integer, + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + item_id:, + output_index:, + part:, + summary_index:, + type: :"response.reasoning_summary_part.added" + ) + end + + sig do + override + .returns( + { + item_id: String, + output_index: Integer, + part: OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part, + summary_index: Integer, + type: Symbol + } + ) + end + def to_hash; end + + class Part < OpenAI::Internal::Type::BaseModel + # The text of the summary part. + sig { returns(String) } + attr_accessor :text + + # The type of the summary part. Always `summary_text`. + sig { returns(Symbol) } + attr_accessor :type + + # The summary part that was added. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :summary_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + end + end + end +end diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi new file mode 100644 index 00000000..074c9319 --- /dev/null +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryPartDoneEvent < OpenAI::Internal::Type::BaseModel + # The ID of the item this summary part is associated with. + sig { returns(String) } + attr_accessor :item_id + + # The index of the output item this summary part is associated with. + sig { returns(Integer) } + attr_accessor :output_index + + # The completed summary part. + sig { returns(OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part) } + attr_reader :part + + sig do + params( + part: T.any(OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part, OpenAI::Internal::AnyHash) + ) + .void + end + attr_writer :part + + # The index of the summary part within the reasoning summary. + sig { returns(Integer) } + attr_accessor :summary_index + + # The type of the event. Always `response.reasoning_summary_part.done`. + sig { returns(Symbol) } + attr_accessor :type + + # Emitted when a reasoning summary part is completed. + sig do + params( + item_id: String, + output_index: Integer, + part: T.any(OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part, OpenAI::Internal::AnyHash), + summary_index: Integer, + type: Symbol + ) + .returns(T.attached_class) + end + def self.new( + item_id:, + output_index:, + part:, + summary_index:, + type: :"response.reasoning_summary_part.done" + ) + end + + sig do + override + .returns( + { + item_id: String, + output_index: Integer, + part: OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part, + summary_index: Integer, + type: Symbol + } + ) + end + def to_hash; end + + class Part < OpenAI::Internal::Type::BaseModel + # The text of the summary part. + sig { returns(String) } + attr_accessor :text + + # The type of the summary part. Always `summary_text`. + sig { returns(Symbol) } + attr_accessor :type + + # The completed summary part. + sig { params(text: String, type: Symbol).returns(T.attached_class) } + def self.new(text:, type: :summary_text); end + + sig { override.returns({text: String, type: Symbol}) } + def to_hash; end + end + end + end + end +end diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi new file mode 100644 index 00000000..e659c052 --- /dev/null +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryTextDeltaEvent < OpenAI::Internal::Type::BaseModel + # The text delta that was added to the summary. + sig { returns(String) } + attr_accessor :delta + + # The ID of the item this summary text delta is associated with. + sig { returns(String) } + attr_accessor :item_id + + # The index of the output item this summary text delta is associated with. + sig { returns(Integer) } + attr_accessor :output_index + + # The index of the summary part within the reasoning summary. + sig { returns(Integer) } + attr_accessor :summary_index + + # The type of the event. Always `response.reasoning_summary_text.delta`. + sig { returns(Symbol) } + attr_accessor :type + + # Emitted when a delta is added to a reasoning summary text. + sig do + params(delta: String, item_id: String, output_index: Integer, summary_index: Integer, type: Symbol) + .returns(T.attached_class) + end + def self.new( + delta:, + item_id:, + output_index:, + summary_index:, + type: :"response.reasoning_summary_text.delta" + ) + end + + sig do + override + .returns({ + delta: String, + item_id: String, + output_index: Integer, + summary_index: Integer, + type: Symbol + }) + end + def to_hash; end + end + end + end +end diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi new file mode 100644 index 00000000..dea35ce6 --- /dev/null +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module OpenAI + module Models + module Responses + class ResponseReasoningSummaryTextDoneEvent < OpenAI::Internal::Type::BaseModel + # The ID of the item this summary text is associated with. + sig { returns(String) } + attr_accessor :item_id + + # The index of the output item this summary text is associated with. + sig { returns(Integer) } + attr_accessor :output_index + + # The index of the summary part within the reasoning summary. + sig { returns(Integer) } + attr_accessor :summary_index + + # The full text of the completed reasoning summary. + sig { returns(String) } + attr_accessor :text + + # The type of the event. Always `response.reasoning_summary_text.done`. + sig { returns(Symbol) } + attr_accessor :type + + # Emitted when a reasoning summary text is completed. + sig do + params(item_id: String, output_index: Integer, summary_index: Integer, text: String, type: Symbol) + .returns(T.attached_class) + end + def self.new( + item_id:, + output_index:, + summary_index:, + text:, + type: :"response.reasoning_summary_text.done" + ) + end + + sig do + override + .returns({ + item_id: String, + output_index: Integer, + summary_index: Integer, + text: String, + type: Symbol + }) + end + def to_hash; end + end + end + end +end diff --git a/rbi/lib/openai/models/responses/response_stream_event.rbi b/rbi/lib/openai/models/responses/response_stream_event.rbi index 2df75056..6234c3c6 100644 --- a/rbi/lib/openai/models/responses/response_stream_event.rbi +++ b/rbi/lib/openai/models/responses/response_stream_event.rbi @@ -10,7 +10,7 @@ module OpenAI sig do override .returns( - [OpenAI::Models::Responses::ResponseAudioDeltaEvent, OpenAI::Models::Responses::ResponseAudioDoneEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent, OpenAI::Models::Responses::ResponseCompletedEvent, OpenAI::Models::Responses::ResponseContentPartAddedEvent, OpenAI::Models::Responses::ResponseContentPartDoneEvent, OpenAI::Models::Responses::ResponseCreatedEvent, OpenAI::Models::Responses::ResponseErrorEvent, OpenAI::Models::Responses::ResponseFileSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseFileSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseFileSearchCallSearchingEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Responses::ResponseInProgressEvent, OpenAI::Models::Responses::ResponseFailedEvent, OpenAI::Models::Responses::ResponseIncompleteEvent, OpenAI::Models::Responses::ResponseOutputItemAddedEvent, OpenAI::Models::Responses::ResponseOutputItemDoneEvent, OpenAI::Models::Responses::ResponseRefusalDeltaEvent, OpenAI::Models::Responses::ResponseRefusalDoneEvent, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent, OpenAI::Models::Responses::ResponseTextDeltaEvent, OpenAI::Models::Responses::ResponseTextDoneEvent, OpenAI::Models::Responses::ResponseWebSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseWebSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent] + [OpenAI::Models::Responses::ResponseAudioDeltaEvent, OpenAI::Models::Responses::ResponseAudioDoneEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent, OpenAI::Models::Responses::ResponseCompletedEvent, OpenAI::Models::Responses::ResponseContentPartAddedEvent, OpenAI::Models::Responses::ResponseContentPartDoneEvent, OpenAI::Models::Responses::ResponseCreatedEvent, OpenAI::Models::Responses::ResponseErrorEvent, OpenAI::Models::Responses::ResponseFileSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseFileSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseFileSearchCallSearchingEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Responses::ResponseInProgressEvent, OpenAI::Models::Responses::ResponseFailedEvent, OpenAI::Models::Responses::ResponseIncompleteEvent, OpenAI::Models::Responses::ResponseOutputItemAddedEvent, OpenAI::Models::Responses::ResponseOutputItemDoneEvent, OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent, OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent, OpenAI::Models::Responses::ResponseReasoningSummaryTextDeltaEvent, OpenAI::Models::Responses::ResponseReasoningSummaryTextDoneEvent, OpenAI::Models::Responses::ResponseRefusalDeltaEvent, OpenAI::Models::Responses::ResponseRefusalDoneEvent, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent, OpenAI::Models::Responses::ResponseTextDeltaEvent, OpenAI::Models::Responses::ResponseTextDoneEvent, OpenAI::Models::Responses::ResponseWebSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseWebSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent] ) end def self.variants; end diff --git a/rbi/lib/openai/resources/evals.rbi b/rbi/lib/openai/resources/evals.rbi index f7fb72d2..ccf5a9f3 100644 --- a/rbi/lib/openai/resources/evals.rbi +++ b/rbi/lib/openai/resources/evals.rbi @@ -16,19 +16,20 @@ module OpenAI data_source_config: T.any( OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Internal::AnyHash, - OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions + OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs ), testing_criteria: T::Array[ T.any( OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Internal::AnyHash, OpenAI::Models::EvalStringCheckGrader, - OpenAI::Models::EvalTextSimilarityGrader + OpenAI::Models::EvalTextSimilarityGrader, + OpenAI::Models::EvalCreateParams::TestingCriterion::Python, + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel ) ], metadata: T.nilable(T::Hash[Symbol, String]), name: String, - share_with_openai: T::Boolean, request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) ) .returns(OpenAI::Models::EvalCreateResponse) @@ -47,8 +48,6 @@ module OpenAI metadata: nil, # The name of the evaluation. name: nil, - # Indicates whether the evaluation is shared with OpenAI. - share_with_openai: nil, request_options: {} ); end # Get an evaluation by ID. diff --git a/rbi/lib/openai/resources/evals/runs.rbi b/rbi/lib/openai/resources/evals/runs.rbi index d49a538a..014d5734 100644 --- a/rbi/lib/openai/resources/evals/runs.rbi +++ b/rbi/lib/openai/resources/evals/runs.rbi @@ -14,7 +14,8 @@ module OpenAI data_source: T.any( OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Internal::AnyHash, - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, @@ -76,8 +77,8 @@ module OpenAI # Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for # descending order. Defaults to `asc`. order: nil, - # Filter runs by status. Use "queued" | "in_progress" | "failed" | "completed" | - # "canceled". + # Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # | `canceled`. status: nil, request_options: {} ); end diff --git a/rbi/lib/openai/resources/fine_tuning/checkpoints/permissions.rbi b/rbi/lib/openai/resources/fine_tuning/checkpoints/permissions.rbi index 0d9761de..64fb5a6a 100644 --- a/rbi/lib/openai/resources/fine_tuning/checkpoints/permissions.rbi +++ b/rbi/lib/openai/resources/fine_tuning/checkpoints/permissions.rbi @@ -58,14 +58,17 @@ module OpenAI # fine-tuned model checkpoint. sig do params( + permission_id: String, fine_tuned_model_checkpoint: String, request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) ) .returns(OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteResponse) end def delete( + # The ID of the fine-tuned model checkpoint permission to delete. + permission_id, # The ID of the fine-tuned model checkpoint to delete a permission for. - fine_tuned_model_checkpoint, + fine_tuned_model_checkpoint:, request_options: {} ); end # @api private diff --git a/rbi/lib/openai/resources/images.rbi b/rbi/lib/openai/resources/images.rbi index 04c126f2..7e97700a 100644 --- a/rbi/lib/openai/resources/images.rbi +++ b/rbi/lib/openai/resources/images.rbi @@ -3,7 +3,7 @@ module OpenAI module Resources class Images - # Creates a variation of a given image. + # Creates a variation of a given image. This endpoint only supports `dall-e-2`. sig do params( image: T.any(Pathname, StringIO), @@ -23,8 +23,7 @@ module OpenAI # The model to use for image generation. Only `dall-e-2` is supported at this # time. model: nil, - # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only - # `n=1` is supported. + # The number of images to generate. Must be between 1 and 10. n: nil, # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been @@ -39,14 +38,16 @@ module OpenAI user: nil, request_options: {} ); end - # Creates an edited or extended image given an original image and a prompt. + # Creates an edited or extended image given one or more source images and a + # prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`. sig do params( - image: T.any(Pathname, StringIO), + image: T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)]), prompt: String, mask: T.any(Pathname, StringIO), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), + quality: T.nilable(OpenAI::Models::ImageEditParams::Quality::OrSymbol), response_format: T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol), user: String, @@ -55,27 +56,37 @@ module OpenAI .returns(OpenAI::Models::ImagesResponse) end def edit( - # The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask - # is not provided, image must have transparency, which will be used as the mask. + # The image(s) to edit. Must be a supported image file or an array of images. For + # `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square + # `png` file less than 4MB. image:, # A text description of the desired image(s). The maximum length is 1000 - # characters. + # characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. prompt:, # An additional image whose fully transparent areas (e.g. where alpha is zero) - # indicate where `image` should be edited. Must be a valid PNG file, less than + # indicate where `image` should be edited. If there are multiple images provided, + # the mask will be applied on the first image. Must be a valid PNG file, less than # 4MB, and have the same dimensions as `image`. mask: nil, - # The model to use for image generation. Only `dall-e-2` is supported at this - # time. + # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are + # supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` + # is used. model: nil, # The number of images to generate. Must be between 1 and 10. n: nil, + # The quality of the image that will be generated. `high`, `medium` and `low` are + # only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. + # Defaults to `auto`. + quality: nil, # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` + # will always return base64-encoded images. response_format: nil, - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024`. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. size: nil, # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. @@ -84,12 +95,17 @@ module OpenAI request_options: {} ); end # Creates an image given a prompt. + # [Learn more](https://platform.openai.com/docs/guides/images). sig do params( prompt: String, + background: T.nilable(OpenAI::Models::ImageGenerateParams::Background::OrSymbol), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), + moderation: T.nilable(OpenAI::Models::ImageGenerateParams::Moderation::OrSymbol), n: T.nilable(Integer), - quality: OpenAI::Models::ImageGenerateParams::Quality::OrSymbol, + output_compression: T.nilable(Integer), + output_format: T.nilable(OpenAI::Models::ImageGenerateParams::OutputFormat::OrSymbol), + quality: T.nilable(OpenAI::Models::ImageGenerateParams::Quality::OrSymbol), response_format: T.nilable(OpenAI::Models::ImageGenerateParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol), style: T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol), @@ -99,30 +115,57 @@ module OpenAI .returns(OpenAI::Models::ImagesResponse) end def generate( - # A text description of the desired image(s). The maximum length is 1000 - # characters for `dall-e-2` and 4000 characters for `dall-e-3`. + # A text description of the desired image(s). The maximum length is 32000 + # characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters + # for `dall-e-3`. prompt:, - # The model to use for image generation. + # Allows to set transparency for the background of the generated image(s). This + # parameter is only supported for `gpt-image-1`. Must be one of `transparent`, + # `opaque` or `auto` (default value). When `auto` is used, the model will + # automatically determine the best background for the image. + # + # If `transparent`, the output format needs to support transparency, so it should + # be set to either `png` (default value) or `webp`. + background: nil, + # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or + # `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to + # `gpt-image-1` is used. model: nil, + # Control the content-moderation level for images generated by `gpt-image-1`. Must + # be either `low` for less restrictive filtering or `auto` (default value). + moderation: nil, # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only # `n=1` is supported. n: nil, - # The quality of the image that will be generated. `hd` creates images with finer - # details and greater consistency across the image. This param is only supported - # for `dall-e-3`. + # The compression level (0-100%) for the generated images. This parameter is only + # supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + # defaults to 100. + output_compression: nil, + # The format in which the generated images are returned. This parameter is only + # supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + output_format: nil, + # The quality of the image that will be generated. + # + # - `auto` (default value) will automatically select the best quality for the + # given model. + # - `high`, `medium` and `low` are supported for `gpt-image-1`. + # - `hd` and `standard` are supported for `dall-e-3`. + # - `standard` is the only option for `dall-e-2`. quality: nil, - # The format in which the generated images are returned. Must be one of `url` or - # `b64_json`. URLs are only valid for 60 minutes after the image has been - # generated. + # The format in which generated images with `dall-e-2` and `dall-e-3` are + # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes + # after the image has been generated. This parameter isn't supported for + # `gpt-image-1` which will always return base64-encoded images. response_format: nil, - # The size of the generated images. Must be one of `256x256`, `512x512`, or - # `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or - # `1024x1792` for `dall-e-3` models. + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and + # one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. size: nil, - # The style of the generated images. Must be one of `vivid` or `natural`. Vivid - # causes the model to lean towards generating hyper-real and dramatic images. - # Natural causes the model to produce more natural, less hyper-real looking - # images. This param is only supported for `dall-e-3`. + # The style of the generated images. This parameter is only supported for + # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean + # towards generating hyper-real and dramatic images. Natural causes the model to + # produce more natural, less hyper-real looking images. style: nil, # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. diff --git a/rbi/lib/openai/resources/responses.rbi b/rbi/lib/openai/resources/responses.rbi index c890608c..b67ed0d1 100644 --- a/rbi/lib/openai/resources/responses.rbi +++ b/rbi/lib/openai/resources/responses.rbi @@ -305,6 +305,10 @@ module OpenAI OpenAI::Models::Responses::ResponseIncompleteEvent, OpenAI::Models::Responses::ResponseOutputItemAddedEvent, OpenAI::Models::Responses::ResponseOutputItemDoneEvent, + OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent, + OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent, + OpenAI::Models::Responses::ResponseReasoningSummaryTextDeltaEvent, + OpenAI::Models::Responses::ResponseReasoningSummaryTextDoneEvent, OpenAI::Models::Responses::ResponseRefusalDeltaEvent, OpenAI::Models::Responses::ResponseRefusalDoneEvent, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent, diff --git a/sig/openai/models/beta/thread_create_and_run_params.rbs b/sig/openai/models/beta/thread_create_and_run_params.rbs index aeb818ab..67ca7b95 100644 --- a/sig/openai/models/beta/thread_create_and_run_params.rbs +++ b/sig/openai/models/beta/thread_create_and_run_params.rbs @@ -15,7 +15,7 @@ module OpenAI thread: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, tool_choice: OpenAI::Models::Beta::assistant_tool_choice_option?, tool_resources: OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources?, - tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::tool]?, + tools: ::Array[OpenAI::Models::Beta::assistant_tool]?, top_p: Float?, truncation_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy? } @@ -55,7 +55,7 @@ module OpenAI attr_accessor tool_resources: OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources? - attr_accessor tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::tool]? + attr_accessor tools: ::Array[OpenAI::Models::Beta::assistant_tool]? attr_accessor top_p: Float? @@ -74,7 +74,7 @@ module OpenAI ?thread: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, ?tool_choice: OpenAI::Models::Beta::assistant_tool_choice_option?, ?tool_resources: OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources?, - ?tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::tool]?, + ?tools: ::Array[OpenAI::Models::Beta::assistant_tool]?, ?top_p: Float?, ?truncation_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy?, ?request_options: OpenAI::request_opts @@ -417,17 +417,6 @@ module OpenAI end end - type tool = - OpenAI::Models::Beta::CodeInterpreterTool - | OpenAI::Models::Beta::FileSearchTool - | OpenAI::Models::Beta::FunctionTool - - module Tool - extend OpenAI::Internal::Type::Union - - def self?.variants: -> [OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool] - end - type truncation_strategy = { type: OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::type_, diff --git a/sig/openai/models/eval_create_params.rbs b/sig/openai/models/eval_create_params.rbs index 81c23475..09ba33d8 100644 --- a/sig/openai/models/eval_create_params.rbs +++ b/sig/openai/models/eval_create_params.rbs @@ -5,8 +5,7 @@ module OpenAI data_source_config: OpenAI::Models::EvalCreateParams::data_source_config, testing_criteria: ::Array[OpenAI::Models::EvalCreateParams::testing_criterion], metadata: OpenAI::Models::metadata?, - name: String, - share_with_openai: bool + name: String } & OpenAI::Internal::Type::request_parameters @@ -24,16 +23,11 @@ module OpenAI def name=: (String) -> String - attr_reader share_with_openai: bool? - - def share_with_openai=: (bool) -> bool - def initialize: ( data_source_config: OpenAI::Models::EvalCreateParams::data_source_config, testing_criteria: ::Array[OpenAI::Models::EvalCreateParams::testing_criterion], ?metadata: OpenAI::Models::metadata?, ?name: String, - ?share_with_openai: bool, ?request_options: OpenAI::request_opts ) -> void @@ -41,7 +35,7 @@ module OpenAI type data_source_config = OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom - | OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions + | OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs module DataSourceConfig extend OpenAI::Internal::Type::Union @@ -71,29 +65,29 @@ module OpenAI def to_hash: -> OpenAI::Models::EvalCreateParams::DataSourceConfig::custom end - type stored_completions = - { type: :stored_completions, metadata: OpenAI::Models::metadata? } + type logs = { type: :logs, metadata: ::Hash[Symbol, top] } - class StoredCompletions < OpenAI::Internal::Type::BaseModel - attr_accessor type: :stored_completions + class Logs < OpenAI::Internal::Type::BaseModel + attr_accessor type: :logs - attr_accessor metadata: OpenAI::Models::metadata? + attr_reader metadata: ::Hash[Symbol, top]? - def initialize: ( - ?metadata: OpenAI::Models::metadata?, - ?type: :stored_completions - ) -> void + def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: (?metadata: ::Hash[Symbol, top], ?type: :logs) -> void - def to_hash: -> OpenAI::Models::EvalCreateParams::DataSourceConfig::stored_completions + def to_hash: -> OpenAI::Models::EvalCreateParams::DataSourceConfig::logs end - def self?.variants: -> [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions] + def self?.variants: -> [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] end type testing_criterion = OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel | OpenAI::Models::EvalStringCheckGrader | OpenAI::Models::EvalTextSimilarityGrader + | OpenAI::Models::EvalCreateParams::TestingCriterion::Python + | OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel module TestingCriterion extend OpenAI::Internal::Type::Union @@ -134,8 +128,7 @@ module OpenAI type input = OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage - | OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage - | OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage + | OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem module Input extend OpenAI::Internal::Type::Union @@ -152,67 +145,66 @@ module OpenAI def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::simple_input_message end - type input_message = + type eval_item = { - content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content, - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::role, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::type_ + content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content, + role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::role, + type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::type_ } - class InputMessage < OpenAI::Internal::Type::BaseModel - attr_accessor content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content + class EvalItem < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content - attr_accessor role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::role + attr_accessor role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::role - attr_accessor type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::type_ + attr_reader type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::type_? + + def type=: ( + OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::type_ + ) -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::type_ def initialize: ( - content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content, - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::role, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::type_ + content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::content, + role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::role, + ?type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::type_ ) -> void - def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::input_message + def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::eval_item type content = - { - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::type_ - } - - class Content < OpenAI::Internal::Type::BaseModel - attr_accessor text: String + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText - attr_accessor type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::type_ + module Content + extend OpenAI::Internal::Type::Union - def initialize: ( - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::type_ - ) -> void + type output_text = { text: String, type: :output_text } - def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::content + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String - type type_ = :input_text + attr_accessor type: :output_text - module Type - extend OpenAI::Internal::Type::Enum + def initialize: (text: String, ?type: :output_text) -> void - INPUT_TEXT: :input_text - - def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::Content::type_] + def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::output_text end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText] end - type role = :user | :system | :developer + type role = :user | :assistant | :system | :developer module Role extend OpenAI::Internal::Type::Enum USER: :user + ASSISTANT: :assistant SYSTEM: :system DEVELOPER: :developer - def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::role] + def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::role] end type type_ = :message @@ -222,87 +214,168 @@ module OpenAI MESSAGE: :message - def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage::type_] + def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::type_] end end - type output_message = - { - content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content, - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::role, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::type_ - } + def self?.variants: -> [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem] + end + end - class OutputMessage < OpenAI::Internal::Type::BaseModel - attr_accessor content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content + type python = + { + name: String, + source: String, + type: :python, + image_tag: String, + pass_threshold: Float + } - attr_accessor role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::role + class Python < OpenAI::Internal::Type::BaseModel + attr_accessor name: String - attr_accessor type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::type_ + attr_accessor source: String - def initialize: ( - content: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content, - role: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::role, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::type_ - ) -> void + attr_accessor type: :python - def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::output_message + attr_reader image_tag: String? - type content = - { - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::type_ - } + def image_tag=: (String) -> String - class Content < OpenAI::Internal::Type::BaseModel - attr_accessor text: String + attr_reader pass_threshold: Float? - attr_accessor type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::type_ + def pass_threshold=: (Float) -> Float - def initialize: ( - text: String, - type: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::type_ - ) -> void + def initialize: ( + name: String, + source: String, + ?image_tag: String, + ?pass_threshold: Float, + ?type: :python + ) -> void - def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::content + def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::python + end - type type_ = :output_text + type score_model = + { + input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: :score_model, + pass_threshold: Float, + range: ::Array[Float], + sampling_params: top + } - module Type - extend OpenAI::Internal::Type::Enum + class ScoreModel < OpenAI::Internal::Type::BaseModel + attr_accessor input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input] - OUTPUT_TEXT: :output_text + attr_accessor model: String - def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::Content::type_] - end - end + attr_accessor name: String - type role = :assistant + attr_accessor type: :score_model - module Role - extend OpenAI::Internal::Type::Enum + attr_reader pass_threshold: Float? - ASSISTANT: :assistant + def pass_threshold=: (Float) -> Float - def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::role] - end + attr_reader range: ::Array[Float]? - type type_ = :message + def range=: (::Array[Float]) -> ::Array[Float] - module Type - extend OpenAI::Internal::Type::Enum + attr_reader sampling_params: top? - MESSAGE: :message + def sampling_params=: (top) -> top + + def initialize: ( + input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + ?pass_threshold: Float, + ?range: ::Array[Float], + ?sampling_params: top, + ?type: :score_model + ) -> void + + def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::score_model + + type input = + { + content: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::role, + type: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::type_ + } + + class Input < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::content + + attr_accessor role: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::role + + attr_reader type: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::type_? + + def type=: ( + OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::type_ + ) -> OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::type_ + + def initialize: ( + content: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::role, + ?type: OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::type_ + ) -> void - def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage::type_] + def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::input + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: (text: String, ?type: :output_text) -> void + + def to_hash: -> OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::output_text end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText] end - def self?.variants: -> [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::SimpleInputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::InputMessage, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::OutputMessage] + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::type_] + end end end - def self?.variants: -> [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + def self?.variants: -> [OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalCreateParams::TestingCriterion::Python, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel] end end end diff --git a/sig/openai/models/eval_create_response.rbs b/sig/openai/models/eval_create_response.rbs index 91552ac6..8ff0e39f 100644 --- a/sig/openai/models/eval_create_response.rbs +++ b/sig/openai/models/eval_create_response.rbs @@ -8,7 +8,6 @@ module OpenAI metadata: OpenAI::Models::metadata?, name: String, object: :eval, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalCreateResponse::testing_criterion] } @@ -25,8 +24,6 @@ module OpenAI attr_accessor object: :eval - attr_accessor share_with_openai: bool - attr_accessor testing_criteria: ::Array[OpenAI::Models::EvalCreateResponse::testing_criterion] def initialize: ( @@ -35,7 +32,6 @@ module OpenAI data_source_config: OpenAI::Models::EvalCreateResponse::data_source_config, metadata: OpenAI::Models::metadata?, name: String, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalCreateResponse::testing_criterion], ?object: :eval ) -> void @@ -56,11 +52,166 @@ module OpenAI OpenAI::Models::EvalLabelModelGrader | OpenAI::Models::EvalStringCheckGrader | OpenAI::Models::EvalTextSimilarityGrader + | OpenAI::Models::EvalCreateResponse::TestingCriterion::Python + | OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel module TestingCriterion extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + type python = + { + name: String, + source: String, + type: :python, + image_tag: String, + pass_threshold: Float + } + + class Python < OpenAI::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor source: String + + attr_accessor type: :python + + attr_reader image_tag: String? + + def image_tag=: (String) -> String + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + def initialize: ( + name: String, + source: String, + ?image_tag: String, + ?pass_threshold: Float, + ?type: :python + ) -> void + + def to_hash: -> OpenAI::Models::EvalCreateResponse::TestingCriterion::python + end + + type score_model = + { + input: ::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: :score_model, + pass_threshold: Float, + range: ::Array[Float], + sampling_params: top + } + + class ScoreModel < OpenAI::Internal::Type::BaseModel + attr_accessor input: ::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input] + + attr_accessor model: String + + attr_accessor name: String + + attr_accessor type: :score_model + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + attr_reader range: ::Array[Float]? + + def range=: (::Array[Float]) -> ::Array[Float] + + attr_reader sampling_params: top? + + def sampling_params=: (top) -> top + + def initialize: ( + input: ::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + ?pass_threshold: Float, + ?range: ::Array[Float], + ?sampling_params: top, + ?type: :score_model + ) -> void + + def to_hash: -> OpenAI::Models::EvalCreateResponse::TestingCriterion::score_model + + type input = + { + content: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::role, + type: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::type_ + } + + class Input < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::content + + attr_accessor role: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::role + + attr_reader type: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::type_? + + def type=: ( + OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::type_ + + def initialize: ( + content: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::role, + ?type: OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> void + + def to_hash: -> OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::input + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: (text: String, ?type: :output_text) -> void + + def to_hash: -> OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::type_] + end + end + end + + def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalCreateResponse::TestingCriterion::Python, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel] end end end diff --git a/sig/openai/models/eval_label_model_grader.rbs b/sig/openai/models/eval_label_model_grader.rbs index af0c4a5f..dab1b730 100644 --- a/sig/openai/models/eval_label_model_grader.rbs +++ b/sig/openai/models/eval_label_model_grader.rbs @@ -2,7 +2,7 @@ module OpenAI module Models type eval_label_model_grader = { - input: ::Array[OpenAI::Models::EvalLabelModelGrader::input], + input: ::Array[OpenAI::Models::EvalLabelModelGrader::Input], labels: ::Array[String], model: String, name: String, @@ -11,7 +11,7 @@ module OpenAI } class EvalLabelModelGrader < OpenAI::Internal::Type::BaseModel - attr_accessor input: ::Array[OpenAI::Models::EvalLabelModelGrader::input] + attr_accessor input: ::Array[OpenAI::Models::EvalLabelModelGrader::Input] attr_accessor labels: ::Array[String] @@ -24,7 +24,7 @@ module OpenAI attr_accessor type: :label_model def initialize: ( - input: ::Array[OpenAI::Models::EvalLabelModelGrader::input], + input: ::Array[OpenAI::Models::EvalLabelModelGrader::Input], labels: ::Array[String], model: String, name: String, @@ -35,149 +35,76 @@ module OpenAI def to_hash: -> OpenAI::Models::eval_label_model_grader type input = - OpenAI::Models::EvalLabelModelGrader::Input::Assistant - | OpenAI::Models::EvalLabelModelGrader::Input::InputMessage + { + content: OpenAI::Models::EvalLabelModelGrader::Input::content, + role: OpenAI::Models::EvalLabelModelGrader::Input::role, + type: OpenAI::Models::EvalLabelModelGrader::Input::type_ + } - module Input - extend OpenAI::Internal::Type::Union + class Input < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::EvalLabelModelGrader::Input::content - type input_message = - { - content: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content, - role: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::role, - type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::type_ - } + attr_accessor role: OpenAI::Models::EvalLabelModelGrader::Input::role - class InputMessage < OpenAI::Internal::Type::BaseModel - attr_accessor content: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content + attr_reader type: OpenAI::Models::EvalLabelModelGrader::Input::type_? - attr_accessor role: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::role + def type=: ( + OpenAI::Models::EvalLabelModelGrader::Input::type_ + ) -> OpenAI::Models::EvalLabelModelGrader::Input::type_ - attr_accessor type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::type_ + def initialize: ( + content: OpenAI::Models::EvalLabelModelGrader::Input::content, + role: OpenAI::Models::EvalLabelModelGrader::Input::role, + ?type: OpenAI::Models::EvalLabelModelGrader::Input::type_ + ) -> void - def initialize: ( - content: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content, - role: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::role, - type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::type_ - ) -> void + def to_hash: -> OpenAI::Models::EvalLabelModelGrader::input - def to_hash: -> OpenAI::Models::EvalLabelModelGrader::Input::input_message + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText - type content = - { - text: String, - type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::type_ - } + module Content + extend OpenAI::Internal::Type::Union - class Content < OpenAI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::type_ - - def initialize: ( - text: String, - type: OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::type_ - ) -> void - - def to_hash: -> OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::content + type output_text = { text: String, type: :output_text } - type type_ = :input_text - - module Type - extend OpenAI::Internal::Type::Enum - - INPUT_TEXT: :input_text - - def self?.values: -> ::Array[OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::Content::type_] - end - end - - type role = :user | :system | :developer + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String - module Role - extend OpenAI::Internal::Type::Enum + attr_accessor type: :output_text - USER: :user - SYSTEM: :system - DEVELOPER: :developer + def initialize: (text: String, ?type: :output_text) -> void - def self?.values: -> ::Array[OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::role] + def to_hash: -> OpenAI::Models::EvalLabelModelGrader::Input::Content::output_text end - type type_ = :message - - module Type - extend OpenAI::Internal::Type::Enum - - MESSAGE: :message - - def self?.values: -> ::Array[OpenAI::Models::EvalLabelModelGrader::Input::InputMessage::type_] - end + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText] end - type assistant = - { - content: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content, - role: :assistant, - type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::type_ - } - - class Assistant < OpenAI::Internal::Type::BaseModel - attr_accessor content: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content + type role = :user | :assistant | :system | :developer - attr_accessor role: :assistant + module Role + extend OpenAI::Internal::Type::Enum - attr_accessor type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::type_ + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer - def initialize: ( - content: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content, - type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::type_, - ?role: :assistant - ) -> void - - def to_hash: -> OpenAI::Models::EvalLabelModelGrader::Input::assistant - - type content = - { - text: String, - type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::type_ - } - - class Content < OpenAI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::type_ - - def initialize: ( - text: String, - type: OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::type_ - ) -> void - - def to_hash: -> OpenAI::Models::EvalLabelModelGrader::Input::Assistant::content - - type type_ = :output_text - - module Type - extend OpenAI::Internal::Type::Enum - - OUTPUT_TEXT: :output_text - - def self?.values: -> ::Array[OpenAI::Models::EvalLabelModelGrader::Input::Assistant::Content::type_] - end - end + def self?.values: -> ::Array[OpenAI::Models::EvalLabelModelGrader::Input::role] + end - type type_ = :message + type type_ = :message - module Type - extend OpenAI::Internal::Type::Enum + module Type + extend OpenAI::Internal::Type::Enum - MESSAGE: :message + MESSAGE: :message - def self?.values: -> ::Array[OpenAI::Models::EvalLabelModelGrader::Input::Assistant::type_] - end + def self?.values: -> ::Array[OpenAI::Models::EvalLabelModelGrader::Input::type_] end - - def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader::Input::Assistant, OpenAI::Models::EvalLabelModelGrader::Input::InputMessage] end end end diff --git a/sig/openai/models/eval_list_response.rbs b/sig/openai/models/eval_list_response.rbs index 25f5a62c..f7a1047b 100644 --- a/sig/openai/models/eval_list_response.rbs +++ b/sig/openai/models/eval_list_response.rbs @@ -8,7 +8,6 @@ module OpenAI metadata: OpenAI::Models::metadata?, name: String, object: :eval, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalListResponse::testing_criterion] } @@ -25,8 +24,6 @@ module OpenAI attr_accessor object: :eval - attr_accessor share_with_openai: bool - attr_accessor testing_criteria: ::Array[OpenAI::Models::EvalListResponse::testing_criterion] def initialize: ( @@ -35,7 +32,6 @@ module OpenAI data_source_config: OpenAI::Models::EvalListResponse::data_source_config, metadata: OpenAI::Models::metadata?, name: String, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalListResponse::testing_criterion], ?object: :eval ) -> void @@ -56,11 +52,166 @@ module OpenAI OpenAI::Models::EvalLabelModelGrader | OpenAI::Models::EvalStringCheckGrader | OpenAI::Models::EvalTextSimilarityGrader + | OpenAI::Models::EvalListResponse::TestingCriterion::Python + | OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel module TestingCriterion extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + type python = + { + name: String, + source: String, + type: :python, + image_tag: String, + pass_threshold: Float + } + + class Python < OpenAI::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor source: String + + attr_accessor type: :python + + attr_reader image_tag: String? + + def image_tag=: (String) -> String + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + def initialize: ( + name: String, + source: String, + ?image_tag: String, + ?pass_threshold: Float, + ?type: :python + ) -> void + + def to_hash: -> OpenAI::Models::EvalListResponse::TestingCriterion::python + end + + type score_model = + { + input: ::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: :score_model, + pass_threshold: Float, + range: ::Array[Float], + sampling_params: top + } + + class ScoreModel < OpenAI::Internal::Type::BaseModel + attr_accessor input: ::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input] + + attr_accessor model: String + + attr_accessor name: String + + attr_accessor type: :score_model + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + attr_reader range: ::Array[Float]? + + def range=: (::Array[Float]) -> ::Array[Float] + + attr_reader sampling_params: top? + + def sampling_params=: (top) -> top + + def initialize: ( + input: ::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + ?pass_threshold: Float, + ?range: ::Array[Float], + ?sampling_params: top, + ?type: :score_model + ) -> void + + def to_hash: -> OpenAI::Models::EvalListResponse::TestingCriterion::score_model + + type input = + { + content: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::role, + type: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::type_ + } + + class Input < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::content + + attr_accessor role: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::role + + attr_reader type: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::type_? + + def type=: ( + OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::type_ + + def initialize: ( + content: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::role, + ?type: OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> void + + def to_hash: -> OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::input + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: (text: String, ?type: :output_text) -> void + + def to_hash: -> OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::type_] + end + end + end + + def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalListResponse::TestingCriterion::Python, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel] end end end diff --git a/sig/openai/models/eval_retrieve_response.rbs b/sig/openai/models/eval_retrieve_response.rbs index 39e82c42..b354045c 100644 --- a/sig/openai/models/eval_retrieve_response.rbs +++ b/sig/openai/models/eval_retrieve_response.rbs @@ -8,7 +8,6 @@ module OpenAI metadata: OpenAI::Models::metadata?, name: String, object: :eval, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalRetrieveResponse::testing_criterion] } @@ -25,8 +24,6 @@ module OpenAI attr_accessor object: :eval - attr_accessor share_with_openai: bool - attr_accessor testing_criteria: ::Array[OpenAI::Models::EvalRetrieveResponse::testing_criterion] def initialize: ( @@ -35,7 +32,6 @@ module OpenAI data_source_config: OpenAI::Models::EvalRetrieveResponse::data_source_config, metadata: OpenAI::Models::metadata?, name: String, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalRetrieveResponse::testing_criterion], ?object: :eval ) -> void @@ -56,11 +52,166 @@ module OpenAI OpenAI::Models::EvalLabelModelGrader | OpenAI::Models::EvalStringCheckGrader | OpenAI::Models::EvalTextSimilarityGrader + | OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python + | OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel module TestingCriterion extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + type python = + { + name: String, + source: String, + type: :python, + image_tag: String, + pass_threshold: Float + } + + class Python < OpenAI::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor source: String + + attr_accessor type: :python + + attr_reader image_tag: String? + + def image_tag=: (String) -> String + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + def initialize: ( + name: String, + source: String, + ?image_tag: String, + ?pass_threshold: Float, + ?type: :python + ) -> void + + def to_hash: -> OpenAI::Models::EvalRetrieveResponse::TestingCriterion::python + end + + type score_model = + { + input: ::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: :score_model, + pass_threshold: Float, + range: ::Array[Float], + sampling_params: top + } + + class ScoreModel < OpenAI::Internal::Type::BaseModel + attr_accessor input: ::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input] + + attr_accessor model: String + + attr_accessor name: String + + attr_accessor type: :score_model + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + attr_reader range: ::Array[Float]? + + def range=: (::Array[Float]) -> ::Array[Float] + + attr_reader sampling_params: top? + + def sampling_params=: (top) -> top + + def initialize: ( + input: ::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + ?pass_threshold: Float, + ?range: ::Array[Float], + ?sampling_params: top, + ?type: :score_model + ) -> void + + def to_hash: -> OpenAI::Models::EvalRetrieveResponse::TestingCriterion::score_model + + type input = + { + content: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::role, + type: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::type_ + } + + class Input < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::content + + attr_accessor role: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::role + + attr_reader type: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::type_? + + def type=: ( + OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::type_ + + def initialize: ( + content: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::role, + ?type: OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> void + + def to_hash: -> OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::input + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: (text: String, ?type: :output_text) -> void + + def to_hash: -> OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::type_] + end + end + end + + def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::Python, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel] end end end diff --git a/sig/openai/models/eval_text_similarity_grader.rbs b/sig/openai/models/eval_text_similarity_grader.rbs index 7b15ca88..98059580 100644 --- a/sig/openai/models/eval_text_similarity_grader.rbs +++ b/sig/openai/models/eval_text_similarity_grader.rbs @@ -47,7 +47,6 @@ module OpenAI | :rouge_4 | :rouge_5 | :rouge_l - | :cosine module EvaluationMetric extend OpenAI::Internal::Type::Enum @@ -62,7 +61,6 @@ module OpenAI ROUGE_4: :rouge_4 ROUGE_5: :rouge_5 ROUGE_L: :rouge_l - COSINE: :cosine def self?.values: -> ::Array[OpenAI::Models::EvalTextSimilarityGrader::evaluation_metric] end diff --git a/sig/openai/models/eval_update_response.rbs b/sig/openai/models/eval_update_response.rbs index 6aad41bb..2cc7f800 100644 --- a/sig/openai/models/eval_update_response.rbs +++ b/sig/openai/models/eval_update_response.rbs @@ -8,7 +8,6 @@ module OpenAI metadata: OpenAI::Models::metadata?, name: String, object: :eval, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalUpdateResponse::testing_criterion] } @@ -25,8 +24,6 @@ module OpenAI attr_accessor object: :eval - attr_accessor share_with_openai: bool - attr_accessor testing_criteria: ::Array[OpenAI::Models::EvalUpdateResponse::testing_criterion] def initialize: ( @@ -35,7 +32,6 @@ module OpenAI data_source_config: OpenAI::Models::EvalUpdateResponse::data_source_config, metadata: OpenAI::Models::metadata?, name: String, - share_with_openai: bool, testing_criteria: ::Array[OpenAI::Models::EvalUpdateResponse::testing_criterion], ?object: :eval ) -> void @@ -56,11 +52,166 @@ module OpenAI OpenAI::Models::EvalLabelModelGrader | OpenAI::Models::EvalStringCheckGrader | OpenAI::Models::EvalTextSimilarityGrader + | OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python + | OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel module TestingCriterion extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader] + type python = + { + name: String, + source: String, + type: :python, + image_tag: String, + pass_threshold: Float + } + + class Python < OpenAI::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor source: String + + attr_accessor type: :python + + attr_reader image_tag: String? + + def image_tag=: (String) -> String + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + def initialize: ( + name: String, + source: String, + ?image_tag: String, + ?pass_threshold: Float, + ?type: :python + ) -> void + + def to_hash: -> OpenAI::Models::EvalUpdateResponse::TestingCriterion::python + end + + type score_model = + { + input: ::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + type: :score_model, + pass_threshold: Float, + range: ::Array[Float], + sampling_params: top + } + + class ScoreModel < OpenAI::Internal::Type::BaseModel + attr_accessor input: ::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input] + + attr_accessor model: String + + attr_accessor name: String + + attr_accessor type: :score_model + + attr_reader pass_threshold: Float? + + def pass_threshold=: (Float) -> Float + + attr_reader range: ::Array[Float]? + + def range=: (::Array[Float]) -> ::Array[Float] + + attr_reader sampling_params: top? + + def sampling_params=: (top) -> top + + def initialize: ( + input: ::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input], + model: String, + name: String, + ?pass_threshold: Float, + ?range: ::Array[Float], + ?sampling_params: top, + ?type: :score_model + ) -> void + + def to_hash: -> OpenAI::Models::EvalUpdateResponse::TestingCriterion::score_model + + type input = + { + content: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::role, + type: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::type_ + } + + class Input < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::content + + attr_accessor role: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::role + + attr_reader type: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::type_? + + def type=: ( + OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::type_ + + def initialize: ( + content: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::content, + role: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::role, + ?type: OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::type_ + ) -> void + + def to_hash: -> OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::input + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: (text: String, ?type: :output_text) -> void + + def to_hash: -> OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::type_] + end + end + end + + def self?.variants: -> [OpenAI::Models::EvalLabelModelGrader, OpenAI::Models::EvalStringCheckGrader, OpenAI::Models::EvalTextSimilarityGrader, OpenAI::Models::EvalUpdateResponse::TestingCriterion::Python, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel] end end end diff --git a/sig/openai/models/evals/create_eval_completions_run_data_source.rbs b/sig/openai/models/evals/create_eval_completions_run_data_source.rbs index de1f4c07..bbe22adb 100644 --- a/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +++ b/sig/openai/models/evals/create_eval_completions_run_data_source.rbs @@ -3,22 +3,28 @@ module OpenAI module Evals type create_eval_completions_run_data_source = { - input_messages: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages, - model: String, source: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::source, type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::type_, + input_messages: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages, + model: String, sampling_params: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams } class CreateEvalCompletionsRunDataSource < OpenAI::Internal::Type::BaseModel - attr_accessor input_messages: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages - - attr_accessor model: String - attr_accessor source: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::source attr_accessor type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::type_ + attr_reader input_messages: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages? + + def input_messages=: ( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages + ) -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages + + attr_reader model: String? + + def model=: (String) -> String + attr_reader sampling_params: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams? def sampling_params=: ( @@ -26,193 +32,212 @@ module OpenAI ) -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams def initialize: ( - input_messages: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages, - model: String, source: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::source, type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::type_, + ?input_messages: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::input_messages, + ?model: String, ?sampling_params: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams ) -> void def to_hash: -> OpenAI::Models::Evals::create_eval_completions_run_data_source - type input_messages = - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template - | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference + type source = + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent + | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID + | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions - module InputMessages + module Source extend OpenAI::Internal::Type::Union - type template = + type file_content = { - template: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::template], - type: :template + content: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content], + type: :file_content } - class Template < OpenAI::Internal::Type::BaseModel - attr_accessor template: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::template] + class FileContent < OpenAI::Internal::Type::BaseModel + attr_accessor content: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content] - attr_accessor type: :template + attr_accessor type: :file_content def initialize: ( - template: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::template], - ?type: :template + content: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content], + ?type: :file_content ) -> void - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::template + def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::file_content - type template = - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage - | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage - | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage + type content = + { item: ::Hash[Symbol, top], sample: ::Hash[Symbol, top] } - module Template - extend OpenAI::Internal::Type::Union + class Content < OpenAI::Internal::Type::BaseModel + attr_accessor item: ::Hash[Symbol, top] - type chat_message = { content: String, role: String } + attr_reader sample: ::Hash[Symbol, top]? - class ChatMessage < OpenAI::Internal::Type::BaseModel - attr_accessor content: String + def sample=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - attr_accessor role: String + def initialize: ( + item: ::Hash[Symbol, top], + ?sample: ::Hash[Symbol, top] + ) -> void - def initialize: (content: String, role: String) -> void + def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::content + end + end - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::chat_message - end + type file_id = { id: String, type: :file_id } - type input_message = - { - content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content, - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::role, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::type_ - } + class FileID < OpenAI::Internal::Type::BaseModel + attr_accessor id: String - class InputMessage < OpenAI::Internal::Type::BaseModel - attr_accessor content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content + attr_accessor type: :file_id - attr_accessor role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::role + def initialize: (id: String, ?type: :file_id) -> void - attr_accessor type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::type_ + def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::file_id + end - def initialize: ( - content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content, - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::role, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::type_ - ) -> void + type stored_completions = + { + type: :stored_completions, + created_after: Integer?, + created_before: Integer?, + limit: Integer?, + metadata: OpenAI::Models::metadata?, + model: String? + } - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::input_message + class StoredCompletions < OpenAI::Internal::Type::BaseModel + attr_accessor type: :stored_completions - type content = - { - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::type_ - } + attr_accessor created_after: Integer? - class Content < OpenAI::Internal::Type::BaseModel - attr_accessor text: String + attr_accessor created_before: Integer? - attr_accessor type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::type_ + attr_accessor limit: Integer? - def initialize: ( - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::type_ - ) -> void + attr_accessor metadata: OpenAI::Models::metadata? - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::content + attr_accessor model: String? - type type_ = :input_text + def initialize: ( + ?created_after: Integer?, + ?created_before: Integer?, + ?limit: Integer?, + ?metadata: OpenAI::Models::metadata?, + ?model: String?, + ?type: :stored_completions + ) -> void - module Type - extend OpenAI::Internal::Type::Enum + def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::stored_completions + end - INPUT_TEXT: :input_text + def self?.variants: -> [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions] + end - def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::Content::type_] - end - end + type type_ = :completions - type role = :user | :system | :developer + module Type + extend OpenAI::Internal::Type::Enum - module Role - extend OpenAI::Internal::Type::Enum + COMPLETIONS: :completions - USER: :user - SYSTEM: :system - DEVELOPER: :developer + def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::type_] + end - def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::role] - end + type input_messages = + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template + | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference - type type_ = :message + module InputMessages + extend OpenAI::Internal::Type::Union - module Type - extend OpenAI::Internal::Type::Enum + type template = + { + template: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::template], + type: :template + } - MESSAGE: :message + class Template < OpenAI::Internal::Type::BaseModel + attr_accessor template: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::template] - def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage::type_] - end - end + attr_accessor type: :template - type output_message = + def initialize: ( + template: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::template], + ?type: :template + ) -> void + + def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::template + + type template = + OpenAI::Models::Responses::EasyInputMessage + | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message + + module Template + extend OpenAI::Internal::Type::Union + + type message = { - content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content, - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::role, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::type_ + content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::content, + role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::role, + type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::type_ } - class OutputMessage < OpenAI::Internal::Type::BaseModel - attr_accessor content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content + class Message < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::content - attr_accessor role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::role + attr_accessor role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::role - attr_accessor type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::type_ + attr_reader type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::type_? + + def type=: ( + OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::type_ + ) -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::type_ def initialize: ( - content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content, - role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::role, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::type_ + content: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::content, + role: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::role, + ?type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::type_ ) -> void - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::output_message + def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::message type content = - { - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::type_ - } - - class Content < OpenAI::Internal::Type::BaseModel - attr_accessor text: String + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText - attr_accessor type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::type_ + module Content + extend OpenAI::Internal::Type::Union - def initialize: ( - text: String, - type: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::type_ - ) -> void + type output_text = { text: String, type: :output_text } - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::content + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String - type type_ = :output_text + attr_accessor type: :output_text - module Type - extend OpenAI::Internal::Type::Enum + def initialize: (text: String, ?type: :output_text) -> void - OUTPUT_TEXT: :output_text - - def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::Content::type_] + def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::output_text end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText] end - type role = :assistant + type role = :user | :assistant | :system | :developer module Role extend OpenAI::Internal::Type::Enum + USER: :user ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer - def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::role] + def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::role] end type type_ = :message @@ -222,11 +247,11 @@ module OpenAI MESSAGE: :message - def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage::type_] + def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::type_] end end - def self?.variants: -> [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::InputMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::OutputMessage] + def self?.variants: -> [OpenAI::Models::Responses::EasyInputMessage, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message] end end @@ -249,111 +274,6 @@ module OpenAI def self?.variants: -> [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference] end - type source = - OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent - | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID - | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions - - module Source - extend OpenAI::Internal::Type::Union - - type file_content = - { - content: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content], - type: :file_content - } - - class FileContent < OpenAI::Internal::Type::BaseModel - attr_accessor content: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content] - - attr_accessor type: :file_content - - def initialize: ( - content: ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::Content], - ?type: :file_content - ) -> void - - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::file_content - - type content = - { item: ::Hash[Symbol, top], sample: ::Hash[Symbol, top] } - - class Content < OpenAI::Internal::Type::BaseModel - attr_accessor item: ::Hash[Symbol, top] - - attr_reader sample: ::Hash[Symbol, top]? - - def sample=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - def initialize: ( - item: ::Hash[Symbol, top], - ?sample: ::Hash[Symbol, top] - ) -> void - - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent::content - end - end - - type file_id = { id: String, type: :file_id } - - class FileID < OpenAI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor type: :file_id - - def initialize: (id: String, ?type: :file_id) -> void - - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::file_id - end - - type stored_completions = - { - created_after: Integer?, - created_before: Integer?, - limit: Integer?, - metadata: OpenAI::Models::metadata?, - model: String?, - type: :stored_completions - } - - class StoredCompletions < OpenAI::Internal::Type::BaseModel - attr_accessor created_after: Integer? - - attr_accessor created_before: Integer? - - attr_accessor limit: Integer? - - attr_accessor metadata: OpenAI::Models::metadata? - - attr_accessor model: String? - - attr_accessor type: :stored_completions - - def initialize: ( - created_after: Integer?, - created_before: Integer?, - limit: Integer?, - metadata: OpenAI::Models::metadata?, - model: String?, - ?type: :stored_completions - ) -> void - - def to_hash: -> OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::stored_completions - end - - def self?.variants: -> [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions] - end - - type type_ = :completions - - module Type - extend OpenAI::Internal::Type::Enum - - COMPLETIONS: :completions - - def self?.values: -> ::Array[OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::type_] - end - type sampling_params = { max_completion_tokens: Integer, diff --git a/sig/openai/models/evals/run_cancel_response.rbs b/sig/openai/models/evals/run_cancel_response.rbs index 5a6e54d7..d6a2ba57 100644 --- a/sig/openai/models/evals/run_cancel_response.rbs +++ b/sig/openai/models/evals/run_cancel_response.rbs @@ -70,11 +70,350 @@ module OpenAI type data_source = OpenAI::Models::Evals::CreateEvalJSONLRunDataSource | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + | OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions module DataSource extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + type completions = + { + source: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::source, + type: :completions, + input_messages: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::input_messages, + model: String, + sampling_params: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams + } + + class Completions < OpenAI::Internal::Type::BaseModel + attr_accessor source: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::source + + attr_accessor type: :completions + + attr_reader input_messages: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::input_messages? + + def input_messages=: ( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::input_messages + ) -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::input_messages + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader sampling_params: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams? + + def sampling_params=: ( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams + ) -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams + + def initialize: ( + source: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::source, + ?input_messages: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::input_messages, + ?model: String, + ?sampling_params: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams, + ?type: :completions + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::completions + + type source = + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent + | OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID + | OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses + + module Source + extend OpenAI::Internal::Type::Union + + type file_content = + { + content: ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::Content], + type: :file_content + } + + class FileContent < OpenAI::Internal::Type::BaseModel + attr_accessor content: ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::Content] + + attr_accessor type: :file_content + + def initialize: ( + content: ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::Content], + ?type: :file_content + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::file_content + + type content = + { item: ::Hash[Symbol, top], sample: ::Hash[Symbol, top] } + + class Content < OpenAI::Internal::Type::BaseModel + attr_accessor item: ::Hash[Symbol, top] + + attr_reader sample: ::Hash[Symbol, top]? + + def sample=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + item: ::Hash[Symbol, top], + ?sample: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent::content + end + end + + type file_id = { id: String, type: :file_id } + + class FileID < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: :file_id + + def initialize: (id: String, ?type: :file_id) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::file_id + end + + type responses = + { + type: :responses, + allow_parallel_tool_calls: bool?, + created_after: Integer?, + created_before: Integer?, + has_tool_calls: bool?, + instructions_search: String?, + metadata: top?, + model: String?, + reasoning_effort: OpenAI::Models::reasoning_effort?, + temperature: Float?, + top_p: Float?, + users: ::Array[String]? + } + + class Responses < OpenAI::Internal::Type::BaseModel + attr_accessor type: :responses + + attr_accessor allow_parallel_tool_calls: bool? + + attr_accessor created_after: Integer? + + attr_accessor created_before: Integer? + + attr_accessor has_tool_calls: bool? + + attr_accessor instructions_search: String? + + attr_accessor metadata: top? + + attr_accessor model: String? + + attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort? + + attr_accessor temperature: Float? + + attr_accessor top_p: Float? + + attr_accessor users: ::Array[String]? + + def initialize: ( + ?allow_parallel_tool_calls: bool?, + ?created_after: Integer?, + ?created_before: Integer?, + ?has_tool_calls: bool?, + ?instructions_search: String?, + ?metadata: top?, + ?model: String?, + ?reasoning_effort: OpenAI::Models::reasoning_effort?, + ?temperature: Float?, + ?top_p: Float?, + ?users: ::Array[String]?, + ?type: :responses + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::responses + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses] + end + + type input_messages = + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template + | OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference + + module InputMessages + extend OpenAI::Internal::Type::Union + + type template = + { + template: ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::template], + type: :template + } + + class Template < OpenAI::Internal::Type::BaseModel + attr_accessor template: ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::template] + + attr_accessor type: :template + + def initialize: ( + template: ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::template], + ?type: :template + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::template + + type template = + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage + | OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + + module Template + extend OpenAI::Internal::Type::Union + + type chat_message = { content: String, role: String } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + attr_accessor content: String + + attr_accessor role: String + + def initialize: (content: String, role: String) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::chat_message + end + + type eval_item = + { + content: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + type: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + } + + class EvalItem < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content + + attr_accessor role: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role + + attr_reader type: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_? + + def type=: ( + OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + + def initialize: ( + content: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + ?type: OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::eval_item + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: ( + text: String, + ?type: :output_text + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_] + end + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + end + end + + type item_reference = + { item_reference: String, type: :item_reference } + + class ItemReference < OpenAI::Internal::Type::BaseModel + attr_accessor item_reference: String + + attr_accessor type: :item_reference + + def initialize: ( + item_reference: String, + ?type: :item_reference + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::item_reference + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference] + end + + type sampling_params = + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + + class SamplingParams < OpenAI::Internal::Type::BaseModel + attr_reader max_completion_tokens: Integer? + + def max_completion_tokens=: (Integer) -> Integer + + attr_reader seed: Integer? + + def seed=: (Integer) -> Integer + + attr_reader temperature: Float? + + def temperature=: (Float) -> Float + + attr_reader top_p: Float? + + def top_p=: (Float) -> Float + + def initialize: ( + ?max_completion_tokens: Integer, + ?seed: Integer, + ?temperature: Float, + ?top_p: Float + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::sampling_params + end + end + + def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions] end type per_model_usage = diff --git a/sig/openai/models/evals/run_create_params.rbs b/sig/openai/models/evals/run_create_params.rbs index 326d6f6d..f38000c8 100644 --- a/sig/openai/models/evals/run_create_params.rbs +++ b/sig/openai/models/evals/run_create_params.rbs @@ -33,11 +33,360 @@ module OpenAI type data_source = OpenAI::Models::Evals::CreateEvalJSONLRunDataSource | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + | OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource module DataSource extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + type create_eval_responses_run_data_source = + { + source: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::source, + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::type_, + input_messages: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::input_messages, + model: String, + sampling_params: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams + } + + class CreateEvalResponsesRunDataSource < OpenAI::Internal::Type::BaseModel + attr_accessor source: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::source + + attr_accessor type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::type_ + + attr_reader input_messages: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::input_messages? + + def input_messages=: ( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::input_messages + ) -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::input_messages + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader sampling_params: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams? + + def sampling_params=: ( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams + ) -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams + + def initialize: ( + source: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::source, + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::type_, + ?input_messages: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::input_messages, + ?model: String, + ?sampling_params: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::create_eval_responses_run_data_source + + type source = + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent + | OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID + | OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses + + module Source + extend OpenAI::Internal::Type::Union + + type file_content = + { + content: ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::Content], + type: :file_content + } + + class FileContent < OpenAI::Internal::Type::BaseModel + attr_accessor content: ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::Content] + + attr_accessor type: :file_content + + def initialize: ( + content: ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::Content], + ?type: :file_content + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::file_content + + type content = + { item: ::Hash[Symbol, top], sample: ::Hash[Symbol, top] } + + class Content < OpenAI::Internal::Type::BaseModel + attr_accessor item: ::Hash[Symbol, top] + + attr_reader sample: ::Hash[Symbol, top]? + + def sample=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + item: ::Hash[Symbol, top], + ?sample: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent::content + end + end + + type file_id = { id: String, type: :file_id } + + class FileID < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: :file_id + + def initialize: (id: String, ?type: :file_id) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::file_id + end + + type responses = + { + type: :responses, + allow_parallel_tool_calls: bool?, + created_after: Integer?, + created_before: Integer?, + has_tool_calls: bool?, + instructions_search: String?, + metadata: top?, + model: String?, + reasoning_effort: OpenAI::Models::reasoning_effort?, + temperature: Float?, + top_p: Float?, + users: ::Array[String]? + } + + class Responses < OpenAI::Internal::Type::BaseModel + attr_accessor type: :responses + + attr_accessor allow_parallel_tool_calls: bool? + + attr_accessor created_after: Integer? + + attr_accessor created_before: Integer? + + attr_accessor has_tool_calls: bool? + + attr_accessor instructions_search: String? + + attr_accessor metadata: top? + + attr_accessor model: String? + + attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort? + + attr_accessor temperature: Float? + + attr_accessor top_p: Float? + + attr_accessor users: ::Array[String]? + + def initialize: ( + ?allow_parallel_tool_calls: bool?, + ?created_after: Integer?, + ?created_before: Integer?, + ?has_tool_calls: bool?, + ?instructions_search: String?, + ?metadata: top?, + ?model: String?, + ?reasoning_effort: OpenAI::Models::reasoning_effort?, + ?temperature: Float?, + ?top_p: Float?, + ?users: ::Array[String]?, + ?type: :responses + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::responses + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses] + end + + type type_ = :completions + + module Type + extend OpenAI::Internal::Type::Enum + + COMPLETIONS: :completions + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::type_] + end + + type input_messages = + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template + | OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference + + module InputMessages + extend OpenAI::Internal::Type::Union + + type template = + { + template: ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::template], + type: :template + } + + class Template < OpenAI::Internal::Type::BaseModel + attr_accessor template: ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::template] + + attr_accessor type: :template + + def initialize: ( + template: ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::template], + ?type: :template + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::template + + type template = + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage + | OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem + + module Template + extend OpenAI::Internal::Type::Union + + type chat_message = { content: String, role: String } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + attr_accessor content: String + + attr_accessor role: String + + def initialize: (content: String, role: String) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::chat_message + end + + type eval_item = + { + content: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::role, + type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::type_ + } + + class EvalItem < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::content + + attr_accessor role: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::role + + attr_reader type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::type_? + + def type=: ( + OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::type_ + ) -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::type_ + + def initialize: ( + content: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::role, + ?type: OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::type_ + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::eval_item + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: ( + text: String, + ?type: :output_text + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::type_] + end + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem] + end + end + + type item_reference = + { item_reference: String, type: :item_reference } + + class ItemReference < OpenAI::Internal::Type::BaseModel + attr_accessor item_reference: String + + attr_accessor type: :item_reference + + def initialize: ( + item_reference: String, + ?type: :item_reference + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::item_reference + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference] + end + + type sampling_params = + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + + class SamplingParams < OpenAI::Internal::Type::BaseModel + attr_reader max_completion_tokens: Integer? + + def max_completion_tokens=: (Integer) -> Integer + + attr_reader seed: Integer? + + def seed=: (Integer) -> Integer + + attr_reader temperature: Float? + + def temperature=: (Float) -> Float + + attr_reader top_p: Float? + + def top_p=: (Float) -> Float + + def initialize: ( + ?max_completion_tokens: Integer, + ?seed: Integer, + ?temperature: Float, + ?top_p: Float + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::sampling_params + end + end + + def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] end end end diff --git a/sig/openai/models/evals/run_create_response.rbs b/sig/openai/models/evals/run_create_response.rbs index 3840e50a..571e81b9 100644 --- a/sig/openai/models/evals/run_create_response.rbs +++ b/sig/openai/models/evals/run_create_response.rbs @@ -70,11 +70,350 @@ module OpenAI type data_source = OpenAI::Models::Evals::CreateEvalJSONLRunDataSource | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + | OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions module DataSource extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + type completions = + { + source: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::source, + type: :completions, + input_messages: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::input_messages, + model: String, + sampling_params: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams + } + + class Completions < OpenAI::Internal::Type::BaseModel + attr_accessor source: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::source + + attr_accessor type: :completions + + attr_reader input_messages: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::input_messages? + + def input_messages=: ( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::input_messages + ) -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::input_messages + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader sampling_params: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams? + + def sampling_params=: ( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams + ) -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams + + def initialize: ( + source: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::source, + ?input_messages: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::input_messages, + ?model: String, + ?sampling_params: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams, + ?type: :completions + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::completions + + type source = + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent + | OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID + | OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses + + module Source + extend OpenAI::Internal::Type::Union + + type file_content = + { + content: ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::Content], + type: :file_content + } + + class FileContent < OpenAI::Internal::Type::BaseModel + attr_accessor content: ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::Content] + + attr_accessor type: :file_content + + def initialize: ( + content: ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::Content], + ?type: :file_content + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::file_content + + type content = + { item: ::Hash[Symbol, top], sample: ::Hash[Symbol, top] } + + class Content < OpenAI::Internal::Type::BaseModel + attr_accessor item: ::Hash[Symbol, top] + + attr_reader sample: ::Hash[Symbol, top]? + + def sample=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + item: ::Hash[Symbol, top], + ?sample: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent::content + end + end + + type file_id = { id: String, type: :file_id } + + class FileID < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: :file_id + + def initialize: (id: String, ?type: :file_id) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::file_id + end + + type responses = + { + type: :responses, + allow_parallel_tool_calls: bool?, + created_after: Integer?, + created_before: Integer?, + has_tool_calls: bool?, + instructions_search: String?, + metadata: top?, + model: String?, + reasoning_effort: OpenAI::Models::reasoning_effort?, + temperature: Float?, + top_p: Float?, + users: ::Array[String]? + } + + class Responses < OpenAI::Internal::Type::BaseModel + attr_accessor type: :responses + + attr_accessor allow_parallel_tool_calls: bool? + + attr_accessor created_after: Integer? + + attr_accessor created_before: Integer? + + attr_accessor has_tool_calls: bool? + + attr_accessor instructions_search: String? + + attr_accessor metadata: top? + + attr_accessor model: String? + + attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort? + + attr_accessor temperature: Float? + + attr_accessor top_p: Float? + + attr_accessor users: ::Array[String]? + + def initialize: ( + ?allow_parallel_tool_calls: bool?, + ?created_after: Integer?, + ?created_before: Integer?, + ?has_tool_calls: bool?, + ?instructions_search: String?, + ?metadata: top?, + ?model: String?, + ?reasoning_effort: OpenAI::Models::reasoning_effort?, + ?temperature: Float?, + ?top_p: Float?, + ?users: ::Array[String]?, + ?type: :responses + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::responses + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses] + end + + type input_messages = + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template + | OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference + + module InputMessages + extend OpenAI::Internal::Type::Union + + type template = + { + template: ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::template], + type: :template + } + + class Template < OpenAI::Internal::Type::BaseModel + attr_accessor template: ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::template] + + attr_accessor type: :template + + def initialize: ( + template: ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::template], + ?type: :template + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::template + + type template = + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage + | OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + + module Template + extend OpenAI::Internal::Type::Union + + type chat_message = { content: String, role: String } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + attr_accessor content: String + + attr_accessor role: String + + def initialize: (content: String, role: String) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::chat_message + end + + type eval_item = + { + content: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + type: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + } + + class EvalItem < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content + + attr_accessor role: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role + + attr_reader type: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_? + + def type=: ( + OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + + def initialize: ( + content: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + ?type: OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::eval_item + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: ( + text: String, + ?type: :output_text + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_] + end + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + end + end + + type item_reference = + { item_reference: String, type: :item_reference } + + class ItemReference < OpenAI::Internal::Type::BaseModel + attr_accessor item_reference: String + + attr_accessor type: :item_reference + + def initialize: ( + item_reference: String, + ?type: :item_reference + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::item_reference + end + + def self?.variants: -> [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference] + end + + type sampling_params = + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + + class SamplingParams < OpenAI::Internal::Type::BaseModel + attr_reader max_completion_tokens: Integer? + + def max_completion_tokens=: (Integer) -> Integer + + attr_reader seed: Integer? + + def seed=: (Integer) -> Integer + + attr_reader temperature: Float? + + def temperature=: (Float) -> Float + + attr_reader top_p: Float? + + def top_p=: (Float) -> Float + + def initialize: ( + ?max_completion_tokens: Integer, + ?seed: Integer, + ?temperature: Float, + ?top_p: Float + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::sampling_params + end + end + + def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions] end type per_model_usage = diff --git a/sig/openai/models/evals/run_list_response.rbs b/sig/openai/models/evals/run_list_response.rbs index 8a12f80e..60062163 100644 --- a/sig/openai/models/evals/run_list_response.rbs +++ b/sig/openai/models/evals/run_list_response.rbs @@ -70,11 +70,350 @@ module OpenAI type data_source = OpenAI::Models::Evals::CreateEvalJSONLRunDataSource | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + | OpenAI::Models::Evals::RunListResponse::DataSource::Completions module DataSource extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + type completions = + { + source: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::source, + type: :completions, + input_messages: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::input_messages, + model: String, + sampling_params: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams + } + + class Completions < OpenAI::Internal::Type::BaseModel + attr_accessor source: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::source + + attr_accessor type: :completions + + attr_reader input_messages: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::input_messages? + + def input_messages=: ( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::input_messages + ) -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::input_messages + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader sampling_params: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams? + + def sampling_params=: ( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams + ) -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams + + def initialize: ( + source: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::source, + ?input_messages: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::input_messages, + ?model: String, + ?sampling_params: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams, + ?type: :completions + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::completions + + type source = + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent + | OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID + | OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses + + module Source + extend OpenAI::Internal::Type::Union + + type file_content = + { + content: ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::Content], + type: :file_content + } + + class FileContent < OpenAI::Internal::Type::BaseModel + attr_accessor content: ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::Content] + + attr_accessor type: :file_content + + def initialize: ( + content: ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::Content], + ?type: :file_content + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::file_content + + type content = + { item: ::Hash[Symbol, top], sample: ::Hash[Symbol, top] } + + class Content < OpenAI::Internal::Type::BaseModel + attr_accessor item: ::Hash[Symbol, top] + + attr_reader sample: ::Hash[Symbol, top]? + + def sample=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + item: ::Hash[Symbol, top], + ?sample: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent::content + end + end + + type file_id = { id: String, type: :file_id } + + class FileID < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: :file_id + + def initialize: (id: String, ?type: :file_id) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::file_id + end + + type responses = + { + type: :responses, + allow_parallel_tool_calls: bool?, + created_after: Integer?, + created_before: Integer?, + has_tool_calls: bool?, + instructions_search: String?, + metadata: top?, + model: String?, + reasoning_effort: OpenAI::Models::reasoning_effort?, + temperature: Float?, + top_p: Float?, + users: ::Array[String]? + } + + class Responses < OpenAI::Internal::Type::BaseModel + attr_accessor type: :responses + + attr_accessor allow_parallel_tool_calls: bool? + + attr_accessor created_after: Integer? + + attr_accessor created_before: Integer? + + attr_accessor has_tool_calls: bool? + + attr_accessor instructions_search: String? + + attr_accessor metadata: top? + + attr_accessor model: String? + + attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort? + + attr_accessor temperature: Float? + + attr_accessor top_p: Float? + + attr_accessor users: ::Array[String]? + + def initialize: ( + ?allow_parallel_tool_calls: bool?, + ?created_after: Integer?, + ?created_before: Integer?, + ?has_tool_calls: bool?, + ?instructions_search: String?, + ?metadata: top?, + ?model: String?, + ?reasoning_effort: OpenAI::Models::reasoning_effort?, + ?temperature: Float?, + ?top_p: Float?, + ?users: ::Array[String]?, + ?type: :responses + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::responses + end + + def self?.variants: -> [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses] + end + + type input_messages = + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template + | OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference + + module InputMessages + extend OpenAI::Internal::Type::Union + + type template = + { + template: ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::template], + type: :template + } + + class Template < OpenAI::Internal::Type::BaseModel + attr_accessor template: ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::template] + + attr_accessor type: :template + + def initialize: ( + template: ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::template], + ?type: :template + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::template + + type template = + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage + | OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + + module Template + extend OpenAI::Internal::Type::Union + + type chat_message = { content: String, role: String } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + attr_accessor content: String + + attr_accessor role: String + + def initialize: (content: String, role: String) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::chat_message + end + + type eval_item = + { + content: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + type: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + } + + class EvalItem < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content + + attr_accessor role: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role + + attr_reader type: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_? + + def type=: ( + OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + + def initialize: ( + content: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + ?type: OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::eval_item + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: ( + text: String, + ?type: :output_text + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_] + end + end + + def self?.variants: -> [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + end + end + + type item_reference = + { item_reference: String, type: :item_reference } + + class ItemReference < OpenAI::Internal::Type::BaseModel + attr_accessor item_reference: String + + attr_accessor type: :item_reference + + def initialize: ( + item_reference: String, + ?type: :item_reference + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::item_reference + end + + def self?.variants: -> [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference] + end + + type sampling_params = + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + + class SamplingParams < OpenAI::Internal::Type::BaseModel + attr_reader max_completion_tokens: Integer? + + def max_completion_tokens=: (Integer) -> Integer + + attr_reader seed: Integer? + + def seed=: (Integer) -> Integer + + attr_reader temperature: Float? + + def temperature=: (Float) -> Float + + attr_reader top_p: Float? + + def top_p=: (Float) -> Float + + def initialize: ( + ?max_completion_tokens: Integer, + ?seed: Integer, + ?temperature: Float, + ?top_p: Float + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunListResponse::DataSource::Completions::sampling_params + end + end + + def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunListResponse::DataSource::Completions] end type per_model_usage = diff --git a/sig/openai/models/evals/run_retrieve_response.rbs b/sig/openai/models/evals/run_retrieve_response.rbs index 5a9a33ba..6714cb0c 100644 --- a/sig/openai/models/evals/run_retrieve_response.rbs +++ b/sig/openai/models/evals/run_retrieve_response.rbs @@ -70,11 +70,350 @@ module OpenAI type data_source = OpenAI::Models::Evals::CreateEvalJSONLRunDataSource | OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource + | OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions module DataSource extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource] + type completions = + { + source: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::source, + type: :completions, + input_messages: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::input_messages, + model: String, + sampling_params: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams + } + + class Completions < OpenAI::Internal::Type::BaseModel + attr_accessor source: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::source + + attr_accessor type: :completions + + attr_reader input_messages: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::input_messages? + + def input_messages=: ( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::input_messages + ) -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::input_messages + + attr_reader model: String? + + def model=: (String) -> String + + attr_reader sampling_params: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams? + + def sampling_params=: ( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams + ) -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams + + def initialize: ( + source: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::source, + ?input_messages: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::input_messages, + ?model: String, + ?sampling_params: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams, + ?type: :completions + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::completions + + type source = + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent + | OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID + | OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses + + module Source + extend OpenAI::Internal::Type::Union + + type file_content = + { + content: ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::Content], + type: :file_content + } + + class FileContent < OpenAI::Internal::Type::BaseModel + attr_accessor content: ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::Content] + + attr_accessor type: :file_content + + def initialize: ( + content: ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::Content], + ?type: :file_content + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::file_content + + type content = + { item: ::Hash[Symbol, top], sample: ::Hash[Symbol, top] } + + class Content < OpenAI::Internal::Type::BaseModel + attr_accessor item: ::Hash[Symbol, top] + + attr_reader sample: ::Hash[Symbol, top]? + + def sample=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + item: ::Hash[Symbol, top], + ?sample: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent::content + end + end + + type file_id = { id: String, type: :file_id } + + class FileID < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: :file_id + + def initialize: (id: String, ?type: :file_id) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::file_id + end + + type responses = + { + type: :responses, + allow_parallel_tool_calls: bool?, + created_after: Integer?, + created_before: Integer?, + has_tool_calls: bool?, + instructions_search: String?, + metadata: top?, + model: String?, + reasoning_effort: OpenAI::Models::reasoning_effort?, + temperature: Float?, + top_p: Float?, + users: ::Array[String]? + } + + class Responses < OpenAI::Internal::Type::BaseModel + attr_accessor type: :responses + + attr_accessor allow_parallel_tool_calls: bool? + + attr_accessor created_after: Integer? + + attr_accessor created_before: Integer? + + attr_accessor has_tool_calls: bool? + + attr_accessor instructions_search: String? + + attr_accessor metadata: top? + + attr_accessor model: String? + + attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort? + + attr_accessor temperature: Float? + + attr_accessor top_p: Float? + + attr_accessor users: ::Array[String]? + + def initialize: ( + ?allow_parallel_tool_calls: bool?, + ?created_after: Integer?, + ?created_before: Integer?, + ?has_tool_calls: bool?, + ?instructions_search: String?, + ?metadata: top?, + ?model: String?, + ?reasoning_effort: OpenAI::Models::reasoning_effort?, + ?temperature: Float?, + ?top_p: Float?, + ?users: ::Array[String]?, + ?type: :responses + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::responses + end + + def self?.variants: -> [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses] + end + + type input_messages = + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template + | OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference + + module InputMessages + extend OpenAI::Internal::Type::Union + + type template = + { + template: ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::template], + type: :template + } + + class Template < OpenAI::Internal::Type::BaseModel + attr_accessor template: ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::template] + + attr_accessor type: :template + + def initialize: ( + template: ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::template], + ?type: :template + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::template + + type template = + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage + | OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem + + module Template + extend OpenAI::Internal::Type::Union + + type chat_message = { content: String, role: String } + + class ChatMessage < OpenAI::Internal::Type::BaseModel + attr_accessor content: String + + attr_accessor role: String + + def initialize: (content: String, role: String) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::chat_message + end + + type eval_item = + { + content: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + type: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + } + + class EvalItem < OpenAI::Internal::Type::BaseModel + attr_accessor content: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content + + attr_accessor role: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role + + attr_reader type: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_? + + def type=: ( + OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + + def initialize: ( + content: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::content, + role: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role, + ?type: OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_ + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::eval_item + + type content = + String + | OpenAI::Models::Responses::ResponseInputText + | OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText + + module Content + extend OpenAI::Internal::Type::Union + + type output_text = { text: String, type: :output_text } + + class OutputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: ( + text: String, + ?type: :output_text + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::output_text + end + + def self?.variants: -> [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] + end + + type role = :user | :assistant | :system | :developer + + module Role + extend OpenAI::Internal::Type::Enum + + USER: :user + ASSISTANT: :assistant + SYSTEM: :system + DEVELOPER: :developer + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::role] + end + + type type_ = :message + + module Type + extend OpenAI::Internal::Type::Enum + + MESSAGE: :message + + def self?.values: -> ::Array[OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::type_] + end + end + + def self?.variants: -> [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::ChatMessage, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem] + end + end + + type item_reference = + { item_reference: String, type: :item_reference } + + class ItemReference < OpenAI::Internal::Type::BaseModel + attr_accessor item_reference: String + + attr_accessor type: :item_reference + + def initialize: ( + item_reference: String, + ?type: :item_reference + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::item_reference + end + + def self?.variants: -> [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference] + end + + type sampling_params = + { + max_completion_tokens: Integer, + seed: Integer, + temperature: Float, + top_p: Float + } + + class SamplingParams < OpenAI::Internal::Type::BaseModel + attr_reader max_completion_tokens: Integer? + + def max_completion_tokens=: (Integer) -> Integer + + attr_reader seed: Integer? + + def seed=: (Integer) -> Integer + + attr_reader temperature: Float? + + def temperature=: (Float) -> Float + + attr_reader top_p: Float? + + def top_p=: (Float) -> Float + + def initialize: ( + ?max_completion_tokens: Integer, + ?seed: Integer, + ?temperature: Float, + ?top_p: Float + ) -> void + + def to_hash: -> OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::sampling_params + end + end + + def self?.variants: -> [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions] end type per_model_usage = diff --git a/sig/openai/models/fine_tuning/checkpoints/permission_delete_params.rbs b/sig/openai/models/fine_tuning/checkpoints/permission_delete_params.rbs index 142fe252..d57abc16 100644 --- a/sig/openai/models/fine_tuning/checkpoints/permission_delete_params.rbs +++ b/sig/openai/models/fine_tuning/checkpoints/permission_delete_params.rbs @@ -3,13 +3,19 @@ module OpenAI module FineTuning module Checkpoints type permission_delete_params = - { } & OpenAI::Internal::Type::request_parameters + { fine_tuned_model_checkpoint: String } + & OpenAI::Internal::Type::request_parameters class PermissionDeleteParams < OpenAI::Internal::Type::BaseModel extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - def initialize: (?request_options: OpenAI::request_opts) -> void + attr_accessor fine_tuned_model_checkpoint: String + + def initialize: ( + fine_tuned_model_checkpoint: String, + ?request_options: OpenAI::request_opts + ) -> void def to_hash: -> OpenAI::Models::FineTuning::Checkpoints::permission_delete_params end diff --git a/sig/openai/models/image_edit_params.rbs b/sig/openai/models/image_edit_params.rbs index c5367ca5..30bf203d 100644 --- a/sig/openai/models/image_edit_params.rbs +++ b/sig/openai/models/image_edit_params.rbs @@ -2,11 +2,12 @@ module OpenAI module Models type image_edit_params = { - image: (Pathname | StringIO), + image: OpenAI::Models::ImageEditParams::image, prompt: String, mask: (Pathname | StringIO), model: OpenAI::Models::ImageEditParams::model?, n: Integer?, + quality: OpenAI::Models::ImageEditParams::quality?, response_format: OpenAI::Models::ImageEditParams::response_format?, size: OpenAI::Models::ImageEditParams::size?, user: String @@ -17,7 +18,7 @@ module OpenAI extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - attr_accessor image: Pathname | StringIO + attr_accessor image: OpenAI::Models::ImageEditParams::image attr_accessor prompt: String @@ -29,6 +30,8 @@ module OpenAI attr_accessor n: Integer? + attr_accessor quality: OpenAI::Models::ImageEditParams::quality? + attr_accessor response_format: OpenAI::Models::ImageEditParams::response_format? attr_accessor size: OpenAI::Models::ImageEditParams::size? @@ -38,11 +41,12 @@ module OpenAI def user=: (String) -> String def initialize: ( - image: Pathname | StringIO, + image: OpenAI::Models::ImageEditParams::image, prompt: String, ?mask: Pathname | StringIO, ?model: OpenAI::Models::ImageEditParams::model?, ?n: Integer?, + ?quality: OpenAI::Models::ImageEditParams::quality?, ?response_format: OpenAI::Models::ImageEditParams::response_format?, ?size: OpenAI::Models::ImageEditParams::size?, ?user: String, @@ -51,6 +55,18 @@ module OpenAI def to_hash: -> OpenAI::Models::image_edit_params + type image = Pathname | StringIO | ::Array[Pathname | StringIO] + + module Image + extend OpenAI::Internal::Type::Union + + def self?.variants: -> [StringIO, ::Array[StringIO]] + + type string_array = ::Array[Pathname | StringIO] + + StringArray: string_array + end + type model = String | OpenAI::Models::image_model module Model @@ -59,6 +75,20 @@ module OpenAI def self?.variants: -> [String, OpenAI::Models::image_model] end + type quality = :standard | :low | :medium | :high | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + STANDARD: :standard + LOW: :low + MEDIUM: :medium + HIGH: :high + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::ImageEditParams::quality] + end + type response_format = :url | :b64_json module ResponseFormat diff --git a/sig/openai/models/image_generate_params.rbs b/sig/openai/models/image_generate_params.rbs index 869a9475..c5efaac8 100644 --- a/sig/openai/models/image_generate_params.rbs +++ b/sig/openai/models/image_generate_params.rbs @@ -3,9 +3,13 @@ module OpenAI type image_generate_params = { prompt: String, + background: OpenAI::Models::ImageGenerateParams::background?, model: OpenAI::Models::ImageGenerateParams::model?, + moderation: OpenAI::Models::ImageGenerateParams::moderation?, n: Integer?, - quality: OpenAI::Models::ImageGenerateParams::quality, + output_compression: Integer?, + output_format: OpenAI::Models::ImageGenerateParams::output_format?, + quality: OpenAI::Models::ImageGenerateParams::quality?, response_format: OpenAI::Models::ImageGenerateParams::response_format?, size: OpenAI::Models::ImageGenerateParams::size?, style: OpenAI::Models::ImageGenerateParams::style?, @@ -19,15 +23,19 @@ module OpenAI attr_accessor prompt: String + attr_accessor background: OpenAI::Models::ImageGenerateParams::background? + attr_accessor model: OpenAI::Models::ImageGenerateParams::model? + attr_accessor moderation: OpenAI::Models::ImageGenerateParams::moderation? + attr_accessor n: Integer? - attr_reader quality: OpenAI::Models::ImageGenerateParams::quality? + attr_accessor output_compression: Integer? + + attr_accessor output_format: OpenAI::Models::ImageGenerateParams::output_format? - def quality=: ( - OpenAI::Models::ImageGenerateParams::quality - ) -> OpenAI::Models::ImageGenerateParams::quality + attr_accessor quality: OpenAI::Models::ImageGenerateParams::quality? attr_accessor response_format: OpenAI::Models::ImageGenerateParams::response_format? @@ -41,9 +49,13 @@ module OpenAI def initialize: ( prompt: String, + ?background: OpenAI::Models::ImageGenerateParams::background?, ?model: OpenAI::Models::ImageGenerateParams::model?, + ?moderation: OpenAI::Models::ImageGenerateParams::moderation?, ?n: Integer?, - ?quality: OpenAI::Models::ImageGenerateParams::quality, + ?output_compression: Integer?, + ?output_format: OpenAI::Models::ImageGenerateParams::output_format?, + ?quality: OpenAI::Models::ImageGenerateParams::quality?, ?response_format: OpenAI::Models::ImageGenerateParams::response_format?, ?size: OpenAI::Models::ImageGenerateParams::size?, ?style: OpenAI::Models::ImageGenerateParams::style?, @@ -53,6 +65,18 @@ module OpenAI def to_hash: -> OpenAI::Models::image_generate_params + type background = :transparent | :opaque | :auto + + module Background + extend OpenAI::Internal::Type::Enum + + TRANSPARENT: :transparent + OPAQUE: :opaque + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::ImageGenerateParams::background] + end + type model = String | OpenAI::Models::image_model module Model @@ -61,13 +85,40 @@ module OpenAI def self?.variants: -> [String, OpenAI::Models::image_model] end - type quality = :standard | :hd + type moderation = :low | :auto + + module Moderation + extend OpenAI::Internal::Type::Enum + + LOW: :low + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::ImageGenerateParams::moderation] + end + + type output_format = :png | :jpeg | :webp + + module OutputFormat + extend OpenAI::Internal::Type::Enum + + PNG: :png + JPEG: :jpeg + WEBP: :webp + + def self?.values: -> ::Array[OpenAI::Models::ImageGenerateParams::output_format] + end + + type quality = :standard | :hd | :low | :medium | :high | :auto module Quality extend OpenAI::Internal::Type::Enum STANDARD: :standard HD: :hd + LOW: :low + MEDIUM: :medium + HIGH: :high + AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::ImageGenerateParams::quality] end @@ -84,14 +135,24 @@ module OpenAI end type size = - :"256x256" | :"512x512" | :"1024x1024" | :"1792x1024" | :"1024x1792" + :auto + | :"1024x1024" + | :"1536x1024" + | :"1024x1536" + | :"256x256" + | :"512x512" + | :"1792x1024" + | :"1024x1792" module Size extend OpenAI::Internal::Type::Enum + AUTO: :auto + SIZE_1024X1024: :"1024x1024" + SIZE_1536X1024: :"1536x1024" + SIZE_1024X1536: :"1024x1536" SIZE_256X256: :"256x256" SIZE_512X512: :"512x512" - SIZE_1024X1024: :"1024x1024" SIZE_1792X1024: :"1792x1024" SIZE_1024X1792: :"1024x1792" diff --git a/sig/openai/models/image_model.rbs b/sig/openai/models/image_model.rbs index 31f6927a..e41f713d 100644 --- a/sig/openai/models/image_model.rbs +++ b/sig/openai/models/image_model.rbs @@ -1,12 +1,13 @@ module OpenAI module Models - type image_model = :"dall-e-2" | :"dall-e-3" + type image_model = :"dall-e-2" | :"dall-e-3" | :"gpt-image-1" module ImageModel extend OpenAI::Internal::Type::Enum DALL_E_2: :"dall-e-2" DALL_E_3: :"dall-e-3" + GPT_IMAGE_1: :"gpt-image-1" def self?.values: -> ::Array[OpenAI::Models::image_model] end diff --git a/sig/openai/models/images_response.rbs b/sig/openai/models/images_response.rbs index e5608584..5f23336d 100644 --- a/sig/openai/models/images_response.rbs +++ b/sig/openai/models/images_response.rbs @@ -1,19 +1,74 @@ module OpenAI module Models type images_response = - { created: Integer, data: ::Array[OpenAI::Models::Image] } + { + created: Integer, + data: ::Array[OpenAI::Models::Image], + usage: OpenAI::Models::ImagesResponse::Usage + } class ImagesResponse < OpenAI::Internal::Type::BaseModel attr_accessor created: Integer - attr_accessor data: ::Array[OpenAI::Models::Image] + attr_reader data: ::Array[OpenAI::Models::Image]? + + def data=: ( + ::Array[OpenAI::Models::Image] + ) -> ::Array[OpenAI::Models::Image] + + attr_reader usage: OpenAI::Models::ImagesResponse::Usage? + + def usage=: ( + OpenAI::Models::ImagesResponse::Usage + ) -> OpenAI::Models::ImagesResponse::Usage def initialize: ( created: Integer, - data: ::Array[OpenAI::Models::Image] + ?data: ::Array[OpenAI::Models::Image], + ?usage: OpenAI::Models::ImagesResponse::Usage ) -> void def to_hash: -> OpenAI::Models::images_response + + type usage = + { + input_tokens: Integer, + input_tokens_details: OpenAI::Models::ImagesResponse::Usage::InputTokensDetails, + output_tokens: Integer, + total_tokens: Integer + } + + class Usage < OpenAI::Internal::Type::BaseModel + attr_accessor input_tokens: Integer + + attr_accessor input_tokens_details: OpenAI::Models::ImagesResponse::Usage::InputTokensDetails + + attr_accessor output_tokens: Integer + + attr_accessor total_tokens: Integer + + def initialize: ( + input_tokens: Integer, + input_tokens_details: OpenAI::Models::ImagesResponse::Usage::InputTokensDetails, + output_tokens: Integer, + total_tokens: Integer + ) -> void + + def to_hash: -> OpenAI::Models::ImagesResponse::usage + + type input_tokens_details = + { image_tokens: Integer, text_tokens: Integer } + + class InputTokensDetails < OpenAI::Internal::Type::BaseModel + attr_accessor image_tokens: Integer + + attr_accessor text_tokens: Integer + + def initialize: (image_tokens: Integer, text_tokens: Integer) -> void + + def to_hash: -> OpenAI::Models::ImagesResponse::Usage::input_tokens_details + end + end end end end diff --git a/sig/openai/models/responses/response_reasoning_summary_part_added_event.rbs b/sig/openai/models/responses/response_reasoning_summary_part_added_event.rbs new file mode 100644 index 00000000..d970d8a3 --- /dev/null +++ b/sig/openai/models/responses/response_reasoning_summary_part_added_event.rbs @@ -0,0 +1,48 @@ +module OpenAI + module Models + module Responses + type response_reasoning_summary_part_added_event = + { + item_id: String, + output_index: Integer, + part: OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part, + summary_index: Integer, + type: :"response.reasoning_summary_part.added" + } + + class ResponseReasoningSummaryPartAddedEvent < OpenAI::Internal::Type::BaseModel + attr_accessor item_id: String + + attr_accessor output_index: Integer + + attr_accessor part: OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part + + attr_accessor summary_index: Integer + + attr_accessor type: :"response.reasoning_summary_part.added" + + def initialize: ( + item_id: String, + output_index: Integer, + part: OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part, + summary_index: Integer, + ?type: :"response.reasoning_summary_part.added" + ) -> void + + def to_hash: -> OpenAI::Models::Responses::response_reasoning_summary_part_added_event + + type part = { text: String, type: :summary_text } + + class Part < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :summary_text + + def initialize: (text: String, ?type: :summary_text) -> void + + def to_hash: -> OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::part + end + end + end + end +end diff --git a/sig/openai/models/responses/response_reasoning_summary_part_done_event.rbs b/sig/openai/models/responses/response_reasoning_summary_part_done_event.rbs new file mode 100644 index 00000000..88fe9e2a --- /dev/null +++ b/sig/openai/models/responses/response_reasoning_summary_part_done_event.rbs @@ -0,0 +1,48 @@ +module OpenAI + module Models + module Responses + type response_reasoning_summary_part_done_event = + { + item_id: String, + output_index: Integer, + part: OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part, + summary_index: Integer, + type: :"response.reasoning_summary_part.done" + } + + class ResponseReasoningSummaryPartDoneEvent < OpenAI::Internal::Type::BaseModel + attr_accessor item_id: String + + attr_accessor output_index: Integer + + attr_accessor part: OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part + + attr_accessor summary_index: Integer + + attr_accessor type: :"response.reasoning_summary_part.done" + + def initialize: ( + item_id: String, + output_index: Integer, + part: OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part, + summary_index: Integer, + ?type: :"response.reasoning_summary_part.done" + ) -> void + + def to_hash: -> OpenAI::Models::Responses::response_reasoning_summary_part_done_event + + type part = { text: String, type: :summary_text } + + class Part < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :summary_text + + def initialize: (text: String, ?type: :summary_text) -> void + + def to_hash: -> OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::part + end + end + end + end +end diff --git a/sig/openai/models/responses/response_reasoning_summary_text_delta_event.rbs b/sig/openai/models/responses/response_reasoning_summary_text_delta_event.rbs new file mode 100644 index 00000000..d73f86b6 --- /dev/null +++ b/sig/openai/models/responses/response_reasoning_summary_text_delta_event.rbs @@ -0,0 +1,36 @@ +module OpenAI + module Models + module Responses + type response_reasoning_summary_text_delta_event = + { + delta: String, + item_id: String, + output_index: Integer, + summary_index: Integer, + type: :"response.reasoning_summary_text.delta" + } + + class ResponseReasoningSummaryTextDeltaEvent < OpenAI::Internal::Type::BaseModel + attr_accessor delta: String + + attr_accessor item_id: String + + attr_accessor output_index: Integer + + attr_accessor summary_index: Integer + + attr_accessor type: :"response.reasoning_summary_text.delta" + + def initialize: ( + delta: String, + item_id: String, + output_index: Integer, + summary_index: Integer, + ?type: :"response.reasoning_summary_text.delta" + ) -> void + + def to_hash: -> OpenAI::Models::Responses::response_reasoning_summary_text_delta_event + end + end + end +end diff --git a/sig/openai/models/responses/response_reasoning_summary_text_done_event.rbs b/sig/openai/models/responses/response_reasoning_summary_text_done_event.rbs new file mode 100644 index 00000000..63b910b7 --- /dev/null +++ b/sig/openai/models/responses/response_reasoning_summary_text_done_event.rbs @@ -0,0 +1,36 @@ +module OpenAI + module Models + module Responses + type response_reasoning_summary_text_done_event = + { + item_id: String, + output_index: Integer, + summary_index: Integer, + text: String, + type: :"response.reasoning_summary_text.done" + } + + class ResponseReasoningSummaryTextDoneEvent < OpenAI::Internal::Type::BaseModel + attr_accessor item_id: String + + attr_accessor output_index: Integer + + attr_accessor summary_index: Integer + + attr_accessor text: String + + attr_accessor type: :"response.reasoning_summary_text.done" + + def initialize: ( + item_id: String, + output_index: Integer, + summary_index: Integer, + text: String, + ?type: :"response.reasoning_summary_text.done" + ) -> void + + def to_hash: -> OpenAI::Models::Responses::response_reasoning_summary_text_done_event + end + end + end +end diff --git a/sig/openai/models/responses/response_stream_event.rbs b/sig/openai/models/responses/response_stream_event.rbs index 18708efb..e81d05de 100644 --- a/sig/openai/models/responses/response_stream_event.rbs +++ b/sig/openai/models/responses/response_stream_event.rbs @@ -26,6 +26,10 @@ module OpenAI | OpenAI::Models::Responses::ResponseIncompleteEvent | OpenAI::Models::Responses::ResponseOutputItemAddedEvent | OpenAI::Models::Responses::ResponseOutputItemDoneEvent + | OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent + | OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent + | OpenAI::Models::Responses::ResponseReasoningSummaryTextDeltaEvent + | OpenAI::Models::Responses::ResponseReasoningSummaryTextDoneEvent | OpenAI::Models::Responses::ResponseRefusalDeltaEvent | OpenAI::Models::Responses::ResponseRefusalDoneEvent | OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent @@ -38,7 +42,7 @@ module OpenAI module ResponseStreamEvent extend OpenAI::Internal::Type::Union - def self?.variants: -> [OpenAI::Models::Responses::ResponseAudioDeltaEvent, OpenAI::Models::Responses::ResponseAudioDoneEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent, OpenAI::Models::Responses::ResponseCompletedEvent, OpenAI::Models::Responses::ResponseContentPartAddedEvent, OpenAI::Models::Responses::ResponseContentPartDoneEvent, OpenAI::Models::Responses::ResponseCreatedEvent, OpenAI::Models::Responses::ResponseErrorEvent, OpenAI::Models::Responses::ResponseFileSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseFileSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseFileSearchCallSearchingEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Responses::ResponseInProgressEvent, OpenAI::Models::Responses::ResponseFailedEvent, OpenAI::Models::Responses::ResponseIncompleteEvent, OpenAI::Models::Responses::ResponseOutputItemAddedEvent, OpenAI::Models::Responses::ResponseOutputItemDoneEvent, OpenAI::Models::Responses::ResponseRefusalDeltaEvent, OpenAI::Models::Responses::ResponseRefusalDoneEvent, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent, OpenAI::Models::Responses::ResponseTextDeltaEvent, OpenAI::Models::Responses::ResponseTextDoneEvent, OpenAI::Models::Responses::ResponseWebSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseWebSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent] + def self?.variants: -> [OpenAI::Models::Responses::ResponseAudioDeltaEvent, OpenAI::Models::Responses::ResponseAudioDoneEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Responses::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent, OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent, OpenAI::Models::Responses::ResponseCompletedEvent, OpenAI::Models::Responses::ResponseContentPartAddedEvent, OpenAI::Models::Responses::ResponseContentPartDoneEvent, OpenAI::Models::Responses::ResponseCreatedEvent, OpenAI::Models::Responses::ResponseErrorEvent, OpenAI::Models::Responses::ResponseFileSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseFileSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseFileSearchCallSearchingEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Responses::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Responses::ResponseInProgressEvent, OpenAI::Models::Responses::ResponseFailedEvent, OpenAI::Models::Responses::ResponseIncompleteEvent, OpenAI::Models::Responses::ResponseOutputItemAddedEvent, OpenAI::Models::Responses::ResponseOutputItemDoneEvent, OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent, OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent, OpenAI::Models::Responses::ResponseReasoningSummaryTextDeltaEvent, OpenAI::Models::Responses::ResponseReasoningSummaryTextDoneEvent, OpenAI::Models::Responses::ResponseRefusalDeltaEvent, OpenAI::Models::Responses::ResponseRefusalDoneEvent, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent, OpenAI::Models::Responses::ResponseTextDeltaEvent, OpenAI::Models::Responses::ResponseTextDoneEvent, OpenAI::Models::Responses::ResponseWebSearchCallCompletedEvent, OpenAI::Models::Responses::ResponseWebSearchCallInProgressEvent, OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent] end end end diff --git a/sig/openai/resources/beta/threads.rbs b/sig/openai/resources/beta/threads.rbs index 50be0608..2ef9c298 100644 --- a/sig/openai/resources/beta/threads.rbs +++ b/sig/openai/resources/beta/threads.rbs @@ -43,7 +43,7 @@ module OpenAI ?thread: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, ?tool_choice: OpenAI::Models::Beta::assistant_tool_choice_option?, ?tool_resources: OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources?, - ?tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::tool]?, + ?tools: ::Array[OpenAI::Models::Beta::assistant_tool]?, ?top_p: Float?, ?truncation_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy?, ?request_options: OpenAI::request_opts @@ -62,7 +62,7 @@ module OpenAI ?thread: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, ?tool_choice: OpenAI::Models::Beta::assistant_tool_choice_option?, ?tool_resources: OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources?, - ?tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::tool]?, + ?tools: ::Array[OpenAI::Models::Beta::assistant_tool]?, ?top_p: Float?, ?truncation_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy?, ?request_options: OpenAI::request_opts diff --git a/sig/openai/resources/evals.rbs b/sig/openai/resources/evals.rbs index 84d16747..dd3d6cc5 100644 --- a/sig/openai/resources/evals.rbs +++ b/sig/openai/resources/evals.rbs @@ -8,7 +8,6 @@ module OpenAI testing_criteria: ::Array[OpenAI::Models::EvalCreateParams::testing_criterion], ?metadata: OpenAI::Models::metadata?, ?name: String, - ?share_with_openai: bool, ?request_options: OpenAI::request_opts ) -> OpenAI::Models::EvalCreateResponse diff --git a/sig/openai/resources/fine_tuning/checkpoints/permissions.rbs b/sig/openai/resources/fine_tuning/checkpoints/permissions.rbs index 0033c40d..f36dcbbb 100644 --- a/sig/openai/resources/fine_tuning/checkpoints/permissions.rbs +++ b/sig/openai/resources/fine_tuning/checkpoints/permissions.rbs @@ -19,7 +19,8 @@ module OpenAI ) -> OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse def delete: ( - String fine_tuned_model_checkpoint, + String permission_id, + fine_tuned_model_checkpoint: String, ?request_options: OpenAI::request_opts ) -> OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteResponse diff --git a/sig/openai/resources/images.rbs b/sig/openai/resources/images.rbs index e4831410..ec6082ff 100644 --- a/sig/openai/resources/images.rbs +++ b/sig/openai/resources/images.rbs @@ -12,11 +12,12 @@ module OpenAI ) -> OpenAI::Models::ImagesResponse def edit: ( - image: Pathname | StringIO, + image: OpenAI::Models::ImageEditParams::image, prompt: String, ?mask: Pathname | StringIO, ?model: OpenAI::Models::ImageEditParams::model?, ?n: Integer?, + ?quality: OpenAI::Models::ImageEditParams::quality?, ?response_format: OpenAI::Models::ImageEditParams::response_format?, ?size: OpenAI::Models::ImageEditParams::size?, ?user: String, @@ -25,9 +26,13 @@ module OpenAI def generate: ( prompt: String, + ?background: OpenAI::Models::ImageGenerateParams::background?, ?model: OpenAI::Models::ImageGenerateParams::model?, + ?moderation: OpenAI::Models::ImageGenerateParams::moderation?, ?n: Integer?, - ?quality: OpenAI::Models::ImageGenerateParams::quality, + ?output_compression: Integer?, + ?output_format: OpenAI::Models::ImageGenerateParams::output_format?, + ?quality: OpenAI::Models::ImageGenerateParams::quality?, ?response_format: OpenAI::Models::ImageGenerateParams::response_format?, ?size: OpenAI::Models::ImageGenerateParams::size?, ?style: OpenAI::Models::ImageGenerateParams::style?, diff --git a/test/openai/resources/evals_test.rb b/test/openai/resources/evals_test.rb index 8d1bdca2..d4cdc458 100644 --- a/test/openai/resources/evals_test.rb +++ b/test/openai/resources/evals_test.rb @@ -31,7 +31,6 @@ def test_create_required_params metadata: ^(OpenAI::Internal::Type::HashOf[String]) | nil, name: String, object: Symbol, - share_with_openai: OpenAI::Internal::Type::Boolean, testing_criteria: ^(OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalCreateResponse::TestingCriterion]) } end @@ -52,7 +51,6 @@ def test_retrieve metadata: ^(OpenAI::Internal::Type::HashOf[String]) | nil, name: String, object: Symbol, - share_with_openai: OpenAI::Internal::Type::Boolean, testing_criteria: ^(OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalRetrieveResponse::TestingCriterion]) } end @@ -73,7 +71,6 @@ def test_update metadata: ^(OpenAI::Internal::Type::HashOf[String]) | nil, name: String, object: Symbol, - share_with_openai: OpenAI::Internal::Type::Boolean, testing_criteria: ^(OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalUpdateResponse::TestingCriterion]) } end @@ -101,7 +98,6 @@ def test_list metadata: ^(OpenAI::Internal::Type::HashOf[String]) | nil, name: String, object: Symbol, - share_with_openai: OpenAI::Internal::Type::Boolean, testing_criteria: ^(OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalListResponse::TestingCriterion]) } end diff --git a/test/openai/resources/fine_tuning/checkpoints/permissions_test.rb b/test/openai/resources/fine_tuning/checkpoints/permissions_test.rb index eb752c5f..0ed0d4c1 100644 --- a/test/openai/resources/fine_tuning/checkpoints/permissions_test.rb +++ b/test/openai/resources/fine_tuning/checkpoints/permissions_test.rb @@ -49,11 +49,12 @@ def test_retrieve end end - def test_delete - skip("OpenAPI spec is slightly incorrect") - + def test_delete_required_params response = - @openai.fine_tuning.checkpoints.permissions.delete("ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd") + @openai.fine_tuning.checkpoints.permissions.delete( + "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + fine_tuned_model_checkpoint: "ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd" + ) assert_pattern do response => OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteResponse diff --git a/test/openai/resources/images_test.rb b/test/openai/resources/images_test.rb index 867dc545..ccfee747 100644 --- a/test/openai/resources/images_test.rb +++ b/test/openai/resources/images_test.rb @@ -13,7 +13,8 @@ def test_create_variation_required_params assert_pattern do response => { created: Integer, - data: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image]) + data: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image]) | nil, + usage: OpenAI::Models::ImagesResponse::Usage | nil } end end @@ -29,7 +30,8 @@ def test_edit_required_params assert_pattern do response => { created: Integer, - data: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image]) + data: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image]) | nil, + usage: OpenAI::Models::ImagesResponse::Usage | nil } end end @@ -44,7 +46,8 @@ def test_generate_required_params assert_pattern do response => { created: Integer, - data: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image]) + data: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Image]) | nil, + usage: OpenAI::Models::ImagesResponse::Usage | nil } end end From 0ae14a87ecc37f73077f0aaa442047452a6503b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:56:20 +0000 Subject: [PATCH 09/33] chore(ci): run on more branches and use depot runners --- .github/workflows/ci.yml | 17 +++++++++-------- .github/workflows/publish-gem.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f7276bb..85872a3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,19 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 + steps: - uses: actions/checkout@v4 - name: Set up Ruby @@ -28,7 +29,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: Set up Ruby diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 7502f1c2..039f2cc9 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -7,7 +7,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 1659237f..87a98158 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 environment: publish if: github.repository == 'openai/openai-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') From 57a10b07135a824e8eee35e57a1d78f223befef9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 19:59:49 +0000 Subject: [PATCH 10/33] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-gem.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85872a3c..1d8dfaab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/openai-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -29,7 +29,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/openai-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 - name: Set up Ruby diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 039f2cc9..7502f1c2 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -7,7 +7,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 87a98158..1659237f 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest environment: publish if: github.repository == 'openai/openai-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') From 77f7239e03a45323f70baee9d1430ecec242705c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:09:17 +0000 Subject: [PATCH 11/33] chore: broadly detect json family of content-type headers --- lib/openai/internal/util.rb | 13 +++++++++---- rbi/lib/openai/internal/util.rbi | 3 +++ sig/openai/internal/util.rbs | 3 +++ test/openai/internal/util_test.rb | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/lib/openai/internal/util.rb b/lib/openai/internal/util.rb index d2eb9c19..fa6aec64 100644 --- a/lib/openai/internal/util.rb +++ b/lib/openai/internal/util.rb @@ -471,6 +471,11 @@ def writable_enum(&blk) end end + # @type [Regexp] + JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)} + # @type [Regexp] + JSONL_CONTENT = %r{^application/(?:x-)?jsonl} + class << self # @api private # @@ -563,9 +568,9 @@ def encode_content(headers, body) body = body.inner if body.is_a?(OpenAI::Internal::Util::SerializationAdapter) case [content_type, body] - in [%r{^application/(?:vnd\.api\+)?json}, Hash | Array | -> { primitive?(_1) }] + in [OpenAI::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }] [headers, JSON.fast_generate(body)] - in [%r{^application/(?:x-)?jsonl}, Enumerable] unless body.is_a?(StringIO) || body.is_a?(IO) + in [OpenAI::Internal::Util::JSONL_CONTENT, Enumerable] unless body.is_a?(StringIO) || body.is_a?(IO) [headers, body.lazy.map { JSON.fast_generate(_1) }] in [%r{^multipart/form-data}, Hash | Pathname | StringIO | IO] boundary, strio = encode_multipart_streaming(body) @@ -611,7 +616,7 @@ def force_charset!(content_type, text:) # @return [Object] def decode_content(headers, stream:, suppress_error: false) case (content_type = headers["content-type"]) - in %r{^application/(?:vnd\.api\+)?json} + in OpenAI::Internal::Util::JSON_CONTENT json = stream.to_a.join begin JSON.parse(json, symbolize_names: true) @@ -619,7 +624,7 @@ def decode_content(headers, stream:, suppress_error: false) raise e unless suppress_error json end - in %r{^application/(?:x-)?jsonl} + in OpenAI::Internal::Util::JSONL_CONTENT lines = decode_lines(stream) chain_fused(lines) do |y| lines.each { y << JSON.parse(_1, symbolize_names: true) } diff --git a/rbi/lib/openai/internal/util.rbi b/rbi/lib/openai/internal/util.rbi index 9b88505b..f1ca8cb7 100644 --- a/rbi/lib/openai/internal/util.rbi +++ b/rbi/lib/openai/internal/util.rbi @@ -192,6 +192,9 @@ module OpenAI def writable_enum(&blk); end end + JSON_CONTENT = T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp) + JSONL_CONTENT = T.let(%r{^application/(?:x-)?jsonl}, Regexp) + class << self # @api private sig do diff --git a/sig/openai/internal/util.rbs b/sig/openai/internal/util.rbs index 0f040af8..6c038865 100644 --- a/sig/openai/internal/util.rbs +++ b/sig/openai/internal/util.rbs @@ -103,6 +103,9 @@ module OpenAI (Enumerator::Yielder y) -> void } -> Enumerable[String] + JSON_CONTENT: Regexp + JSONL_CONTENT: Regexp + def self?.write_multipart_chunk: ( Enumerator::Yielder y, boundary: String, diff --git a/test/openai/internal/util_test.rb b/test/openai/internal/util_test.rb index e533fdd3..adae5642 100644 --- a/test/openai/internal/util_test.rb +++ b/test/openai/internal/util_test.rb @@ -157,6 +157,22 @@ def test_joining_queries end end +class OpenAI::Test::RegexMatchTest < Minitest::Test + def test_json_content + cases = { + "application/json" => true, + "application/jsonl" => false, + "application/vnd.github.v3+json" => true, + "application/vnd.api+json" => true + } + cases.each do |header, _verdict| + assert_pattern do + OpenAI::Internal::Util::JSON_CONTENT.match?(header) => verdict + end + end + end +end + class OpenAI::Test::UtilFormDataEncodingTest < Minitest::Test class FakeCGI < CGI def initialize(headers, io) From 9e1a0f1db37f0778063c2a417a55ac04fee1f1b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 05:15:45 +0000 Subject: [PATCH 12/33] feat: support webmock for testing --- Gemfile | 1 + Gemfile.lock | 13 + Rakefile | 2 +- lib/openai/internal/transport/base_client.rb | 2 +- .../transport/pooled_net_requester.rb | 2 +- .../openai/internal/transport/base_client.rbi | 2 +- sig/openai/internal/transport/base_client.rbs | 2 +- test/openai/client_test.rb | 270 ++++++++++-------- test/openai/test_helper.rb | 9 +- 9 files changed, 181 insertions(+), 122 deletions(-) diff --git a/Gemfile b/Gemfile index e5ec01e9..0d76364b 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ group :development, :test do gem "minitest-hooks" gem "minitest-proveit" gem "minitest-rg" + gem "webmock" end group :development, :docs do diff --git a/Gemfile.lock b/Gemfile.lock index 0891755f..6a6143f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,6 +29,8 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) async (2.23.1) console (~> 1.29) @@ -45,6 +47,9 @@ GEM fiber-annotation fiber-local (~> 1.1) json + crack (1.0.0) + bigdecimal + rexml csv (3.3.3) drb (2.2.1) erubi (1.13.1) @@ -54,6 +59,7 @@ GEM fiber-storage fiber-storage (1.0.0) fileutils (1.7.3) + hashdiff (1.1.2) i18n (1.14.7) concurrent-ruby (~> 1.0) io-event (1.10.0) @@ -82,6 +88,7 @@ GEM racc prettier_print (1.2.1) prism (1.4.0) + public_suffix (6.0.1) racc (1.8.1) rainbow (3.1.1) rake (13.2.1) @@ -96,6 +103,7 @@ GEM logger redcarpet (3.6.1) regexp_parser (2.10.0) + rexml (3.4.1) rubocop (1.75.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) @@ -165,6 +173,10 @@ GEM unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.3) + webmock (3.25.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) webrick (1.9.1) yard (0.9.37) yard-sorbet (0.9.0) @@ -191,6 +203,7 @@ DEPENDENCIES syntax_tree syntax_tree-rbs! tapioca + webmock webrick yard diff --git a/Rakefile b/Rakefile index dde46bf9..09924f69 100644 --- a/Rakefile +++ b/Rakefile @@ -31,7 +31,7 @@ multitask(:test) do .map { "require_relative(#{_1.dump});" } .join - ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } + ruby(*%w[-e], rb, verbose: false) { fail unless _1 } end rubo_find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0] diff --git a/lib/openai/internal/transport/base_client.rb b/lib/openai/internal/transport/base_client.rb index f3fd4559..8866d7ad 100644 --- a/lib/openai/internal/transport/base_client.rb +++ b/lib/openai/internal/transport/base_client.rb @@ -153,7 +153,7 @@ def reap_connection!(status, stream:) # @api private # @return [OpenAI::Internal::Transport::PooledNetRequester] - attr_accessor :requester + attr_reader :requester # @api private # diff --git a/lib/openai/internal/transport/pooled_net_requester.rb b/lib/openai/internal/transport/pooled_net_requester.rb index 67e58347..ce606177 100644 --- a/lib/openai/internal/transport/pooled_net_requester.rb +++ b/lib/openai/internal/transport/pooled_net_requester.rb @@ -176,7 +176,7 @@ def execute(request) conn.finish if !eof && conn&.started? closing&.call end - [Integer(response.code), response, (response.body = body)] + [Integer(response.code), response, body] end # @api private diff --git a/rbi/lib/openai/internal/transport/base_client.rbi b/rbi/lib/openai/internal/transport/base_client.rbi index 18a8ea43..73785f6c 100644 --- a/rbi/lib/openai/internal/transport/base_client.rbi +++ b/rbi/lib/openai/internal/transport/base_client.rbi @@ -93,7 +93,7 @@ module OpenAI # @api private sig { returns(OpenAI::Internal::Transport::PooledNetRequester) } - attr_accessor :requester + attr_reader :requester # @api private sig do diff --git a/sig/openai/internal/transport/base_client.rbs b/sig/openai/internal/transport/base_client.rbs index d66d0e62..acb379e9 100644 --- a/sig/openai/internal/transport/base_client.rbs +++ b/sig/openai/internal/transport/base_client.rbs @@ -53,7 +53,7 @@ module OpenAI ) -> void # @api private - attr_accessor requester: OpenAI::Internal::Transport::PooledNetRequester + attr_reader requester: OpenAI::Internal::Transport::PooledNetRequester def initialize: ( base_url: String, diff --git a/test/openai/client_test.rb b/test/openai/client_test.rb index 586ba30e..b084b1b5 100644 --- a/test/openai/client_test.rb +++ b/test/openai/client_test.rb @@ -3,12 +3,33 @@ require_relative "test_helper" class OpenAITest < Minitest::Test + include WebMock::API + + class << self + def test_order = :random + + def run_one_method(...) = Minitest::Runnable.run_one_method(...) + end + + def before_all + super + WebMock.enable! + end + def setup + super Thread.current.thread_variable_set(:mock_sleep, []) end def teardown Thread.current.thread_variable_set(:mock_sleep, nil) + WebMock.reset! + super + end + + def after_all + WebMock.disable! + super end def test_raises_on_missing_non_nullable_opts @@ -18,66 +39,34 @@ def test_raises_on_missing_non_nullable_opts assert_match(/is required/, e.message) end - class MockRequester - # @return [Integer] - attr_reader :response_code - - # @return [Hash{String=>String}] - attr_reader :response_headers - - # @return [Object] - attr_reader :response_data - - # @return [ArrayObject}>] - attr_accessor :attempts - - # @param response_code [Integer] - # @param response_headers [Hash{String=>String}] - # @param response_data [Object] - def initialize(response_code, response_headers, response_data) - @response_code = response_code - @response_headers = response_headers - @response_data = JSON.fast_generate(response_data) - @attempts = [] - end - - # @param req [Hash{Symbol=>Object}] - def execute(req) - # Deep copy the request because it is mutated on each retry. - attempts.push(Marshal.load(Marshal.dump(req))) - headers = {"content-type" => "application/json", **response_headers} - [response_code, headers, response_data.grapheme_clusters] - end - end - def test_client_default_request_default_retry_attempts - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(500, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 500, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-4.1") end - assert_equal(3, requester.attempts.length) + assert_requested(:any, /./, times: 3) end def test_client_given_request_default_retry_attempts - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 3) - requester = MockRequester.new(500, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 500, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 3) assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-4.1") end - assert_equal(4, requester.attempts.length) + assert_requested(:any, /./, times: 4) end def test_client_default_request_given_retry_attempts - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(500, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 500, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create( @@ -87,13 +76,13 @@ def test_client_default_request_given_retry_attempts ) end - assert_equal(4, requester.attempts.length) + assert_requested(:any, /./, times: 4) end def test_client_given_request_given_retry_attempts - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 3) - requester = MockRequester.new(500, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 500, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 3) assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create( @@ -103,26 +92,34 @@ def test_client_given_request_given_retry_attempts ) end - assert_equal(5, requester.attempts.length) + assert_requested(:any, /./, times: 5) end def test_client_retry_after_seconds - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 1) - requester = MockRequester.new(500, {"retry-after" => "1.3"}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json( + status: 500, + headers: {"retry-after" => "1.3"}, + body: {} + ) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-4.1") end - assert_equal(2, requester.attempts.length) + assert_requested(:any, /./, times: 2) assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) end def test_client_retry_after_date - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 1) - requester = MockRequester.new(500, {"retry-after" => (Time.now + 10).httpdate}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json( + status: 500, + headers: {"retry-after" => (Time.now + 10).httpdate}, + body: {} + ) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) assert_raises(OpenAI::Errors::InternalServerError) do Thread.current.thread_variable_set(:time_now, Time.now) @@ -130,43 +127,45 @@ def test_client_retry_after_date Thread.current.thread_variable_set(:time_now, nil) end - assert_equal(2, requester.attempts.length) + assert_requested(:any, /./, times: 2) assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0) end def test_client_retry_after_ms - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key", max_retries: 1) - requester = MockRequester.new(500, {"retry-after-ms" => "1300"}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json( + status: 500, + headers: {"retry-after-ms" => "1300"}, + body: {} + ) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key", max_retries: 1) assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-4.1") end - assert_equal(2, requester.attempts.length) + assert_requested(:any, /./, times: 2) assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) end def test_retry_count_header - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(500, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 500, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-4.1") end - retry_count_headers = requester.attempts.map do - _1.fetch(:headers).fetch("x-stainless-retry-count") + 3.times do + assert_requested(:any, /./, headers: {"x-stainless-retry-count" => _1}) end - - assert_equal(%w[0 1 2], retry_count_headers) end def test_omit_retry_count_header - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(500, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 500, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create( @@ -176,17 +175,15 @@ def test_omit_retry_count_header ) end - retry_count_headers = requester.attempts.map do - _1.fetch(:headers).fetch("x-stainless-retry-count", nil) + assert_requested(:any, /./, times: 3) do + refute_includes(_1.headers.keys.map(&:downcase), "x-stainless-retry-count") end - - assert_equal([nil, nil, nil], retry_count_headers) end def test_overwrite_retry_count_header - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(500, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 500, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::InternalServerError) do openai.chat.completions.create( @@ -196,17 +193,21 @@ def test_overwrite_retry_count_header ) end - retry_count_headers = requester.attempts.map do - _1.fetch(:headers).fetch("x-stainless-retry-count") - end - - assert_equal(%w[42 42 42], retry_count_headers) + assert_requested(:any, /./, headers: {"x-stainless-retry-count" => "42"}, times: 3) end def test_client_redirect_307 - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(307, {"location" => "/redirected"}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json( + status: 307, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:any, "http://localhost/redirected").to_return( + status: 307, + headers: {"location" => "/redirected"} + ) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::APIConnectionError) do openai.chat.completions.create( @@ -216,19 +217,30 @@ def test_client_redirect_307 ) end - assert_equal("/redirected", requester.attempts.last.fetch(:url).path) - assert_equal(requester.attempts.first.fetch(:method), requester.attempts.last.fetch(:method)) - assert_equal(requester.attempts.first.fetch(:body), requester.attempts.last.fetch(:body)) - assert_equal( - requester.attempts.first.fetch(:headers)["content-type"], - requester.attempts.last.fetch(:headers)["content-type"] - ) + recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first + + assert_requested(:any, "http://localhost/redirected", times: OpenAI::Client::MAX_REDIRECTS) do + assert_equal(recorded.method, _1.method) + assert_equal(recorded.body, _1.body) + assert_equal( + recorded.headers.transform_keys(&:downcase).fetch("content-type"), + _1.headers.transform_keys(&:downcase).fetch("content-type") + ) + end end def test_client_redirect_303 - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(303, {"location" => "/redirected"}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json( + status: 303, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:get, "http://localhost/redirected").to_return( + status: 303, + headers: {"location" => "/redirected"} + ) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::APIConnectionError) do openai.chat.completions.create( @@ -238,16 +250,25 @@ def test_client_redirect_303 ) end - assert_equal("/redirected", requester.attempts.last.fetch(:url).path) - assert_equal(:get, requester.attempts.last.fetch(:method)) - assert_nil(requester.attempts.last.fetch(:body)) - assert_nil(requester.attempts.last.fetch(:headers)["content-type"]) + assert_requested(:get, "http://localhost/redirected", times: OpenAI::Client::MAX_REDIRECTS) do + headers = _1.headers.keys.map(&:downcase) + refute_includes(headers, "content-type") + assert_nil(_1.body) + end end def test_client_redirect_auth_keep_same_origin - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(307, {"location" => "/redirected"}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json( + status: 307, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:any, "http://localhost/redirected").to_return( + status: 307, + headers: {"location" => "/redirected"} + ) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::APIConnectionError) do openai.chat.completions.create( @@ -257,16 +278,28 @@ def test_client_redirect_auth_keep_same_origin ) end - assert_equal( - requester.attempts.first.fetch(:headers)["authorization"], - requester.attempts.last.fetch(:headers)["authorization"] - ) + recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first + auth_header = recorded.headers.transform_keys(&:downcase).fetch("authorization") + + assert_equal("Bearer xyz", auth_header) + assert_requested(:any, "http://localhost/redirected", times: OpenAI::Client::MAX_REDIRECTS) do + auth_header = _1.headers.transform_keys(&:downcase).fetch("authorization") + assert_equal("Bearer xyz", auth_header) + end end def test_client_redirect_auth_strip_cross_origin - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(307, {"location" => "https://example.com/redirected"}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json( + status: 307, + headers: {"location" => "https://example.com/redirected"}, + body: {} + ) + stub_request(:any, "https://example.com/redirected").to_return( + status: 307, + headers: {"location" => "https://example.com/redirected"} + ) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") assert_raises(OpenAI::Errors::APIConnectionError) do openai.chat.completions.create( @@ -276,17 +309,22 @@ def test_client_redirect_auth_strip_cross_origin ) end - assert_nil(requester.attempts.last.fetch(:headers)["authorization"]) + assert_requested(:any, "https://example.com/redirected", times: OpenAI::Client::MAX_REDIRECTS) do + headers = _1.headers.keys.map(&:downcase) + refute_includes(headers, "authorization") + end end def test_default_headers - openai = OpenAI::Client.new(base_url: "http://localhost:4010", api_key: "My API Key") - requester = MockRequester.new(200, {}, {}) - openai.requester = requester + stub_request(:post, "http://localhost/chat/completions").to_return_json(status: 200, body: {}) + + openai = OpenAI::Client.new(base_url: "http://localhost", api_key: "My API Key") + openai.chat.completions.create(messages: [{content: "string", role: :developer}], model: :"gpt-4.1") - headers = requester.attempts.first.fetch(:headers) - refute_empty(headers["accept"]) - refute_empty(headers["content-type"]) + assert_requested(:any, /./) do |req| + headers = req.headers.transform_keys(&:downcase).fetch_values("accept", "content-type") + headers.each { refute_empty(_1) } + end end end diff --git a/test/openai/test_helper.rb b/test/openai/test_helper.rb index d0a5de2b..98b833aa 100644 --- a/test/openai/test_helper.rb +++ b/test/openai/test_helper.rb @@ -15,6 +15,7 @@ require "minitest/hooks/test" require "minitest/proveit" require "minitest/rg" +require "webmock" require_relative "../../lib/openai" require_relative "resource_namespaces" @@ -44,8 +45,10 @@ def self.now = Thread.current.thread_variable_get(:time_now) || _now class OpenAI::Test::SingletonClient < OpenAI::Client include Singleton + TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") + def initialize - super(base_url: ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010"), api_key: "My API Key") + super(base_url: OpenAI::Test::SingletonClient::TEST_API_BASE_URL, api_key: "My API Key") end end @@ -72,3 +75,7 @@ def around_all = async? ? Sync { super } : super def around = async? ? Async { super }.wait : super end + +module WebMock + AssertionFailure.error_class = Minitest::Assertion +end From bf844738622cd1c9a5c31bffc1e5378c132c31fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 07:10:26 +0000 Subject: [PATCH 13/33] chore: show truncated parameter docs in yard --- .../models/audio/speech_create_params.rb | 26 +- lib/openai/models/audio/transcription.rb | 17 +- .../audio/transcription_create_params.rb | 34 ++- .../models/audio/transcription_segment.rb | 35 ++- .../audio/transcription_text_delta_event.rb | 23 +- .../audio/transcription_text_done_event.rb | 23 +- .../models/audio/transcription_verbose.rb | 14 +- lib/openai/models/audio/transcription_word.rb | 8 +- .../models/audio/translation_create_params.rb | 23 +- .../models/audio/translation_verbose.rb | 11 +- .../auto_file_chunking_strategy_param.rb | 2 +- lib/openai/models/batch.rb | 61 +++-- lib/openai/models/batch_create_params.rb | 17 +- lib/openai/models/batch_error.rb | 11 +- lib/openai/models/batch_list_params.rb | 11 +- lib/openai/models/batch_request_counts.rb | 8 +- lib/openai/models/beta/assistant.rb | 61 +++-- .../models/beta/assistant_create_params.rb | 91 +++++-- .../models/beta/assistant_list_params.rb | 19 +- .../models/beta/assistant_stream_event.rb | 176 +++++++++++-- .../models/beta/assistant_tool_choice.rb | 3 +- .../beta/assistant_tool_choice_function.rb | 2 +- .../models/beta/assistant_update_params.rb | 57 ++++- .../models/beta/code_interpreter_tool.rb | 2 +- lib/openai/models/beta/file_search_tool.rb | 26 +- lib/openai/models/beta/function_tool.rb | 3 +- .../models/beta/message_stream_event.rb | 39 ++- .../models/beta/run_step_stream_event.rb | 49 +++- lib/openai/models/beta/run_stream_event.rb | 71 +++++- lib/openai/models/beta/thread.rb | 30 ++- .../beta/thread_create_and_run_params.rb | 168 ++++++++++--- .../models/beta/thread_create_params.rb | 83 +++++-- lib/openai/models/beta/thread_stream_event.rb | 10 +- .../models/beta/thread_update_params.rb | 24 +- .../beta/threads/file_citation_annotation.rb | 10 +- .../threads/file_citation_delta_annotation.rb | 16 +- .../beta/threads/file_path_annotation.rb | 10 +- .../threads/file_path_delta_annotation.rb | 13 +- lib/openai/models/beta/threads/image_file.rb | 10 +- .../beta/threads/image_file_content_block.rb | 3 +- .../models/beta/threads/image_file_delta.rb | 10 +- .../beta/threads/image_file_delta_block.rb | 6 +- lib/openai/models/beta/threads/image_url.rb | 10 +- .../beta/threads/image_url_content_block.rb | 3 +- .../models/beta/threads/image_url_delta.rb | 10 +- .../beta/threads/image_url_delta_block.rb | 6 +- lib/openai/models/beta/threads/message.rb | 57 +++-- .../beta/threads/message_create_params.rb | 22 +- .../models/beta/threads/message_delta.rb | 5 +- .../beta/threads/message_delta_event.rb | 8 +- .../beta/threads/message_list_params.rb | 22 +- .../beta/threads/message_update_params.rb | 7 +- .../beta/threads/refusal_content_block.rb | 3 +- .../beta/threads/refusal_delta_block.rb | 6 +- .../required_action_function_tool_call.rb | 19 +- lib/openai/models/beta/threads/run.rb | 133 +++++++--- .../models/beta/threads/run_create_params.rb | 100 ++++++-- .../models/beta/threads/run_list_params.rb | 19 +- .../threads/run_submit_tool_outputs_params.rb | 14 +- .../models/beta/threads/run_update_params.rb | 7 +- .../threads/runs/code_interpreter_logs.rb | 8 +- .../runs/code_interpreter_output_image.rb | 13 +- .../runs/code_interpreter_tool_call.rb | 37 ++- .../runs/code_interpreter_tool_call_delta.rb | 26 +- .../threads/runs/file_search_tool_call.rb | 50 +++- .../runs/file_search_tool_call_delta.rb | 15 +- .../beta/threads/runs/function_tool_call.rb | 25 +- .../threads/runs/function_tool_call_delta.rb | 28 ++- .../runs/message_creation_step_details.rb | 5 +- .../models/beta/threads/runs/run_step.rb | 70 ++++-- .../beta/threads/runs/run_step_delta.rb | 2 +- .../beta/threads/runs/run_step_delta_event.rb | 8 +- .../runs/run_step_delta_message_delta.rb | 5 +- .../beta/threads/runs/step_list_params.rb | 24 +- .../beta/threads/runs/step_retrieve_params.rb | 9 +- .../threads/runs/tool_call_delta_object.rb | 9 +- .../threads/runs/tool_calls_step_details.rb | 9 +- lib/openai/models/beta/threads/text.rb | 3 +- .../models/beta/threads/text_content_block.rb | 3 +- .../beta/threads/text_content_block_param.rb | 5 +- lib/openai/models/beta/threads/text_delta.rb | 3 +- .../models/beta/threads/text_delta_block.rb | 6 +- lib/openai/models/chat/chat_completion.rb | 49 ++-- ...chat_completion_assistant_message_param.rb | 42 +++- .../models/chat/chat_completion_audio.rb | 14 +- .../chat/chat_completion_audio_param.rb | 8 +- .../models/chat/chat_completion_chunk.rb | 93 +++++-- .../chat/chat_completion_content_part.rb | 14 +- .../chat_completion_content_part_image.rb | 13 +- ...hat_completion_content_part_input_audio.rb | 12 +- .../chat_completion_content_part_refusal.rb | 5 +- .../chat/chat_completion_content_part_text.rb | 5 +- .../models/chat/chat_completion_deleted.rb | 8 +- ...chat_completion_developer_message_param.rb | 12 +- .../chat_completion_function_call_option.rb | 2 +- .../chat_completion_function_message_param.rb | 8 +- .../models/chat/chat_completion_message.rb | 49 ++-- .../chat/chat_completion_message_tool_call.rb | 18 +- .../chat/chat_completion_named_tool_choice.rb | 5 +- .../chat_completion_prediction_content.rb | 8 +- .../chat/chat_completion_store_message.rb | 2 +- .../chat/chat_completion_stream_options.rb | 5 +- .../chat_completion_system_message_param.rb | 12 +- .../chat/chat_completion_token_logprob.rb | 30 ++- .../models/chat/chat_completion_tool.rb | 3 +- .../chat_completion_tool_message_param.rb | 8 +- .../chat_completion_user_message_param.rb | 12 +- .../models/chat/completion_create_params.rb | 147 ++++++++--- .../models/chat/completion_list_params.rb | 19 +- .../models/chat/completion_update_params.rb | 6 +- .../chat/completions/message_list_params.rb | 13 +- lib/openai/models/comparison_filter.rb | 12 +- lib/openai/models/completion.rb | 24 +- lib/openai/models/completion_choice.rb | 9 +- lib/openai/models/completion_create_params.rb | 65 +++-- lib/openai/models/completion_usage.rb | 33 ++- lib/openai/models/compound_filter.rb | 9 +- .../models/create_embedding_response.rb | 16 +- lib/openai/models/embedding.rb | 12 +- lib/openai/models/embedding_create_params.rb | 23 +- lib/openai/models/eval_create_params.rb | 135 +++++++--- lib/openai/models/eval_create_response.rb | 78 ++++-- .../models/eval_custom_data_source_config.rb | 8 +- lib/openai/models/eval_label_model_grader.rb | 35 ++- lib/openai/models/eval_list_params.rb | 16 +- lib/openai/models/eval_list_response.rb | 78 ++++-- lib/openai/models/eval_retrieve_response.rb | 78 ++++-- ...l_stored_completions_data_source_config.rb | 11 +- lib/openai/models/eval_string_check_grader.rb | 14 +- .../models/eval_text_similarity_grader.rb | 21 +- lib/openai/models/eval_update_params.rb | 9 +- lib/openai/models/eval_update_response.rb | 78 ++++-- ...create_eval_completions_run_data_source.rb | 91 +++++-- .../create_eval_jsonl_run_data_source.rb | 13 +- lib/openai/models/evals/eval_api_error.rb | 5 +- .../models/evals/run_cancel_response.rb | 203 ++++++++++----- lib/openai/models/evals/run_create_params.rb | 135 +++++++--- .../models/evals/run_create_response.rb | 203 ++++++++++----- lib/openai/models/evals/run_list_params.rb | 17 +- lib/openai/models/evals/run_list_response.rb | 203 ++++++++++----- .../models/evals/run_retrieve_response.rb | 203 ++++++++++----- .../evals/runs/output_item_list_params.rb | 17 +- .../evals/runs/output_item_list_response.rb | 82 +++--- .../runs/output_item_retrieve_response.rb | 83 ++++--- lib/openai/models/file_create_params.rb | 10 +- lib/openai/models/file_list_params.rb | 18 +- lib/openai/models/file_object.rb | 32 ++- .../checkpoints/permission_create_params.rb | 3 +- .../checkpoints/permission_create_response.rb | 11 +- .../checkpoints/permission_delete_response.rb | 8 +- .../checkpoints/permission_retrieve_params.rb | 12 +- .../permission_retrieve_response.rb | 11 +- .../models/fine_tuning/fine_tuning_job.rb | 141 ++++++++--- .../fine_tuning/fine_tuning_job_event.rb | 20 +- .../fine_tuning_job_wandb_integration.rb | 17 +- ...ine_tuning_job_wandb_integration_object.rb | 10 +- .../models/fine_tuning/job_create_params.rb | 120 ++++++--- .../fine_tuning/job_list_events_params.rb | 6 +- .../models/fine_tuning/job_list_params.rb | 13 +- .../jobs/checkpoint_list_params.rb | 6 +- .../jobs/fine_tuning_job_checkpoint.rb | 20 +- lib/openai/models/function_definition.rb | 18 +- lib/openai/models/image.rb | 13 +- .../models/image_create_variation_params.rb | 26 +- lib/openai/models/image_edit_params.rb | 38 ++- lib/openai/models/image_generate_params.rb | 49 +++- lib/openai/models/images_response.rb | 28 ++- lib/openai/models/model.rb | 11 +- lib/openai/models/moderation.rb | 142 +++++++---- lib/openai/models/moderation_create_params.rb | 10 +- .../models/moderation_create_response.rb | 8 +- .../models/moderation_image_url_input.rb | 7 +- lib/openai/models/moderation_text_input.rb | 5 +- .../other_file_chunking_strategy_object.rb | 2 +- lib/openai/models/reasoning.rb | 11 +- .../models/response_format_json_object.rb | 2 +- .../models/response_format_json_schema.rb | 22 +- lib/openai/models/response_format_text.rb | 2 +- lib/openai/models/responses/computer_tool.rb | 14 +- .../models/responses/easy_input_message.rb | 11 +- .../models/responses/file_search_tool.rb | 25 +- lib/openai/models/responses/function_tool.rb | 17 +- .../responses/input_item_list_params.rb | 18 +- lib/openai/models/responses/response.rb | 78 ++++-- .../responses/response_audio_delta_event.rb | 8 +- .../responses/response_audio_done_event.rb | 5 +- .../response_audio_transcript_delta_event.rb | 8 +- .../response_audio_transcript_done_event.rb | 5 +- ..._code_interpreter_call_code_delta_event.rb | 12 +- ...e_code_interpreter_call_code_done_event.rb | 12 +- ...e_code_interpreter_call_completed_event.rb | 12 +- ...code_interpreter_call_in_progress_event.rb | 12 +- ...ode_interpreter_call_interpreting_event.rb | 12 +- .../response_code_interpreter_tool_call.rb | 42 +++- .../responses/response_completed_event.rb | 8 +- .../responses/response_computer_tool_call.rb | 135 +++++++--- ...response_computer_tool_call_output_item.rb | 29 ++- ...se_computer_tool_call_output_screenshot.rb | 12 +- .../response_content_part_added_event.rb | 17 +- .../response_content_part_done_event.rb | 17 +- .../responses/response_create_params.rb | 62 +++-- .../responses/response_created_event.rb | 8 +- lib/openai/models/responses/response_error.rb | 8 +- .../models/responses/response_error_event.rb | 14 +- .../models/responses/response_failed_event.rb | 8 +- ...sponse_file_search_call_completed_event.rb | 12 +- ...onse_file_search_call_in_progress_event.rb | 12 +- ...sponse_file_search_call_searching_event.rb | 12 +- .../response_file_search_tool_call.rb | 35 ++- ...response_format_text_json_schema_config.rb | 18 +- ...nse_function_call_arguments_delta_event.rb | 17 +- ...onse_function_call_arguments_done_event.rb | 9 +- .../responses/response_function_tool_call.rb | 20 +- .../response_function_tool_call_item.rb | 5 +- ...response_function_tool_call_output_item.rb | 18 +- .../responses/response_function_web_search.rb | 11 +- .../responses/response_in_progress_event.rb | 8 +- .../responses/response_incomplete_event.rb | 8 +- .../models/responses/response_input_audio.rb | 11 +- .../models/responses/response_input_file.rb | 14 +- .../models/responses/response_input_image.rb | 14 +- .../models/responses/response_input_item.rb | 69 ++++-- .../responses/response_input_message_item.rb | 17 +- .../models/responses/response_input_text.rb | 8 +- .../models/responses/response_item_list.rb | 14 +- .../models/responses/response_output_audio.rb | 11 +- .../response_output_item_added_event.rb | 11 +- .../response_output_item_done_event.rb | 11 +- .../responses/response_output_message.rb | 17 +- .../responses/response_output_refusal.rb | 8 +- .../models/responses/response_output_text.rb | 53 ++-- .../responses/response_reasoning_item.rb | 22 +- ...onse_reasoning_summary_part_added_event.rb | 23 +- ...ponse_reasoning_summary_part_done_event.rb | 23 +- ...onse_reasoning_summary_text_delta_event.rb | 18 +- ...ponse_reasoning_summary_text_done_event.rb | 18 +- .../responses/response_refusal_delta_event.rb | 17 +- .../responses/response_refusal_done_event.rb | 17 +- .../responses/response_retrieve_params.rb | 6 +- .../response_text_annotation_delta_event.rb | 62 +++-- .../models/responses/response_text_config.rb | 5 +- .../responses/response_text_delta_event.rb | 17 +- .../responses/response_text_done_event.rb | 17 +- lib/openai/models/responses/response_usage.rb | 21 +- ...esponse_web_search_call_completed_event.rb | 12 +- ...ponse_web_search_call_in_progress_event.rb | 12 +- ...esponse_web_search_call_searching_event.rb | 12 +- .../models/responses/tool_choice_function.rb | 5 +- .../models/responses/tool_choice_types.rb | 5 +- .../models/responses/web_search_tool.rb | 26 +- .../models/static_file_chunking_strategy.rb | 10 +- .../static_file_chunking_strategy_object.rb | 3 +- ...tic_file_chunking_strategy_object_param.rb | 3 +- lib/openai/models/upload.rb | 30 ++- lib/openai/models/upload_complete_params.rb | 10 +- lib/openai/models/upload_create_params.rb | 15 +- .../models/uploads/part_create_params.rb | 6 +- lib/openai/models/uploads/upload_part.rb | 11 +- lib/openai/models/vector_store.rb | 57 +++-- .../models/vector_store_create_params.rb | 29 ++- lib/openai/models/vector_store_list_params.rb | 19 +- .../models/vector_store_search_params.rb | 19 +- .../models/vector_store_search_response.rb | 22 +- .../models/vector_store_update_params.rb | 21 +- .../vector_stores/file_batch_create_params.rb | 14 +- .../file_batch_list_files_params.rb | 24 +- .../vector_stores/file_content_response.rb | 5 +- .../vector_stores/file_create_params.rb | 14 +- .../models/vector_stores/file_list_params.rb | 23 +- .../vector_stores/file_update_params.rb | 7 +- .../models/vector_stores/vector_store_file.rb | 38 ++- .../vector_stores/vector_store_file_batch.rb | 35 ++- lib/openai/resources/audio/speech.rb | 26 +- lib/openai/resources/audio/transcriptions.rb | 68 +++-- lib/openai/resources/audio/translations.rb | 23 +- lib/openai/resources/batches.rb | 34 ++- lib/openai/resources/beta/assistants.rb | 114 ++++++--- lib/openai/resources/beta/threads.rb | 153 +++++++++--- lib/openai/resources/beta/threads/messages.rb | 74 ++++-- lib/openai/resources/beta/threads/runs.rb | 220 ++++++++++++---- .../resources/beta/threads/runs/steps.rb | 45 +++- lib/openai/resources/chat/completions.rb | 234 ++++++++++++------ .../resources/chat/completions/messages.rb | 16 +- lib/openai/resources/completions.rb | 130 +++++++--- lib/openai/resources/embeddings.rb | 23 +- lib/openai/resources/evals.rb | 49 +++- lib/openai/resources/evals/runs.rb | 53 ++-- .../resources/evals/runs/output_items.rb | 33 ++- lib/openai/resources/files.rb | 37 ++- .../fine_tuning/checkpoints/permissions.rb | 39 ++- lib/openai/resources/fine_tuning/jobs.rb | 69 ++++-- .../resources/fine_tuning/jobs/checkpoints.rb | 12 +- lib/openai/resources/images.rb | 113 +++++++-- lib/openai/resources/models.rb | 6 +- lib/openai/resources/moderations.rb | 10 +- lib/openai/resources/responses.rb | 136 +++++++--- lib/openai/resources/responses/input_items.rb | 21 +- lib/openai/resources/uploads.rb | 34 ++- lib/openai/resources/uploads/parts.rb | 9 +- lib/openai/resources/vector_stores.rb | 82 ++++-- .../resources/vector_stores/file_batches.rb | 58 +++-- lib/openai/resources/vector_stores/files.rb | 74 ++++-- .../models/audio/speech_create_params.rbi | 17 +- rbi/lib/openai/models/audio/transcription.rbi | 20 +- .../audio/transcription_create_params.rbi | 30 +++ .../models/audio/transcription_segment.rbi | 17 +- .../audio/transcription_text_delta_event.rbi | 22 +- .../audio/transcription_text_done_event.rbi | 23 +- .../models/audio/transcription_verbose.rbi | 14 +- .../models/audio/transcription_word.rbi | 10 +- .../audio/translation_create_params.rbi | 26 +- .../models/audio/translation_verbose.rbi | 12 +- .../auto_file_chunking_strategy_param.rbi | 6 +- rbi/lib/openai/models/batch.rbi | 30 ++- rbi/lib/openai/models/batch_create_params.rbi | 30 ++- rbi/lib/openai/models/batch_error.rbi | 12 +- rbi/lib/openai/models/batch_list_params.rbi | 13 +- .../openai/models/batch_request_counts.rbi | 10 +- rbi/lib/openai/models/beta/assistant.rbi | 70 +++++- .../models/beta/assistant_create_params.rbi | 120 ++++++++- .../models/beta/assistant_list_params.rbi | 21 +- .../models/beta/assistant_stream_event.rbi | 180 ++++++++++---- .../models/beta/assistant_tool_choice.rbi | 7 +- .../beta/assistant_tool_choice_function.rbi | 6 +- .../models/beta/assistant_update_params.rbi | 74 +++++- .../models/beta/code_interpreter_tool.rbi | 6 +- .../openai/models/beta/file_search_tool.rbi | 38 ++- rbi/lib/openai/models/beta/function_tool.rbi | 7 +- .../models/beta/message_stream_event.rbi | 40 ++- .../models/beta/run_step_stream_event.rbi | 50 ++-- .../openai/models/beta/run_stream_event.rbi | 80 ++++-- rbi/lib/openai/models/beta/thread.rbi | 39 ++- .../beta/thread_create_and_run_params.rbi | 221 +++++++++++++++-- .../models/beta/thread_create_params.rbi | 120 +++++++-- .../models/beta/thread_stream_event.rbi | 10 +- .../models/beta/thread_update_params.rbi | 34 ++- .../beta/threads/file_citation_annotation.rbi | 17 +- .../file_citation_delta_annotation.rbi | 15 +- .../beta/threads/file_path_annotation.rbi | 17 +- .../threads/file_path_delta_annotation.rbi | 20 +- .../openai/models/beta/threads/image_file.rbi | 11 +- .../beta/threads/image_file_content_block.rbi | 7 +- .../models/beta/threads/image_file_delta.rbi | 11 +- .../beta/threads/image_file_delta_block.rbi | 9 +- .../openai/models/beta/threads/image_url.rbi | 10 +- .../beta/threads/image_url_content_block.rbi | 7 +- .../models/beta/threads/image_url_delta.rbi | 10 +- .../beta/threads/image_url_delta_block.rbi | 9 +- .../openai/models/beta/threads/message.rbi | 45 +++- .../beta/threads/message_create_params.rbi | 37 ++- .../models/beta/threads/message_delta.rbi | 8 +- .../beta/threads/message_delta_event.rbi | 10 +- .../beta/threads/message_list_params.rbi | 23 +- .../beta/threads/message_update_params.rbi | 13 +- .../beta/threads/refusal_content_block.rbi | 7 +- .../beta/threads/refusal_delta_block.rbi | 9 +- .../required_action_function_tool_call.rbi | 22 +- rbi/lib/openai/models/beta/threads/run.rbi | 127 +++++++++- .../models/beta/threads/run_create_params.rbi | 133 +++++++++- .../models/beta/threads/run_list_params.rbi | 21 +- .../run_submit_tool_outputs_params.rbi | 17 +- .../models/beta/threads/run_update_params.rbi | 13 +- .../threads/runs/code_interpreter_logs.rbi | 10 +- .../runs/code_interpreter_output_image.rbi | 16 +- .../runs/code_interpreter_tool_call.rbi | 43 +++- .../runs/code_interpreter_tool_call_delta.rbi | 23 +- .../threads/runs/file_search_tool_call.rbi | 51 +++- .../runs/file_search_tool_call_delta.rbi | 13 +- .../beta/threads/runs/function_tool_call.rbi | 23 +- .../threads/runs/function_tool_call_delta.rbi | 25 +- .../runs/message_creation_step_details.rbi | 13 +- .../models/beta/threads/runs/run_step.rbi | 47 +++- .../beta/threads/runs/run_step_delta.rbi | 6 +- .../threads/runs/run_step_delta_event.rbi | 10 +- .../runs/run_step_delta_message_delta.rbi | 13 +- .../beta/threads/runs/step_list_params.rbi | 23 +- .../threads/runs/step_retrieve_params.rbi | 15 +- .../threads/runs/tool_call_delta_object.rbi | 10 +- .../threads/runs/tool_calls_step_details.rbi | 10 +- rbi/lib/openai/models/beta/threads/text.rbi | 7 +- .../beta/threads/text_content_block.rbi | 7 +- .../beta/threads/text_content_block_param.rbi | 8 +- .../openai/models/beta/threads/text_delta.rbi | 7 +- .../models/beta/threads/text_delta_block.rbi | 9 +- .../openai/models/chat/chat_completion.rbi | 53 +++- ...hat_completion_assistant_message_param.rbi | 32 ++- .../models/chat/chat_completion_audio.rbi | 14 +- .../chat/chat_completion_audio_param.rbi | 10 +- .../models/chat/chat_completion_chunk.rbi | 106 +++++++- .../chat/chat_completion_content_part.rbi | 18 +- .../chat_completion_content_part_image.rbi | 16 +- ...at_completion_content_part_input_audio.rbi | 15 +- .../chat_completion_content_part_refusal.rbi | 8 +- .../chat_completion_content_part_text.rbi | 8 +- .../models/chat/chat_completion_deleted.rbi | 10 +- ...hat_completion_developer_message_param.rbi | 11 +- .../chat_completion_function_call_option.rbi | 6 +- ...chat_completion_function_message_param.rbi | 10 +- .../models/chat/chat_completion_message.rbi | 46 +++- .../chat_completion_message_tool_call.rbi | 21 +- .../chat_completion_named_tool_choice.rbi | 13 +- .../chat_completion_prediction_content.rbi | 11 +- .../chat/chat_completion_store_message.rbi | 6 +- .../chat/chat_completion_stream_options.rbi | 12 +- .../chat_completion_system_message_param.rbi | 11 +- .../chat/chat_completion_token_logprob.rbi | 34 ++- .../models/chat/chat_completion_tool.rbi | 7 +- .../chat_completion_tool_message_param.rbi | 10 +- .../chat_completion_user_message_param.rbi | 11 +- .../models/chat/completion_create_params.rbi | 207 +++++++++++++++- .../models/chat/completion_list_params.rbi | 18 +- .../models/chat/completion_update_params.rbi | 12 +- .../chat/completions/message_list_params.rbi | 12 +- rbi/lib/openai/models/comparison_filter.rbi | 18 +- rbi/lib/openai/models/completion.rbi | 14 +- rbi/lib/openai/models/completion_choice.rbi | 12 +- .../models/completion_create_params.rbi | 88 +++++++ rbi/lib/openai/models/completion_usage.rbi | 25 +- rbi/lib/openai/models/compound_filter.rbi | 9 +- .../models/create_embedding_response.rbi | 20 +- rbi/lib/openai/models/embedding.rbi | 12 +- .../openai/models/embedding_create_params.rbi | 30 ++- rbi/lib/openai/models/eval_create_params.rbi | 125 ++++++++-- .../openai/models/eval_create_response.rbi | 68 ++++- .../models/eval_custom_data_source_config.rbi | 9 +- .../openai/models/eval_label_model_grader.rbi | 34 ++- rbi/lib/openai/models/eval_list_params.rbi | 15 +- rbi/lib/openai/models/eval_list_response.rbi | 68 ++++- .../openai/models/eval_retrieve_response.rbi | 68 ++++- ..._stored_completions_data_source_config.rbi | 16 +- .../models/eval_string_check_grader.rbi | 14 +- .../models/eval_text_similarity_grader.rbi | 11 +- rbi/lib/openai/models/eval_update_params.rbi | 14 +- .../openai/models/eval_update_response.rbi | 68 ++++- ...reate_eval_completions_run_data_source.rbi | 91 +++++-- .../create_eval_jsonl_run_data_source.rbi | 23 +- .../openai/models/evals/eval_api_error.rbi | 8 +- .../models/evals/run_cancel_response.rbi | 156 ++++++++++-- .../openai/models/evals/run_create_params.rbi | 120 +++++++-- .../models/evals/run_create_response.rbi | 156 ++++++++++-- .../openai/models/evals/run_list_params.rbi | 15 +- .../openai/models/evals/run_list_response.rbi | 156 ++++++++++-- .../models/evals/run_retrieve_response.rbi | 156 ++++++++++-- .../evals/runs/output_item_list_params.rbi | 16 +- .../evals/runs/output_item_list_response.rbi | 48 +++- .../runs/output_item_retrieve_response.rbi | 48 +++- rbi/lib/openai/models/file_create_params.rbi | 12 +- rbi/lib/openai/models/file_list_params.rbi | 18 +- rbi/lib/openai/models/file_object.rbi | 13 + .../checkpoints/permission_create_params.rbi | 7 +- .../permission_create_response.rbi | 12 +- .../permission_delete_response.rbi | 10 +- .../permission_retrieve_params.rbi | 13 +- .../permission_retrieve_response.rbi | 12 +- .../models/fine_tuning/fine_tuning_job.rbi | 111 +++++++-- .../fine_tuning/fine_tuning_job_event.rbi | 11 +- .../fine_tuning_job_wandb_integration.rbi | 17 +- ...ne_tuning_job_wandb_integration_object.rbi | 11 +- .../models/fine_tuning/job_create_params.rbi | 142 +++++++++-- .../fine_tuning/job_list_events_params.rbi | 9 +- .../models/fine_tuning/job_list_params.rbi | 12 +- .../jobs/checkpoint_list_params.rbi | 9 +- .../jobs/fine_tuning_job_checkpoint.rbi | 7 + rbi/lib/openai/models/function_definition.rbi | 24 +- rbi/lib/openai/models/image.rbi | 14 +- .../models/image_create_variation_params.rbi | 17 +- rbi/lib/openai/models/image_edit_params.rbi | 27 ++ .../openai/models/image_generate_params.rbi | 44 ++++ rbi/lib/openai/models/images_response.rbi | 30 ++- rbi/lib/openai/models/model.rbi | 12 +- rbi/lib/openai/models/moderation.rbi | 68 ++++- .../models/moderation_create_params.rbi | 13 +- .../models/moderation_create_response.rbi | 10 +- .../models/moderation_image_url_input.rbi | 14 +- .../openai/models/moderation_text_input.rbi | 8 +- .../other_file_chunking_strategy_object.rbi | 6 +- rbi/lib/openai/models/reasoning.rbi | 21 +- .../models/response_format_json_object.rbi | 6 +- .../models/response_format_json_schema.rbi | 27 +- .../openai/models/response_format_text.rbi | 6 +- .../openai/models/responses/computer_tool.rbi | 12 +- .../models/responses/easy_input_message.rbi | 12 +- .../models/responses/file_search_tool.rbi | 20 +- .../openai/models/responses/function_tool.rbi | 15 +- .../responses/input_item_list_params.rbi | 20 +- rbi/lib/openai/models/responses/response.rbi | 108 +++++++- .../responses/response_audio_delta_event.rbi | 8 +- .../responses/response_audio_done_event.rbi | 6 +- .../response_audio_transcript_delta_event.rbi | 8 +- .../response_audio_transcript_done_event.rbi | 6 +- ...code_interpreter_call_code_delta_event.rbi | 10 +- ..._code_interpreter_call_code_done_event.rbi | 10 +- ..._code_interpreter_call_completed_event.rbi | 7 +- ...ode_interpreter_call_in_progress_event.rbi | 7 +- ...de_interpreter_call_interpreting_event.rbi | 7 +- .../response_code_interpreter_tool_call.rbi | 37 ++- .../responses/response_completed_event.rbi | 8 +- .../responses/response_computer_tool_call.rbi | 136 ++++++++-- ...esponse_computer_tool_call_output_item.rbi | 22 +- ...e_computer_tool_call_output_screenshot.rbi | 11 +- .../response_content_part_added_event.rbi | 15 +- .../response_content_part_done_event.rbi | 14 +- .../responses/response_create_params.rbi | 104 ++++++++ .../responses/response_created_event.rbi | 8 +- .../models/responses/response_error.rbi | 8 +- .../models/responses/response_error_event.rbi | 12 +- .../responses/response_failed_event.rbi | 8 +- ...ponse_file_search_call_completed_event.rbi | 10 +- ...nse_file_search_call_in_progress_event.rbi | 10 +- ...ponse_file_search_call_searching_event.rbi | 10 +- .../response_file_search_tool_call.rbi | 33 ++- ...esponse_format_text_json_schema_config.rbi | 21 +- ...se_function_call_arguments_delta_event.rbi | 12 +- ...nse_function_call_arguments_done_event.rbi | 11 +- .../responses/response_function_tool_call.rbi | 17 +- .../response_function_tool_call_item.rbi | 6 +- ...esponse_function_tool_call_output_item.rbi | 15 +- .../response_function_web_search.rbi | 10 +- .../responses/response_in_progress_event.rbi | 8 +- .../responses/response_incomplete_event.rbi | 8 +- .../models/responses/response_input_audio.rbi | 10 +- .../models/responses/response_input_file.rbi | 12 +- .../models/responses/response_input_image.rbi | 14 +- .../models/responses/response_input_item.rbi | 60 ++++- .../responses/response_input_message_item.rbi | 16 +- .../models/responses/response_input_text.rbi | 8 +- .../models/responses/response_item_list.rbi | 14 +- .../responses/response_output_audio.rbi | 10 +- .../response_output_item_added_event.rbi | 10 +- .../response_output_item_done_event.rbi | 10 +- .../responses/response_output_message.rbi | 15 +- .../responses/response_output_refusal.rbi | 8 +- .../models/responses/response_output_text.rbi | 44 +++- .../responses/response_reasoning_item.rbi | 21 +- ...nse_reasoning_summary_part_added_event.rbi | 17 +- ...onse_reasoning_summary_part_done_event.rbi | 17 +- ...nse_reasoning_summary_text_delta_event.rbi | 9 +- ...onse_reasoning_summary_text_done_event.rbi | 9 +- .../response_refusal_delta_event.rbi | 14 +- .../responses/response_refusal_done_event.rbi | 14 +- .../responses/response_retrieve_params.rbi | 8 +- .../response_text_annotation_delta_event.rbi | 40 ++- .../models/responses/response_text_config.rbi | 18 +- .../responses/response_text_delta_event.rbi | 15 +- .../responses/response_text_done_event.rbi | 14 +- .../models/responses/response_usage.rbi | 22 +- ...sponse_web_search_call_completed_event.rbi | 10 +- ...onse_web_search_call_in_progress_event.rbi | 10 +- ...sponse_web_search_call_searching_event.rbi | 10 +- .../models/responses/tool_choice_function.rbi | 8 +- .../models/responses/tool_choice_types.rbi | 13 +- .../models/responses/web_search_tool.rbi | 29 ++- .../models/static_file_chunking_strategy.rbi | 11 +- .../static_file_chunking_strategy_object.rbi | 7 +- ...ic_file_chunking_strategy_object_param.rbi | 7 +- rbi/lib/openai/models/upload.rbi | 15 +- .../openai/models/upload_complete_params.rbi | 10 +- .../openai/models/upload_create_params.rbi | 19 +- .../models/uploads/part_create_params.rbi | 7 +- rbi/lib/openai/models/uploads/upload_part.rbi | 12 +- rbi/lib/openai/models/vector_store.rbi | 40 ++- .../models/vector_store_create_params.rbi | 26 +- .../models/vector_store_list_params.rbi | 21 +- .../models/vector_store_search_params.rbi | 10 +- .../models/vector_store_search_response.rbi | 26 +- .../models/vector_store_update_params.rbi | 25 +- .../file_batch_create_params.rbi | 18 +- .../file_batch_list_files_params.rbi | 17 +- .../vector_stores/file_content_response.rbi | 8 +- .../vector_stores/file_create_params.rbi | 18 +- .../models/vector_stores/file_list_params.rbi | 23 +- .../vector_stores/file_update_params.rbi | 12 +- .../vector_stores/vector_store_file.rbi | 28 ++- .../vector_stores/vector_store_file_batch.rbi | 28 ++- 574 files changed, 13164 insertions(+), 3670 deletions(-) diff --git a/lib/openai/models/audio/speech_create_params.rb b/lib/openai/models/audio/speech_create_params.rb index 114d8fa3..5ab05354 100644 --- a/lib/openai/models/audio/speech_create_params.rb +++ b/lib/openai/models/audio/speech_create_params.rb @@ -52,12 +52,26 @@ class SpeechCreateParams < OpenAI::Internal::Type::BaseModel optional :speed, Float # @!method initialize(input:, model:, voice:, instructions: nil, response_format: nil, speed: nil, request_options: {}) - # @param input [String] - # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] - # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] - # @param instructions [String] - # @param response_format [Symbol, OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat] - # @param speed [Float] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::SpeechCreateParams} for more details. + # + # @param input [String] The text to generate audio for. The maximum length is 4096 characters. + # + # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] One of the available [TTS models](https://platform.openai.com/docs/models#tts): + # ... + # + # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported voices are `alloy`, `ash`, + # ... + # + # @param instructions [String] Control the voice of your generated audio with additional instructions. Does not + # ... + # + # @param response_format [Symbol, OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat] The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav + # ... + # + # @param speed [Float] The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # One of the available [TTS models](https://platform.openai.com/docs/models#tts): diff --git a/lib/openai/models/audio/transcription.rb b/lib/openai/models/audio/transcription.rb index 96e65045..7f74deeb 100644 --- a/lib/openai/models/audio/transcription.rb +++ b/lib/openai/models/audio/transcription.rb @@ -19,11 +19,16 @@ class Transcription < OpenAI::Internal::Type::BaseModel optional :logprobs, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Audio::Transcription::Logprob] } # @!method initialize(text:, logprobs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::Transcription} for more details. + # # Represents a transcription response returned by model, based on the provided # input. # - # @param text [String] - # @param logprobs [Array] + # @param text [String] The transcribed text. + # + # @param logprobs [Array] The log probabilities of the tokens in the transcription. Only returned with the + # ... class Logprob < OpenAI::Internal::Type::BaseModel # @!attribute token @@ -45,9 +50,11 @@ class Logprob < OpenAI::Internal::Type::BaseModel optional :logprob, Float # @!method initialize(token: nil, bytes: nil, logprob: nil) - # @param token [String] - # @param bytes [Array] - # @param logprob [Float] + # @param token [String] The token in the transcription. + # + # @param bytes [Array] The bytes of the token. + # + # @param logprob [Float] The log probability of the token. end end end diff --git a/lib/openai/models/audio/transcription_create_params.rb b/lib/openai/models/audio/transcription_create_params.rb index 4377a2ab..ccb71b14 100644 --- a/lib/openai/models/audio/transcription_create_params.rb +++ b/lib/openai/models/audio/transcription_create_params.rb @@ -83,14 +83,32 @@ class TranscriptionCreateParams < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity] } # @!method initialize(file:, model:, include: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) - # @param file [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::AudioModel] - # @param include [Array] - # @param language [String] - # @param prompt [String] - # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] - # @param temperature [Float] - # @param timestamp_granularities [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionCreateParams} for more details. + # + # @param file [Pathname, StringIO] The audio file object (not file name) to transcribe, in one of these formats: fl + # ... + # + # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc + # ... + # + # @param include [Array] Additional information to include in the transcription response. ... + # + # @param language [String] The language of the input audio. Supplying the input language in [ISO-639-1](htt + # ... + # + # @param prompt [String] An optional text to guide the model's style or continue a previous audio segment + # ... + # + # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] The format of the output, in one of these options: `json`, `text`, `srt`, `verbo + # ... + # + # @param temperature [Float] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the + # ... + # + # @param timestamp_granularities [Array] The timestamp granularities to populate for this transcription. `response_format + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # ID of the model to use. The options are `gpt-4o-transcribe`, diff --git a/lib/openai/models/audio/transcription_segment.rb b/lib/openai/models/audio/transcription_segment.rb index 19923d2d..26c61c14 100644 --- a/lib/openai/models/audio/transcription_segment.rb +++ b/lib/openai/models/audio/transcription_segment.rb @@ -68,16 +68,31 @@ class TranscriptionSegment < OpenAI::Internal::Type::BaseModel required :tokens, OpenAI::Internal::Type::ArrayOf[Integer] # @!method initialize(id:, avg_logprob:, compression_ratio:, end_:, no_speech_prob:, seek:, start:, temperature:, text:, tokens:) - # @param id [Integer] - # @param avg_logprob [Float] - # @param compression_ratio [Float] - # @param end_ [Float] - # @param no_speech_prob [Float] - # @param seek [Integer] - # @param start [Float] - # @param temperature [Float] - # @param text [String] - # @param tokens [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionSegment} for more details. + # + # @param id [Integer] Unique identifier of the segment. + # + # @param avg_logprob [Float] Average logprob of the segment. If the value is lower than -1, consider the logp + # ... + # + # @param compression_ratio [Float] Compression ratio of the segment. If the value is greater than 2.4, consider the + # ... + # + # @param end_ [Float] End time of the segment in seconds. + # + # @param no_speech_prob [Float] Probability of no speech in the segment. If the value is higher than 1.0 and the + # ... + # + # @param seek [Integer] Seek offset of the segment. + # + # @param start [Float] Start time of the segment in seconds. + # + # @param temperature [Float] Temperature parameter used for generating the segment. + # + # @param text [String] Text content of the segment. + # + # @param tokens [Array] Array of token IDs for the text content. end end end diff --git a/lib/openai/models/audio/transcription_text_delta_event.rb b/lib/openai/models/audio/transcription_text_delta_event.rb index 7f9705d1..774f99c8 100644 --- a/lib/openai/models/audio/transcription_text_delta_event.rb +++ b/lib/openai/models/audio/transcription_text_delta_event.rb @@ -26,14 +26,20 @@ class TranscriptionTextDeltaEvent < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Audio::TranscriptionTextDeltaEvent::Logprob] } # @!method initialize(delta:, logprobs: nil, type: :"transcript.text.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionTextDeltaEvent} for more details. + # # Emitted when there is an additional text delta. This is also the first event # emitted when the transcription starts. Only emitted when you # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) # with the `Stream` parameter set to `true`. # - # @param delta [String] - # @param logprobs [Array] - # @param type [Symbol, :"transcript.text.delta"] + # @param delta [String] The text delta that was additionally transcribed. ... + # + # @param logprobs [Array] The log probabilities of the delta. Only included if you [create a transcription + # ... + # + # @param type [Symbol, :"transcript.text.delta"] The type of the event. Always `transcript.text.delta`. ... class Logprob < OpenAI::Internal::Type::BaseModel # @!attribute token @@ -55,9 +61,14 @@ class Logprob < OpenAI::Internal::Type::BaseModel optional :logprob, Float # @!method initialize(token: nil, bytes: nil, logprob: nil) - # @param token [String] - # @param bytes [Array] - # @param logprob [Float] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionTextDeltaEvent::Logprob} for more details. + # + # @param token [String] The token that was used to generate the log probability. ... + # + # @param bytes [Array] The bytes that were used to generate the log probability. ... + # + # @param logprob [Float] The log probability of the token. ... end end end diff --git a/lib/openai/models/audio/transcription_text_done_event.rb b/lib/openai/models/audio/transcription_text_done_event.rb index be7eb322..99dd1045 100644 --- a/lib/openai/models/audio/transcription_text_done_event.rb +++ b/lib/openai/models/audio/transcription_text_done_event.rb @@ -27,14 +27,20 @@ class TranscriptionTextDoneEvent < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Audio::TranscriptionTextDoneEvent::Logprob] } # @!method initialize(text:, logprobs: nil, type: :"transcript.text.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionTextDoneEvent} for more details. + # # Emitted when the transcription is complete. Contains the complete transcription # text. Only emitted when you # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) # with the `Stream` parameter set to `true`. # - # @param text [String] - # @param logprobs [Array] - # @param type [Symbol, :"transcript.text.done"] + # @param text [String] The text that was transcribed. ... + # + # @param logprobs [Array] The log probabilities of the individual tokens in the transcription. Only includ + # ... + # + # @param type [Symbol, :"transcript.text.done"] The type of the event. Always `transcript.text.done`. ... class Logprob < OpenAI::Internal::Type::BaseModel # @!attribute token @@ -56,9 +62,14 @@ class Logprob < OpenAI::Internal::Type::BaseModel optional :logprob, Float # @!method initialize(token: nil, bytes: nil, logprob: nil) - # @param token [String] - # @param bytes [Array] - # @param logprob [Float] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionTextDoneEvent::Logprob} for more details. + # + # @param token [String] The token that was used to generate the log probability. ... + # + # @param bytes [Array] The bytes that were used to generate the log probability. ... + # + # @param logprob [Float] The log probability of the token. ... end end end diff --git a/lib/openai/models/audio/transcription_verbose.rb b/lib/openai/models/audio/transcription_verbose.rb index ae9e3c77..361a380c 100644 --- a/lib/openai/models/audio/transcription_verbose.rb +++ b/lib/openai/models/audio/transcription_verbose.rb @@ -38,11 +38,15 @@ class TranscriptionVerbose < OpenAI::Internal::Type::BaseModel # Represents a verbose json transcription response returned by model, based on the # provided input. # - # @param duration [Float] - # @param language [String] - # @param text [String] - # @param segments [Array] - # @param words [Array] + # @param duration [Float] The duration of the input audio. + # + # @param language [String] The language of the input audio. + # + # @param text [String] The transcribed text. + # + # @param segments [Array] Segments of the transcribed text and their corresponding details. + # + # @param words [Array] Extracted words and their corresponding timestamps. end end end diff --git a/lib/openai/models/audio/transcription_word.rb b/lib/openai/models/audio/transcription_word.rb index f7f973cd..b9e5da59 100644 --- a/lib/openai/models/audio/transcription_word.rb +++ b/lib/openai/models/audio/transcription_word.rb @@ -23,9 +23,11 @@ class TranscriptionWord < OpenAI::Internal::Type::BaseModel required :word, String # @!method initialize(end_:, start:, word:) - # @param end_ [Float] - # @param start [Float] - # @param word [String] + # @param end_ [Float] End time of the word in seconds. + # + # @param start [Float] Start time of the word in seconds. + # + # @param word [String] The text content of the word. end end end diff --git a/lib/openai/models/audio/translation_create_params.rb b/lib/openai/models/audio/translation_create_params.rb index ce70c85f..a933aaa9 100644 --- a/lib/openai/models/audio/translation_create_params.rb +++ b/lib/openai/models/audio/translation_create_params.rb @@ -49,11 +49,24 @@ class TranslationCreateParams < OpenAI::Internal::Type::BaseModel optional :temperature, Float # @!method initialize(file:, model:, prompt: nil, response_format: nil, temperature: nil, request_options: {}) - # @param file [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::AudioModel] - # @param prompt [String] - # @param response_format [Symbol, OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat] - # @param temperature [Float] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranslationCreateParams} for more details. + # + # @param file [Pathname, StringIO] The audio file object (not file name) translate, in one of these formats: flac, + # ... + # + # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. Only `whisper-1` (which is powered by our open source Wh + # ... + # + # @param prompt [String] An optional text to guide the model's style or continue a previous audio segment + # ... + # + # @param response_format [Symbol, OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat] The format of the output, in one of these options: `json`, `text`, `srt`, `verbo + # ... + # + # @param temperature [Float] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # ID of the model to use. Only `whisper-1` (which is powered by our open source diff --git a/lib/openai/models/audio/translation_verbose.rb b/lib/openai/models/audio/translation_verbose.rb index c5c9c54c..8da3a73b 100644 --- a/lib/openai/models/audio/translation_verbose.rb +++ b/lib/openai/models/audio/translation_verbose.rb @@ -29,10 +29,13 @@ class TranslationVerbose < OpenAI::Internal::Type::BaseModel optional :segments, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Audio::TranscriptionSegment] } # @!method initialize(duration:, language:, text:, segments: nil) - # @param duration [Float] - # @param language [String] - # @param text [String] - # @param segments [Array] + # @param duration [Float] The duration of the input audio. + # + # @param language [String] The language of the output translation (always `english`). + # + # @param text [String] The translated text. + # + # @param segments [Array] Segments of the translated text and their corresponding details. end end end diff --git a/lib/openai/models/auto_file_chunking_strategy_param.rb b/lib/openai/models/auto_file_chunking_strategy_param.rb index 9065ad1c..0bb7685f 100644 --- a/lib/openai/models/auto_file_chunking_strategy_param.rb +++ b/lib/openai/models/auto_file_chunking_strategy_param.rb @@ -13,7 +13,7 @@ class AutoFileChunkingStrategyParam < OpenAI::Internal::Type::BaseModel # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. # - # @param type [Symbol, :auto] + # @param type [Symbol, :auto] Always `auto`. end end end diff --git a/lib/openai/models/batch.rb b/lib/openai/models/batch.rb index d8a84818..b2ceaa9b 100644 --- a/lib/openai/models/batch.rb +++ b/lib/openai/models/batch.rb @@ -128,26 +128,48 @@ class Batch < OpenAI::Internal::Type::BaseModel optional :request_counts, -> { OpenAI::Models::BatchRequestCounts } # @!method initialize(id:, completion_window:, created_at:, endpoint:, input_file_id:, status:, cancelled_at: nil, cancelling_at: nil, completed_at: nil, error_file_id: nil, errors: nil, expired_at: nil, expires_at: nil, failed_at: nil, finalizing_at: nil, in_progress_at: nil, metadata: nil, output_file_id: nil, request_counts: nil, object: :batch) + # Some parameter documentations has been truncated, see {OpenAI::Models::Batch} + # for more details. + # # @param id [String] - # @param completion_window [String] - # @param created_at [Integer] - # @param endpoint [String] - # @param input_file_id [String] - # @param status [Symbol, OpenAI::Models::Batch::Status] - # @param cancelled_at [Integer] - # @param cancelling_at [Integer] - # @param completed_at [Integer] - # @param error_file_id [String] + # + # @param completion_window [String] The time frame within which the batch should be processed. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the batch was created. + # + # @param endpoint [String] The OpenAI API endpoint used by the batch. + # + # @param input_file_id [String] The ID of the input file for the batch. + # + # @param status [Symbol, OpenAI::Models::Batch::Status] The current status of the batch. + # + # @param cancelled_at [Integer] The Unix timestamp (in seconds) for when the batch was cancelled. + # + # @param cancelling_at [Integer] The Unix timestamp (in seconds) for when the batch started cancelling. + # + # @param completed_at [Integer] The Unix timestamp (in seconds) for when the batch was completed. + # + # @param error_file_id [String] The ID of the file containing the outputs of requests with errors. + # # @param errors [OpenAI::Models::Batch::Errors] - # @param expired_at [Integer] - # @param expires_at [Integer] - # @param failed_at [Integer] - # @param finalizing_at [Integer] - # @param in_progress_at [Integer] - # @param metadata [Hash{Symbol=>String}, nil] - # @param output_file_id [String] - # @param request_counts [OpenAI::Models::BatchRequestCounts] - # @param object [Symbol, :batch] + # + # @param expired_at [Integer] The Unix timestamp (in seconds) for when the batch expired. + # + # @param expires_at [Integer] The Unix timestamp (in seconds) for when the batch will expire. + # + # @param failed_at [Integer] The Unix timestamp (in seconds) for when the batch failed. + # + # @param finalizing_at [Integer] The Unix timestamp (in seconds) for when the batch started finalizing. + # + # @param in_progress_at [Integer] The Unix timestamp (in seconds) for when the batch started processing. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param output_file_id [String] The ID of the file containing the outputs of successfully executed requests. + # + # @param request_counts [OpenAI::Models::BatchRequestCounts] The request counts for different statuses within the batch. + # + # @param object [Symbol, :batch] The object type, which is always `batch`. # The current status of the batch. # @@ -183,7 +205,8 @@ class Errors < OpenAI::Internal::Type::BaseModel # @!method initialize(data: nil, object: nil) # @param data [Array] - # @param object [String] + # + # @param object [String] The object type, which is always `list`. end end end diff --git a/lib/openai/models/batch_create_params.rb b/lib/openai/models/batch_create_params.rb index 9c5654db..e72da75d 100644 --- a/lib/openai/models/batch_create_params.rb +++ b/lib/openai/models/batch_create_params.rb @@ -49,10 +49,19 @@ class BatchCreateParams < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(completion_window:, endpoint:, input_file_id:, metadata: nil, request_options: {}) - # @param completion_window [Symbol, OpenAI::Models::BatchCreateParams::CompletionWindow] - # @param endpoint [Symbol, OpenAI::Models::BatchCreateParams::Endpoint] - # @param input_file_id [String] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::BatchCreateParams} for more details. + # + # @param completion_window [Symbol, OpenAI::Models::BatchCreateParams::CompletionWindow] The time frame within which the batch should be processed. Currently only `24h` + # ... + # + # @param endpoint [Symbol, OpenAI::Models::BatchCreateParams::Endpoint] The endpoint to be used for all requests in the batch. Currently `/v1/responses` + # ... + # + # @param input_file_id [String] The ID of an uploaded file that contains requests for the new batch. ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The time frame within which the batch should be processed. Currently only `24h` diff --git a/lib/openai/models/batch_error.rb b/lib/openai/models/batch_error.rb index 9d629686..538e1183 100644 --- a/lib/openai/models/batch_error.rb +++ b/lib/openai/models/batch_error.rb @@ -28,10 +28,13 @@ class BatchError < OpenAI::Internal::Type::BaseModel optional :param, String, nil?: true # @!method initialize(code: nil, line: nil, message: nil, param: nil) - # @param code [String] - # @param line [Integer, nil] - # @param message [String] - # @param param [String, nil] + # @param code [String] An error code identifying the error type. + # + # @param line [Integer, nil] The line number of the input file where the error occurred, if applicable. + # + # @param message [String] A human-readable message providing more details about the error. + # + # @param param [String, nil] The name of the parameter that caused the error, if applicable. end end end diff --git a/lib/openai/models/batch_list_params.rb b/lib/openai/models/batch_list_params.rb index 388dc273..f4b386d2 100644 --- a/lib/openai/models/batch_list_params.rb +++ b/lib/openai/models/batch_list_params.rb @@ -24,8 +24,15 @@ class BatchListParams < OpenAI::Internal::Type::BaseModel optional :limit, Integer # @!method initialize(after: nil, limit: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::BatchListParams} for more details. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/batch_request_counts.rb b/lib/openai/models/batch_request_counts.rb index dce46757..e8e7caf0 100644 --- a/lib/openai/models/batch_request_counts.rb +++ b/lib/openai/models/batch_request_counts.rb @@ -24,9 +24,11 @@ class BatchRequestCounts < OpenAI::Internal::Type::BaseModel # @!method initialize(completed:, failed:, total:) # The request counts for different statuses within the batch. # - # @param completed [Integer] - # @param failed [Integer] - # @param total [Integer] + # @param completed [Integer] Number of requests that have been completed successfully. + # + # @param failed [Integer] Number of requests that have failed. + # + # @param total [Integer] Total number of requests in the batch. end end end diff --git a/lib/openai/models/beta/assistant.rb b/lib/openai/models/beta/assistant.rb index a4069e36..1923fa0e 100644 --- a/lib/openai/models/beta/assistant.rb +++ b/lib/openai/models/beta/assistant.rb @@ -124,21 +124,43 @@ class Assistant < OpenAI::Internal::Type::BaseModel optional :top_p, Float, nil?: true # @!method initialize(id:, created_at:, description:, instructions:, metadata:, model:, name:, tools:, response_format: nil, temperature: nil, tool_resources: nil, top_p: nil, object: :assistant) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Assistant} for more details. + # # Represents an `assistant` that can call the model and use tools. # - # @param id [String] - # @param created_at [Integer] - # @param description [String, nil] - # @param instructions [String, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param name [String, nil] - # @param tools [Array] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_resources [OpenAI::Models::Beta::Assistant::ToolResources, nil] - # @param top_p [Float, nil] - # @param object [Symbol, :assistant] + # @param id [String] The identifier, which can be referenced in API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the assistant was created. + # + # @param description [String, nil] The description of the assistant. The maximum length is 512 characters. ... + # + # @param instructions [String, nil] The system instructions that the assistant uses. The maximum length is 256,000 c + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param name [String, nil] The name of the assistant. The maximum length is 256 characters. ... + # + # @param tools [Array] A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_resources [OpenAI::Models::Beta::Assistant::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param object [Symbol, :assistant] The object type, which is always `assistant`. # @see OpenAI::Models::Beta::Assistant#tool_resources class ToolResources < OpenAI::Internal::Type::BaseModel @@ -172,7 +194,12 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Assistant::ToolResources::CodeInterpreter} for more + # details. + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # ... end # @see OpenAI::Models::Beta::Assistant::ToolResources#file_search @@ -187,7 +214,11 @@ class FileSearch < OpenAI::Internal::Type::BaseModel optional :vector_store_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(vector_store_ids: nil) - # @param vector_store_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Assistant::ToolResources::FileSearch} for more details. + # + # @param vector_store_ids [Array] The ID of the [vector store](https://platform.openai.com/docs/api-reference/vect + # ... end end end diff --git a/lib/openai/models/beta/assistant_create_params.rb b/lib/openai/models/beta/assistant_create_params.rb index 089e0fe9..3870f034 100644 --- a/lib/openai/models/beta/assistant_create_params.rb +++ b/lib/openai/models/beta/assistant_create_params.rb @@ -120,17 +120,38 @@ class AssistantCreateParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float, nil?: true # @!method initialize(model:, description: nil, instructions: nil, metadata: nil, name: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_resources: nil, tools: nil, top_p: nil, request_options: {}) - # @param model [String, Symbol, OpenAI::Models::ChatModel] - # @param description [String, nil] - # @param instructions [String, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_resources [OpenAI::Models::Beta::AssistantCreateParams::ToolResources, nil] - # @param tools [Array] - # @param top_p [Float, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantCreateParams} for more details. + # + # @param model [String, Symbol, OpenAI::Models::ChatModel] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param description [String, nil] The description of the assistant. The maximum length is 512 characters. ... + # + # @param instructions [String, nil] The system instructions that the assistant uses. The maximum length is 256,000 c + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String, nil] The name of the assistant. The maximum length is 256 characters. ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_resources [OpenAI::Models::Beta::AssistantCreateParams::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param tools [Array] A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # ID of the model to use. You can use the @@ -182,7 +203,12 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantCreateParams::ToolResources::CodeInterpreter} + # for more details. + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # ... end # @see OpenAI::Models::Beta::AssistantCreateParams::ToolResources#file_search @@ -207,8 +233,15 @@ class FileSearch < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore] } # @!method initialize(vector_store_ids: nil, vector_stores: nil) - # @param vector_store_ids [Array] - # @param vector_stores [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch} for + # more details. + # + # @param vector_store_ids [Array] The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/ + # ... + # + # @param vector_stores [Array] A helper to create a [vector store](https://platform.openai.com/docs/api-referen + # ... class VectorStore < OpenAI::Internal::Type::BaseModel # @!attribute chunking_strategy @@ -239,9 +272,17 @@ class VectorStore < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(chunking_strategy: nil, file_ids: nil, metadata: nil) - # @param chunking_strategy [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static] - # @param file_ids [Array] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore} + # for more details. + # + # @param chunking_strategy [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to ad + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... # The chunking strategy used to chunk the file(s). If not set, will use the `auto` # strategy. @@ -270,7 +311,7 @@ class Auto < OpenAI::Internal::Type::BaseModel # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. # - # @param type [Symbol, :auto] + # @param type [Symbol, :auto] Always `auto`. end class Static < OpenAI::Internal::Type::BaseModel @@ -288,7 +329,8 @@ class Static < OpenAI::Internal::Type::BaseModel # @!method initialize(static:, type: :static) # @param static [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static] - # @param type [Symbol, :static] + # + # @param type [Symbol, :static] Always `static`. # @see OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static#static class Static < OpenAI::Internal::Type::BaseModel @@ -308,8 +350,15 @@ class Static < OpenAI::Internal::Type::BaseModel required :max_chunk_size_tokens, Integer # @!method initialize(chunk_overlap_tokens:, max_chunk_size_tokens:) - # @param chunk_overlap_tokens [Integer] - # @param max_chunk_size_tokens [Integer] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static} + # for more details. + # + # @param chunk_overlap_tokens [Integer] The number of tokens that overlap between chunks. The default value is `400`. + # ... + # + # @param max_chunk_size_tokens [Integer] The maximum number of tokens in each chunk. The default value is `800`. The mini + # ... end end diff --git a/lib/openai/models/beta/assistant_list_params.rb b/lib/openai/models/beta/assistant_list_params.rb index 5d3b268b..a3c95fe0 100644 --- a/lib/openai/models/beta/assistant_list_params.rb +++ b/lib/openai/models/beta/assistant_list_params.rb @@ -41,10 +41,21 @@ class AssistantListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::Beta::AssistantListParams::Order } # @!method initialize(after: nil, before: nil, limit: nil, order: nil, request_options: {}) - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::AssistantListParams::Order] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantListParams} for more details. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::AssistantListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order by the `created_at` timestamp of the objects. `asc` for ascending diff --git a/lib/openai/models/beta/assistant_stream_event.rb b/lib/openai/models/beta/assistant_stream_event.rb index eaa92aba..b048ee92 100644 --- a/lib/openai/models/beta/assistant_stream_event.rb +++ b/lib/openai/models/beta/assistant_stream_event.rb @@ -129,12 +129,18 @@ class ThreadCreated < OpenAI::Internal::Type::BaseModel optional :enabled, OpenAI::Internal::Type::Boolean # @!method initialize(data:, enabled: nil, event: :"thread.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadCreated} for more details. + # # Occurs when a new # [thread](https://platform.openai.com/docs/api-reference/threads/object) is # created. # - # @param data [OpenAI::Models::Beta::Thread] - # @param enabled [Boolean] + # @param data [OpenAI::Models::Beta::Thread] Represents a thread that contains [messages](https://platform.openai.com/docs/ap + # ... + # + # @param enabled [Boolean] Whether to enable input audio transcription. + # # @param event [Symbol, :"thread.created"] end @@ -152,10 +158,15 @@ class ThreadRunCreated < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.created" # @!method initialize(data:, event: :"thread.run.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCreated} for more details. + # # Occurs when a new # [run](https://platform.openai.com/docs/api-reference/runs/object) is created. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.created"] end @@ -173,10 +184,15 @@ class ThreadRunQueued < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.queued" # @!method initialize(data:, event: :"thread.run.queued") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunQueued} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `queued` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.queued"] end @@ -194,10 +210,16 @@ class ThreadRunInProgress < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.in_progress" # @!method initialize(data:, event: :"thread.run.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunInProgress} for more + # details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to an `in_progress` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.in_progress"] end @@ -215,10 +237,16 @@ class ThreadRunRequiresAction < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.requires_action" # @!method initialize(data:, event: :"thread.run.requires_action") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunRequiresAction} for more + # details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `requires_action` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.requires_action"] end @@ -236,10 +264,16 @@ class ThreadRunCompleted < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.completed" # @!method initialize(data:, event: :"thread.run.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCompleted} for more + # details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is completed. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.completed"] end @@ -257,10 +291,16 @@ class ThreadRunIncomplete < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.incomplete" # @!method initialize(data:, event: :"thread.run.incomplete") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunIncomplete} for more + # details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # ends with status `incomplete`. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.incomplete"] end @@ -278,10 +318,15 @@ class ThreadRunFailed < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.failed" # @!method initialize(data:, event: :"thread.run.failed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunFailed} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # fails. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.failed"] end @@ -299,10 +344,16 @@ class ThreadRunCancelling < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.cancelling" # @!method initialize(data:, event: :"thread.run.cancelling") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCancelling} for more + # details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `cancelling` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.cancelling"] end @@ -320,10 +371,16 @@ class ThreadRunCancelled < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.cancelled" # @!method initialize(data:, event: :"thread.run.cancelled") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCancelled} for more + # details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is cancelled. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.cancelled"] end @@ -341,10 +398,15 @@ class ThreadRunExpired < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.expired" # @!method initialize(data:, event: :"thread.run.expired") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunExpired} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # expires. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.expired"] end @@ -361,11 +423,16 @@ class ThreadRunStepCreated < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.created" # @!method initialize(data:, event: :"thread.run.step.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCreated} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # is created. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.created"] end @@ -382,11 +449,16 @@ class ThreadRunStepInProgress < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.in_progress" # @!method initialize(data:, event: :"thread.run.step.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepInProgress} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # moves to an `in_progress` state. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.in_progress"] end @@ -404,11 +476,17 @@ class ThreadRunStepDelta < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.delta" # @!method initialize(data:, event: :"thread.run.step.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepDelta} for more + # details. + # # Occurs when parts of a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # are being streamed. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent] Represents a run step delta i.e. any changed fields on a run step during streami + # ... + # # @param event [Symbol, :"thread.run.step.delta"] end @@ -425,11 +503,16 @@ class ThreadRunStepCompleted < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.completed" # @!method initialize(data:, event: :"thread.run.step.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCompleted} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # is completed. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.completed"] end @@ -446,11 +529,16 @@ class ThreadRunStepFailed < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.failed" # @!method initialize(data:, event: :"thread.run.step.failed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepFailed} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # fails. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.failed"] end @@ -467,11 +555,16 @@ class ThreadRunStepCancelled < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.cancelled" # @!method initialize(data:, event: :"thread.run.step.cancelled") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCancelled} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # is cancelled. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.cancelled"] end @@ -488,11 +581,16 @@ class ThreadRunStepExpired < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.expired" # @!method initialize(data:, event: :"thread.run.step.expired") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepExpired} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # expires. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.expired"] end @@ -510,11 +608,17 @@ class ThreadMessageCreated < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.created" # @!method initialize(data:, event: :"thread.message.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageCreated} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is # created. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.created"] end @@ -532,11 +636,17 @@ class ThreadMessageInProgress < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.in_progress" # @!method initialize(data:, event: :"thread.message.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageInProgress} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) moves # to an `in_progress` state. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.in_progress"] end @@ -554,11 +664,17 @@ class ThreadMessageDelta < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.delta" # @!method initialize(data:, event: :"thread.message.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageDelta} for more + # details. + # # Occurs when parts of a # [Message](https://platform.openai.com/docs/api-reference/messages/object) are # being streamed. # - # @param data [OpenAI::Models::Beta::Threads::MessageDeltaEvent] + # @param data [OpenAI::Models::Beta::Threads::MessageDeltaEvent] Represents a message delta i.e. any changed fields on a message during streaming + # ... + # # @param event [Symbol, :"thread.message.delta"] end @@ -576,11 +692,17 @@ class ThreadMessageCompleted < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.completed" # @!method initialize(data:, event: :"thread.message.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageCompleted} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is # completed. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.completed"] end @@ -598,11 +720,17 @@ class ThreadMessageIncomplete < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.incomplete" # @!method initialize(data:, event: :"thread.message.incomplete") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageIncomplete} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) ends # before it is completed. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.incomplete"] end diff --git a/lib/openai/models/beta/assistant_tool_choice.rb b/lib/openai/models/beta/assistant_tool_choice.rb index 43914c38..43582de3 100644 --- a/lib/openai/models/beta/assistant_tool_choice.rb +++ b/lib/openai/models/beta/assistant_tool_choice.rb @@ -19,7 +19,8 @@ class AssistantToolChoice < OpenAI::Internal::Type::BaseModel # Specifies a tool the model should use. Use to force the model to call a specific # tool. # - # @param type [Symbol, OpenAI::Models::Beta::AssistantToolChoice::Type] + # @param type [Symbol, OpenAI::Models::Beta::AssistantToolChoice::Type] The type of the tool. If type is `function`, the function name must be set + # # @param function [OpenAI::Models::Beta::AssistantToolChoiceFunction] # The type of the tool. If type is `function`, the function name must be set diff --git a/lib/openai/models/beta/assistant_tool_choice_function.rb b/lib/openai/models/beta/assistant_tool_choice_function.rb index 87065a84..8440fb98 100644 --- a/lib/openai/models/beta/assistant_tool_choice_function.rb +++ b/lib/openai/models/beta/assistant_tool_choice_function.rb @@ -11,7 +11,7 @@ class AssistantToolChoiceFunction < OpenAI::Internal::Type::BaseModel required :name, String # @!method initialize(name:) - # @param name [String] + # @param name [String] The name of the function to call. end end end diff --git a/lib/openai/models/beta/assistant_update_params.rb b/lib/openai/models/beta/assistant_update_params.rb index c0a93261..d507c550 100644 --- a/lib/openai/models/beta/assistant_update_params.rb +++ b/lib/openai/models/beta/assistant_update_params.rb @@ -120,17 +120,38 @@ class AssistantUpdateParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float, nil?: true # @!method initialize(description: nil, instructions: nil, metadata: nil, model: nil, name: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_resources: nil, tools: nil, top_p: nil, request_options: {}) - # @param description [String, nil] - # @param instructions [String, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::Beta::AssistantUpdateParams::Model] - # @param name [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_resources [OpenAI::Models::Beta::AssistantUpdateParams::ToolResources, nil] - # @param tools [Array] - # @param top_p [Float, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantUpdateParams} for more details. + # + # @param description [String, nil] The description of the assistant. The maximum length is 512 characters. ... + # + # @param instructions [String, nil] The system instructions that the assistant uses. The maximum length is 256,000 c + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, Symbol, OpenAI::Models::Beta::AssistantUpdateParams::Model] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param name [String, nil] The name of the assistant. The maximum length is 256 characters. ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_resources [OpenAI::Models::Beta::AssistantUpdateParams::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param tools [Array] A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # ID of the model to use. You can use the @@ -293,7 +314,12 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter} + # for more details. + # + # @param file_ids [Array] Overrides the list of [file](https://platform.openai.com/docs/api-reference/file + # ... end # @see OpenAI::Models::Beta::AssistantUpdateParams::ToolResources#file_search @@ -308,7 +334,12 @@ class FileSearch < OpenAI::Internal::Type::BaseModel optional :vector_store_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(vector_store_ids: nil) - # @param vector_store_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::FileSearch} for + # more details. + # + # @param vector_store_ids [Array] Overrides the [vector store](https://platform.openai.com/docs/api-reference/vect + # ... end end end diff --git a/lib/openai/models/beta/code_interpreter_tool.rb b/lib/openai/models/beta/code_interpreter_tool.rb index ffea0d31..ee84099e 100644 --- a/lib/openai/models/beta/code_interpreter_tool.rb +++ b/lib/openai/models/beta/code_interpreter_tool.rb @@ -11,7 +11,7 @@ class CodeInterpreterTool < OpenAI::Internal::Type::BaseModel required :type, const: :code_interpreter # @!method initialize(type: :code_interpreter) - # @param type [Symbol, :code_interpreter] + # @param type [Symbol, :code_interpreter] The type of tool being defined: `code_interpreter` end end end diff --git a/lib/openai/models/beta/file_search_tool.rb b/lib/openai/models/beta/file_search_tool.rb index 9dc13172..2dbd7d7a 100644 --- a/lib/openai/models/beta/file_search_tool.rb +++ b/lib/openai/models/beta/file_search_tool.rb @@ -17,8 +17,9 @@ class FileSearchTool < OpenAI::Internal::Type::BaseModel optional :file_search, -> { OpenAI::Models::Beta::FileSearchTool::FileSearch } # @!method initialize(file_search: nil, type: :file_search) - # @param file_search [OpenAI::Models::Beta::FileSearchTool::FileSearch] - # @param type [Symbol, :file_search] + # @param file_search [OpenAI::Models::Beta::FileSearchTool::FileSearch] Overrides for the file search tool. + # + # @param type [Symbol, :file_search] The type of tool being defined: `file_search` # @see OpenAI::Models::Beta::FileSearchTool#file_search class FileSearch < OpenAI::Internal::Type::BaseModel @@ -47,10 +48,16 @@ class FileSearch < OpenAI::Internal::Type::BaseModel optional :ranking_options, -> { OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions } # @!method initialize(max_num_results: nil, ranking_options: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::FileSearchTool::FileSearch} for more details. + # # Overrides for the file search tool. # - # @param max_num_results [Integer] - # @param ranking_options [OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions] + # @param max_num_results [Integer] The maximum number of results the file search tool should output. The default is + # ... + # + # @param ranking_options [OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions] The ranking options for the file search. If not specified, the file search tool + # ... # @see OpenAI::Models::Beta::FileSearchTool::FileSearch#ranking_options class RankingOptions < OpenAI::Internal::Type::BaseModel @@ -69,6 +76,10 @@ class RankingOptions < OpenAI::Internal::Type::BaseModel optional :ranker, enum: -> { OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions::Ranker } # @!method initialize(score_threshold:, ranker: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions} for more + # details. + # # The ranking options for the file search. If not specified, the file search tool # will use the `auto` ranker and a score_threshold of 0. # @@ -76,8 +87,11 @@ class RankingOptions < OpenAI::Internal::Type::BaseModel # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) # for more information. # - # @param score_threshold [Float] - # @param ranker [Symbol, OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions::Ranker] + # @param score_threshold [Float] The score threshold for the file search. All values must be a floating point num + # ... + # + # @param ranker [Symbol, OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions::Ranker] The ranker to use for the file search. If not specified will use the `auto` rank + # ... # The ranker to use for the file search. If not specified will use the `auto` # ranker. diff --git a/lib/openai/models/beta/function_tool.rb b/lib/openai/models/beta/function_tool.rb index bce8c29a..4a76a200 100644 --- a/lib/openai/models/beta/function_tool.rb +++ b/lib/openai/models/beta/function_tool.rb @@ -17,7 +17,8 @@ class FunctionTool < OpenAI::Internal::Type::BaseModel # @!method initialize(function:, type: :function) # @param function [OpenAI::Models::FunctionDefinition] - # @param type [Symbol, :function] + # + # @param type [Symbol, :function] The type of tool being defined: `function` end end end diff --git a/lib/openai/models/beta/message_stream_event.rb b/lib/openai/models/beta/message_stream_event.rb index 74bb507a..77a99a07 100644 --- a/lib/openai/models/beta/message_stream_event.rb +++ b/lib/openai/models/beta/message_stream_event.rb @@ -43,11 +43,17 @@ class ThreadMessageCreated < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.created" # @!method initialize(data:, event: :"thread.message.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::MessageStreamEvent::ThreadMessageCreated} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is # created. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.created"] end @@ -65,11 +71,17 @@ class ThreadMessageInProgress < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.in_progress" # @!method initialize(data:, event: :"thread.message.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::MessageStreamEvent::ThreadMessageInProgress} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) moves # to an `in_progress` state. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.in_progress"] end @@ -87,11 +99,16 @@ class ThreadMessageDelta < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.delta" # @!method initialize(data:, event: :"thread.message.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::MessageStreamEvent::ThreadMessageDelta} for more details. + # # Occurs when parts of a # [Message](https://platform.openai.com/docs/api-reference/messages/object) are # being streamed. # - # @param data [OpenAI::Models::Beta::Threads::MessageDeltaEvent] + # @param data [OpenAI::Models::Beta::Threads::MessageDeltaEvent] Represents a message delta i.e. any changed fields on a message during streaming + # ... + # # @param event [Symbol, :"thread.message.delta"] end @@ -109,11 +126,17 @@ class ThreadMessageCompleted < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.completed" # @!method initialize(data:, event: :"thread.message.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::MessageStreamEvent::ThreadMessageCompleted} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is # completed. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.completed"] end @@ -131,11 +154,17 @@ class ThreadMessageIncomplete < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.message.incomplete" # @!method initialize(data:, event: :"thread.message.incomplete") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::MessageStreamEvent::ThreadMessageIncomplete} for more + # details. + # # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) ends # before it is completed. # - # @param data [OpenAI::Models::Beta::Threads::Message] + # @param data [OpenAI::Models::Beta::Threads::Message] Represents a message within a [thread](https://platform.openai.com/docs/api-refe + # ... + # # @param event [Symbol, :"thread.message.incomplete"] end diff --git a/lib/openai/models/beta/run_step_stream_event.rb b/lib/openai/models/beta/run_step_stream_event.rb index e312bf45..f876f01e 100644 --- a/lib/openai/models/beta/run_step_stream_event.rb +++ b/lib/openai/models/beta/run_step_stream_event.rb @@ -48,11 +48,16 @@ class ThreadRunStepCreated < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.created" # @!method initialize(data:, event: :"thread.run.step.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStepStreamEvent::ThreadRunStepCreated} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # is created. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.created"] end @@ -69,11 +74,16 @@ class ThreadRunStepInProgress < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.in_progress" # @!method initialize(data:, event: :"thread.run.step.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStepStreamEvent::ThreadRunStepInProgress} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # moves to an `in_progress` state. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.in_progress"] end @@ -91,11 +101,16 @@ class ThreadRunStepDelta < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.delta" # @!method initialize(data:, event: :"thread.run.step.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStepStreamEvent::ThreadRunStepDelta} for more details. + # # Occurs when parts of a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # are being streamed. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent] Represents a run step delta i.e. any changed fields on a run step during streami + # ... + # # @param event [Symbol, :"thread.run.step.delta"] end @@ -112,11 +127,16 @@ class ThreadRunStepCompleted < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.completed" # @!method initialize(data:, event: :"thread.run.step.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStepStreamEvent::ThreadRunStepCompleted} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # is completed. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.completed"] end @@ -133,11 +153,16 @@ class ThreadRunStepFailed < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.failed" # @!method initialize(data:, event: :"thread.run.step.failed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStepStreamEvent::ThreadRunStepFailed} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # fails. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.failed"] end @@ -154,11 +179,16 @@ class ThreadRunStepCancelled < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.cancelled" # @!method initialize(data:, event: :"thread.run.step.cancelled") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStepStreamEvent::ThreadRunStepCancelled} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # is cancelled. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.cancelled"] end @@ -175,11 +205,16 @@ class ThreadRunStepExpired < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.step.expired" # @!method initialize(data:, event: :"thread.run.step.expired") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStepStreamEvent::ThreadRunStepExpired} for more + # details. + # # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) # expires. # - # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] + # @param data [OpenAI::Models::Beta::Threads::Runs::RunStep] Represents a step in execution of a run. ... + # # @param event [Symbol, :"thread.run.step.expired"] end diff --git a/lib/openai/models/beta/run_stream_event.rb b/lib/openai/models/beta/run_stream_event.rb index 33a63272..19bda475 100644 --- a/lib/openai/models/beta/run_stream_event.rb +++ b/lib/openai/models/beta/run_stream_event.rb @@ -55,10 +55,15 @@ class ThreadRunCreated < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.created" # @!method initialize(data:, event: :"thread.run.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunCreated} for more details. + # # Occurs when a new # [run](https://platform.openai.com/docs/api-reference/runs/object) is created. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.created"] end @@ -76,10 +81,15 @@ class ThreadRunQueued < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.queued" # @!method initialize(data:, event: :"thread.run.queued") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunQueued} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `queued` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.queued"] end @@ -97,10 +107,15 @@ class ThreadRunInProgress < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.in_progress" # @!method initialize(data:, event: :"thread.run.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunInProgress} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to an `in_progress` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.in_progress"] end @@ -118,10 +133,16 @@ class ThreadRunRequiresAction < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.requires_action" # @!method initialize(data:, event: :"thread.run.requires_action") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunRequiresAction} for more + # details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `requires_action` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.requires_action"] end @@ -139,10 +160,15 @@ class ThreadRunCompleted < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.completed" # @!method initialize(data:, event: :"thread.run.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunCompleted} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is completed. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.completed"] end @@ -160,10 +186,15 @@ class ThreadRunIncomplete < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.incomplete" # @!method initialize(data:, event: :"thread.run.incomplete") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunIncomplete} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # ends with status `incomplete`. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.incomplete"] end @@ -181,10 +212,15 @@ class ThreadRunFailed < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.failed" # @!method initialize(data:, event: :"thread.run.failed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunFailed} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # fails. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.failed"] end @@ -202,10 +238,15 @@ class ThreadRunCancelling < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.cancelling" # @!method initialize(data:, event: :"thread.run.cancelling") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunCancelling} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `cancelling` status. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.cancelling"] end @@ -223,10 +264,15 @@ class ThreadRunCancelled < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.cancelled" # @!method initialize(data:, event: :"thread.run.cancelled") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunCancelled} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is cancelled. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.cancelled"] end @@ -244,10 +290,15 @@ class ThreadRunExpired < OpenAI::Internal::Type::BaseModel required :event, const: :"thread.run.expired" # @!method initialize(data:, event: :"thread.run.expired") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::RunStreamEvent::ThreadRunExpired} for more details. + # # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # expires. # - # @param data [OpenAI::Models::Beta::Threads::Run] + # @param data [OpenAI::Models::Beta::Threads::Run] Represents an execution run on a [thread](https://platform.openai.com/docs/api-r + # ... + # # @param event [Symbol, :"thread.run.expired"] end diff --git a/lib/openai/models/beta/thread.rb b/lib/openai/models/beta/thread.rb index 757ea5d5..cad2cd8d 100644 --- a/lib/openai/models/beta/thread.rb +++ b/lib/openai/models/beta/thread.rb @@ -44,14 +44,22 @@ class Thread < OpenAI::Internal::Type::BaseModel required :tool_resources, -> { OpenAI::Models::Beta::Thread::ToolResources }, nil?: true # @!method initialize(id:, created_at:, metadata:, tool_resources:, object: :thread) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Thread} for more details. + # # Represents a thread that contains # [messages](https://platform.openai.com/docs/api-reference/messages). # - # @param id [String] - # @param created_at [Integer] - # @param metadata [Hash{Symbol=>String}, nil] - # @param tool_resources [OpenAI::Models::Beta::Thread::ToolResources, nil] - # @param object [Symbol, :thread] + # @param id [String] The identifier, which can be referenced in API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the thread was created. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param tool_resources [OpenAI::Models::Beta::Thread::ToolResources, nil] A set of resources that are made available to the assistant's tools in this thre + # ... + # + # @param object [Symbol, :thread] The object type, which is always `thread`. # @see OpenAI::Models::Beta::Thread#tool_resources class ToolResources < OpenAI::Internal::Type::BaseModel @@ -85,7 +93,11 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Thread::ToolResources::CodeInterpreter} for more details. + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # ... end # @see OpenAI::Models::Beta::Thread::ToolResources#file_search @@ -100,7 +112,11 @@ class FileSearch < OpenAI::Internal::Type::BaseModel optional :vector_store_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(vector_store_ids: nil) - # @param vector_store_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Thread::ToolResources::FileSearch} for more details. + # + # @param vector_store_ids [Array] The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/ + # ... end end end diff --git a/lib/openai/models/beta/thread_create_and_run_params.rb b/lib/openai/models/beta/thread_create_and_run_params.rb index 979eb39f..0cd74409 100644 --- a/lib/openai/models/beta/thread_create_and_run_params.rb +++ b/lib/openai/models/beta/thread_create_and_run_params.rb @@ -163,21 +163,51 @@ class ThreadCreateAndRunParams < OpenAI::Internal::Type::BaseModel nil?: true # @!method initialize(assistant_id:, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, response_format: nil, temperature: nil, thread: nil, tool_choice: nil, tool_resources: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {}) - # @param assistant_id [String] - # @param instructions [String, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_prompt_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] - # @param parallel_tool_calls [Boolean] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param thread [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread] - # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil] - # @param tools [Array, nil] - # @param top_p [Float, nil] - # @param truncation_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams} for more details. + # + # @param assistant_id [String] The ID of the [assistant](https://platform.openai.com/docs/api-reference/assista + # ... + # + # @param instructions [String, nil] Override the default system message of the assistant. This is useful for modifyi + # ... + # + # @param max_completion_tokens [Integer, nil] The maximum number of completion tokens that may be used over the course of the + # ... + # + # @param max_prompt_tokens [Integer, nil] The maximum number of prompt tokens that may be used over the course of the run. + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param thread [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread] Options to create a new thread. If no thread is provided when running a ... + # + # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] Controls which (if any) tool is called by the model. ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param tools [Array, nil] Override the tools the assistant can use for this run. This is useful for modify + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param truncation_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil] Controls for how a thread will be truncated prior to the run. Use this to contro + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to @@ -228,12 +258,19 @@ class Thread < OpenAI::Internal::Type::BaseModel nil?: true # @!method initialize(messages: nil, metadata: nil, tool_resources: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread} for more details. + # # Options to create a new thread. If no thread is provided when running a request, # an empty thread will be created. # - # @param messages [Array] - # @param metadata [Hash{Symbol=>String}, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources, nil] + # @param messages [Array] A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources, nil] A set of resources that are made available to the assistant's tools in this thre + # ... class Message < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -273,10 +310,17 @@ class Message < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(content:, role:, attachments: nil, metadata: nil) - # @param content [String, Array] - # @param role [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Role] - # @param attachments [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message} for more + # details. + # + # @param content [String, Array] The text contents of the message. + # + # @param role [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Role] The role of the entity that is creating the message. Allowed values include: ... + # + # @param attachments [Array, nil] A list of files attached to the message, and the tools they should be added to. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... # The text contents of the message. # @@ -330,8 +374,9 @@ class Attachment < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool] } # @!method initialize(file_id: nil, tools: nil) - # @param file_id [String] - # @param tools [Array] + # @param file_id [String] The ID of the file to attach to the message. + # + # @param tools [Array] The tools to add this file to. module Tool extend OpenAI::Internal::Type::Union @@ -351,7 +396,7 @@ class FileSearch < OpenAI::Internal::Type::BaseModel required :type, const: :file_search # @!method initialize(type: :file_search) - # @param type [Symbol, :file_search] + # @param type [Symbol, :file_search] The type of tool being defined: `file_search` end # @!method self.variants @@ -394,7 +439,12 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter} + # for more details. + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # ... end # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources#file_search @@ -419,8 +469,15 @@ class FileSearch < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore] } # @!method initialize(vector_store_ids: nil, vector_stores: nil) - # @param vector_store_ids [Array] - # @param vector_stores [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch} + # for more details. + # + # @param vector_store_ids [Array] The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/ + # ... + # + # @param vector_stores [Array] A helper to create a [vector store](https://platform.openai.com/docs/api-referen + # ... class VectorStore < OpenAI::Internal::Type::BaseModel # @!attribute chunking_strategy @@ -451,9 +508,17 @@ class VectorStore < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(chunking_strategy: nil, file_ids: nil, metadata: nil) - # @param chunking_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static] - # @param file_ids [Array] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore} + # for more details. + # + # @param chunking_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to ad + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... # The chunking strategy used to chunk the file(s). If not set, will use the `auto` # strategy. @@ -482,7 +547,7 @@ class Auto < OpenAI::Internal::Type::BaseModel # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. # - # @param type [Symbol, :auto] + # @param type [Symbol, :auto] Always `auto`. end class Static < OpenAI::Internal::Type::BaseModel @@ -500,7 +565,8 @@ class Static < OpenAI::Internal::Type::BaseModel # @!method initialize(static:, type: :static) # @param static [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static] - # @param type [Symbol, :static] + # + # @param type [Symbol, :static] Always `static`. # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static#static class Static < OpenAI::Internal::Type::BaseModel @@ -520,8 +586,15 @@ class Static < OpenAI::Internal::Type::BaseModel required :max_chunk_size_tokens, Integer # @!method initialize(chunk_overlap_tokens:, max_chunk_size_tokens:) - # @param chunk_overlap_tokens [Integer] - # @param max_chunk_size_tokens [Integer] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static} + # for more details. + # + # @param chunk_overlap_tokens [Integer] The number of tokens that overlap between chunks. The default value is `400`. + # ... + # + # @param max_chunk_size_tokens [Integer] The maximum number of tokens in each chunk. The default value is `800`. The mini + # ... end end @@ -565,7 +638,12 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter} + # for more details. + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # ... end # @see OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources#file_search @@ -580,7 +658,12 @@ class FileSearch < OpenAI::Internal::Type::BaseModel optional :vector_store_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(vector_store_ids: nil) - # @param vector_store_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch} for + # more details. + # + # @param vector_store_ids [Array] The ID of the [vector store](https://platform.openai.com/docs/api-reference/vect + # ... end end @@ -602,11 +685,18 @@ class TruncationStrategy < OpenAI::Internal::Type::BaseModel optional :last_messages, Integer, nil?: true # @!method initialize(type:, last_messages: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy} for more + # details. + # # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. # - # @param type [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type] - # @param last_messages [Integer, nil] + # @param type [Symbol, OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type] The truncation strategy to use for the thread. The default is `auto`. If set to + # ... + # + # @param last_messages [Integer, nil] The number of most recent messages from the thread when constructing the context + # ... # The truncation strategy to use for the thread. The default is `auto`. If set to # `last_messages`, the thread will be truncated to the n most recent messages in diff --git a/lib/openai/models/beta/thread_create_params.rb b/lib/openai/models/beta/thread_create_params.rb index 2d768eaf..3cb1d240 100644 --- a/lib/openai/models/beta/thread_create_params.rb +++ b/lib/openai/models/beta/thread_create_params.rb @@ -37,9 +37,17 @@ class ThreadCreateParams < OpenAI::Internal::Type::BaseModel optional :tool_resources, -> { OpenAI::Models::Beta::ThreadCreateParams::ToolResources }, nil?: true # @!method initialize(messages: nil, metadata: nil, tool_resources: nil, request_options: {}) - # @param messages [Array] - # @param metadata [Hash{Symbol=>String}, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadCreateParams::ToolResources, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateParams} for more details. + # + # @param messages [Array] A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadCreateParams::ToolResources, nil] A set of resources that are made available to the assistant's tools in this thre + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] class Message < OpenAI::Internal::Type::BaseModel @@ -80,10 +88,16 @@ class Message < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(content:, role:, attachments: nil, metadata: nil) - # @param content [String, Array] - # @param role [Symbol, OpenAI::Models::Beta::ThreadCreateParams::Message::Role] - # @param attachments [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateParams::Message} for more details. + # + # @param content [String, Array] The text contents of the message. + # + # @param role [Symbol, OpenAI::Models::Beta::ThreadCreateParams::Message::Role] The role of the entity that is creating the message. Allowed values include: ... + # + # @param attachments [Array, nil] A list of files attached to the message, and the tools they should be added to. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... # The text contents of the message. # @@ -137,8 +151,9 @@ class Attachment < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::Tool] } # @!method initialize(file_id: nil, tools: nil) - # @param file_id [String] - # @param tools [Array] + # @param file_id [String] The ID of the file to attach to the message. + # + # @param tools [Array] The tools to add this file to. module Tool extend OpenAI::Internal::Type::Union @@ -158,7 +173,7 @@ class FileSearch < OpenAI::Internal::Type::BaseModel required :type, const: :file_search # @!method initialize(type: :file_search) - # @param type [Symbol, :file_search] + # @param type [Symbol, :file_search] The type of tool being defined: `file_search` end # @!method self.variants @@ -199,7 +214,12 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateParams::ToolResources::CodeInterpreter} for + # more details. + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # ... end # @see OpenAI::Models::Beta::ThreadCreateParams::ToolResources#file_search @@ -224,8 +244,15 @@ class FileSearch < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore] } # @!method initialize(vector_store_ids: nil, vector_stores: nil) - # @param vector_store_ids [Array] - # @param vector_stores [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch} for more + # details. + # + # @param vector_store_ids [Array] The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/ + # ... + # + # @param vector_stores [Array] A helper to create a [vector store](https://platform.openai.com/docs/api-referen + # ... class VectorStore < OpenAI::Internal::Type::BaseModel # @!attribute chunking_strategy @@ -256,9 +283,17 @@ class VectorStore < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(chunking_strategy: nil, file_ids: nil, metadata: nil) - # @param chunking_strategy [OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static] - # @param file_ids [Array] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore} + # for more details. + # + # @param chunking_strategy [OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to ad + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... # The chunking strategy used to chunk the file(s). If not set, will use the `auto` # strategy. @@ -287,7 +322,7 @@ class Auto < OpenAI::Internal::Type::BaseModel # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. # - # @param type [Symbol, :auto] + # @param type [Symbol, :auto] Always `auto`. end class Static < OpenAI::Internal::Type::BaseModel @@ -305,7 +340,8 @@ class Static < OpenAI::Internal::Type::BaseModel # @!method initialize(static:, type: :static) # @param static [OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static] - # @param type [Symbol, :static] + # + # @param type [Symbol, :static] Always `static`. # @see OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static#static class Static < OpenAI::Internal::Type::BaseModel @@ -325,8 +361,15 @@ class Static < OpenAI::Internal::Type::BaseModel required :max_chunk_size_tokens, Integer # @!method initialize(chunk_overlap_tokens:, max_chunk_size_tokens:) - # @param chunk_overlap_tokens [Integer] - # @param max_chunk_size_tokens [Integer] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static} + # for more details. + # + # @param chunk_overlap_tokens [Integer] The number of tokens that overlap between chunks. The default value is `400`. + # ... + # + # @param max_chunk_size_tokens [Integer] The maximum number of tokens in each chunk. The default value is `800`. The mini + # ... end end diff --git a/lib/openai/models/beta/thread_stream_event.rb b/lib/openai/models/beta/thread_stream_event.rb index bf5cc945..d3279538 100644 --- a/lib/openai/models/beta/thread_stream_event.rb +++ b/lib/openai/models/beta/thread_stream_event.rb @@ -23,12 +23,18 @@ class ThreadStreamEvent < OpenAI::Internal::Type::BaseModel optional :enabled, OpenAI::Internal::Type::Boolean # @!method initialize(data:, enabled: nil, event: :"thread.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadStreamEvent} for more details. + # # Occurs when a new # [thread](https://platform.openai.com/docs/api-reference/threads/object) is # created. # - # @param data [OpenAI::Models::Beta::Thread] - # @param enabled [Boolean] + # @param data [OpenAI::Models::Beta::Thread] Represents a thread that contains [messages](https://platform.openai.com/docs/ap + # ... + # + # @param enabled [Boolean] Whether to enable input audio transcription. + # # @param event [Symbol, :"thread.created"] end end diff --git a/lib/openai/models/beta/thread_update_params.rb b/lib/openai/models/beta/thread_update_params.rb index 8d7d621e..a96d0bc8 100644 --- a/lib/openai/models/beta/thread_update_params.rb +++ b/lib/openai/models/beta/thread_update_params.rb @@ -29,8 +29,14 @@ class ThreadUpdateParams < OpenAI::Internal::Type::BaseModel optional :tool_resources, -> { OpenAI::Models::Beta::ThreadUpdateParams::ToolResources }, nil?: true # @!method initialize(metadata: nil, tool_resources: nil, request_options: {}) - # @param metadata [Hash{Symbol=>String}, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadUpdateParams} for more details. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, nil] A set of resources that are made available to the assistant's tools in this thre + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] class ToolResources < OpenAI::Internal::Type::BaseModel @@ -65,7 +71,12 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel optional :file_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(file_ids: nil) - # @param file_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::CodeInterpreter} for + # more details. + # + # @param file_ids [Array] A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # ... end # @see OpenAI::Models::Beta::ThreadUpdateParams::ToolResources#file_search @@ -80,7 +91,12 @@ class FileSearch < OpenAI::Internal::Type::BaseModel optional :vector_store_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(vector_store_ids: nil) - # @param vector_store_ids [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::FileSearch} for more + # details. + # + # @param vector_store_ids [Array] The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/ + # ... end end end diff --git a/lib/openai/models/beta/threads/file_citation_annotation.rb b/lib/openai/models/beta/threads/file_citation_annotation.rb index 77b9e19d..4ccc33d1 100644 --- a/lib/openai/models/beta/threads/file_citation_annotation.rb +++ b/lib/openai/models/beta/threads/file_citation_annotation.rb @@ -38,10 +38,14 @@ class FileCitationAnnotation < OpenAI::Internal::Type::BaseModel # uses the "file_search" tool to search files. # # @param end_index [Integer] + # # @param file_citation [OpenAI::Models::Beta::Threads::FileCitationAnnotation::FileCitation] + # # @param start_index [Integer] - # @param text [String] - # @param type [Symbol, :file_citation] + # + # @param text [String] The text in the message content that needs to be replaced. + # + # @param type [Symbol, :file_citation] Always `file_citation`. # @see OpenAI::Models::Beta::Threads::FileCitationAnnotation#file_citation class FileCitation < OpenAI::Internal::Type::BaseModel @@ -52,7 +56,7 @@ class FileCitation < OpenAI::Internal::Type::BaseModel required :file_id, String # @!method initialize(file_id:) - # @param file_id [String] + # @param file_id [String] The ID of the specific File the citation is from. end end end diff --git a/lib/openai/models/beta/threads/file_citation_delta_annotation.rb b/lib/openai/models/beta/threads/file_citation_delta_annotation.rb index 3d825a51..7a676989 100644 --- a/lib/openai/models/beta/threads/file_citation_delta_annotation.rb +++ b/lib/openai/models/beta/threads/file_citation_delta_annotation.rb @@ -43,12 +43,17 @@ class FileCitationDeltaAnnotation < OpenAI::Internal::Type::BaseModel # File associated with the assistant or the message. Generated when the assistant # uses the "file_search" tool to search files. # - # @param index [Integer] + # @param index [Integer] The index of the annotation in the text content part. + # # @param end_index [Integer] + # # @param file_citation [OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation::FileCitation] + # # @param start_index [Integer] - # @param text [String] - # @param type [Symbol, :file_citation] + # + # @param text [String] The text in the message content that needs to be replaced. + # + # @param type [Symbol, :file_citation] Always `file_citation`. # @see OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation#file_citation class FileCitation < OpenAI::Internal::Type::BaseModel @@ -65,8 +70,9 @@ class FileCitation < OpenAI::Internal::Type::BaseModel optional :quote, String # @!method initialize(file_id: nil, quote: nil) - # @param file_id [String] - # @param quote [String] + # @param file_id [String] The ID of the specific File the citation is from. + # + # @param quote [String] The specific quote in the file. end end end diff --git a/lib/openai/models/beta/threads/file_path_annotation.rb b/lib/openai/models/beta/threads/file_path_annotation.rb index 91c2a6fd..516a7249 100644 --- a/lib/openai/models/beta/threads/file_path_annotation.rb +++ b/lib/openai/models/beta/threads/file_path_annotation.rb @@ -37,10 +37,14 @@ class FilePathAnnotation < OpenAI::Internal::Type::BaseModel # `code_interpreter` tool to generate a file. # # @param end_index [Integer] + # # @param file_path [OpenAI::Models::Beta::Threads::FilePathAnnotation::FilePath] + # # @param start_index [Integer] - # @param text [String] - # @param type [Symbol, :file_path] + # + # @param text [String] The text in the message content that needs to be replaced. + # + # @param type [Symbol, :file_path] Always `file_path`. # @see OpenAI::Models::Beta::Threads::FilePathAnnotation#file_path class FilePath < OpenAI::Internal::Type::BaseModel @@ -51,7 +55,7 @@ class FilePath < OpenAI::Internal::Type::BaseModel required :file_id, String # @!method initialize(file_id:) - # @param file_id [String] + # @param file_id [String] The ID of the file that was generated. end end end diff --git a/lib/openai/models/beta/threads/file_path_delta_annotation.rb b/lib/openai/models/beta/threads/file_path_delta_annotation.rb index 679015ba..b67e6401 100644 --- a/lib/openai/models/beta/threads/file_path_delta_annotation.rb +++ b/lib/openai/models/beta/threads/file_path_delta_annotation.rb @@ -42,12 +42,17 @@ class FilePathDeltaAnnotation < OpenAI::Internal::Type::BaseModel # A URL for the file that's generated when the assistant used the # `code_interpreter` tool to generate a file. # - # @param index [Integer] + # @param index [Integer] The index of the annotation in the text content part. + # # @param end_index [Integer] + # # @param file_path [OpenAI::Models::Beta::Threads::FilePathDeltaAnnotation::FilePath] + # # @param start_index [Integer] - # @param text [String] - # @param type [Symbol, :file_path] + # + # @param text [String] The text in the message content that needs to be replaced. + # + # @param type [Symbol, :file_path] Always `file_path`. # @see OpenAI::Models::Beta::Threads::FilePathDeltaAnnotation#file_path class FilePath < OpenAI::Internal::Type::BaseModel @@ -58,7 +63,7 @@ class FilePath < OpenAI::Internal::Type::BaseModel optional :file_id, String # @!method initialize(file_id: nil) - # @param file_id [String] + # @param file_id [String] The ID of the file that was generated. end end end diff --git a/lib/openai/models/beta/threads/image_file.rb b/lib/openai/models/beta/threads/image_file.rb index df480221..f99387f6 100644 --- a/lib/openai/models/beta/threads/image_file.rb +++ b/lib/openai/models/beta/threads/image_file.rb @@ -21,8 +21,14 @@ class ImageFile < OpenAI::Internal::Type::BaseModel optional :detail, enum: -> { OpenAI::Models::Beta::Threads::ImageFile::Detail } # @!method initialize(file_id:, detail: nil) - # @param file_id [String] - # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageFile::Detail] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::ImageFile} for more details. + # + # @param file_id [String] The [File](https://platform.openai.com/docs/api-reference/files) ID of the image + # ... + # + # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageFile::Detail] Specifies the detail level of the image if specified by the user. `low` uses few + # ... # Specifies the detail level of the image if specified by the user. `low` uses # fewer tokens, you can opt in to high resolution using `high`. diff --git a/lib/openai/models/beta/threads/image_file_content_block.rb b/lib/openai/models/beta/threads/image_file_content_block.rb index 2bcba265..99aeca4e 100644 --- a/lib/openai/models/beta/threads/image_file_content_block.rb +++ b/lib/openai/models/beta/threads/image_file_content_block.rb @@ -21,7 +21,8 @@ class ImageFileContentBlock < OpenAI::Internal::Type::BaseModel # in the content of a message. # # @param image_file [OpenAI::Models::Beta::Threads::ImageFile] - # @param type [Symbol, :image_file] + # + # @param type [Symbol, :image_file] Always `image_file`. end end end diff --git a/lib/openai/models/beta/threads/image_file_delta.rb b/lib/openai/models/beta/threads/image_file_delta.rb index 25fc81e0..69c0f595 100644 --- a/lib/openai/models/beta/threads/image_file_delta.rb +++ b/lib/openai/models/beta/threads/image_file_delta.rb @@ -21,8 +21,14 @@ class ImageFileDelta < OpenAI::Internal::Type::BaseModel optional :file_id, String # @!method initialize(detail: nil, file_id: nil) - # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageFileDelta::Detail] - # @param file_id [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::ImageFileDelta} for more details. + # + # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageFileDelta::Detail] Specifies the detail level of the image if specified by the user. `low` uses few + # ... + # + # @param file_id [String] The [File](https://platform.openai.com/docs/api-reference/files) ID of the image + # ... # Specifies the detail level of the image if specified by the user. `low` uses # fewer tokens, you can opt in to high resolution using `high`. diff --git a/lib/openai/models/beta/threads/image_file_delta_block.rb b/lib/openai/models/beta/threads/image_file_delta_block.rb index 3befaf8c..8831e0c3 100644 --- a/lib/openai/models/beta/threads/image_file_delta_block.rb +++ b/lib/openai/models/beta/threads/image_file_delta_block.rb @@ -26,9 +26,11 @@ class ImageFileDeltaBlock < OpenAI::Internal::Type::BaseModel # References an image [File](https://platform.openai.com/docs/api-reference/files) # in the content of a message. # - # @param index [Integer] + # @param index [Integer] The index of the content part in the message. + # # @param image_file [OpenAI::Models::Beta::Threads::ImageFileDelta] - # @param type [Symbol, :image_file] + # + # @param type [Symbol, :image_file] Always `image_file`. end end end diff --git a/lib/openai/models/beta/threads/image_url.rb b/lib/openai/models/beta/threads/image_url.rb index 1b88b1b2..02ed1378 100644 --- a/lib/openai/models/beta/threads/image_url.rb +++ b/lib/openai/models/beta/threads/image_url.rb @@ -20,8 +20,14 @@ class ImageURL < OpenAI::Internal::Type::BaseModel optional :detail, enum: -> { OpenAI::Models::Beta::Threads::ImageURL::Detail } # @!method initialize(url:, detail: nil) - # @param url [String] - # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageURL::Detail] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::ImageURL} for more details. + # + # @param url [String] The external URL of the image, must be a supported image types: jpeg, jpg, png, + # ... + # + # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageURL::Detail] Specifies the detail level of the image. `low` uses fewer tokens, you can opt in + # ... # Specifies the detail level of the image. `low` uses fewer tokens, you can opt in # to high resolution using `high`. Default value is `auto` diff --git a/lib/openai/models/beta/threads/image_url_content_block.rb b/lib/openai/models/beta/threads/image_url_content_block.rb index b44975eb..f9b5edc9 100644 --- a/lib/openai/models/beta/threads/image_url_content_block.rb +++ b/lib/openai/models/beta/threads/image_url_content_block.rb @@ -20,7 +20,8 @@ class ImageURLContentBlock < OpenAI::Internal::Type::BaseModel # References an image URL in the content of a message. # # @param image_url [OpenAI::Models::Beta::Threads::ImageURL] - # @param type [Symbol, :image_url] + # + # @param type [Symbol, :image_url] The type of the content part. end end end diff --git a/lib/openai/models/beta/threads/image_url_delta.rb b/lib/openai/models/beta/threads/image_url_delta.rb index 9ba548e3..1f1d98ef 100644 --- a/lib/openai/models/beta/threads/image_url_delta.rb +++ b/lib/openai/models/beta/threads/image_url_delta.rb @@ -20,8 +20,14 @@ class ImageURLDelta < OpenAI::Internal::Type::BaseModel optional :url, String # @!method initialize(detail: nil, url: nil) - # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageURLDelta::Detail] - # @param url [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::ImageURLDelta} for more details. + # + # @param detail [Symbol, OpenAI::Models::Beta::Threads::ImageURLDelta::Detail] Specifies the detail level of the image. `low` uses fewer tokens, you can opt in + # ... + # + # @param url [String] The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp + # ... # Specifies the detail level of the image. `low` uses fewer tokens, you can opt in # to high resolution using `high`. diff --git a/lib/openai/models/beta/threads/image_url_delta_block.rb b/lib/openai/models/beta/threads/image_url_delta_block.rb index 8b140bfb..f2a01238 100644 --- a/lib/openai/models/beta/threads/image_url_delta_block.rb +++ b/lib/openai/models/beta/threads/image_url_delta_block.rb @@ -25,9 +25,11 @@ class ImageURLDeltaBlock < OpenAI::Internal::Type::BaseModel # @!method initialize(index:, image_url: nil, type: :image_url) # References an image URL in the content of a message. # - # @param index [Integer] + # @param index [Integer] The index of the content part in the message. + # # @param image_url [OpenAI::Models::Beta::Threads::ImageURLDelta] - # @param type [Symbol, :image_url] + # + # @param type [Symbol, :image_url] Always `image_url`. end end end diff --git a/lib/openai/models/beta/threads/message.rb b/lib/openai/models/beta/threads/message.rb index ccff15ee..b98b3ca0 100644 --- a/lib/openai/models/beta/threads/message.rb +++ b/lib/openai/models/beta/threads/message.rb @@ -105,23 +105,43 @@ class Message < OpenAI::Internal::Type::BaseModel required :thread_id, String # @!method initialize(id:, assistant_id:, attachments:, completed_at:, content:, created_at:, incomplete_at:, incomplete_details:, metadata:, role:, run_id:, status:, thread_id:, object: :"thread.message") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Message} for more details. + # # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). # - # @param id [String] - # @param assistant_id [String, nil] - # @param attachments [Array, nil] - # @param completed_at [Integer, nil] - # @param content [Array] - # @param created_at [Integer] - # @param incomplete_at [Integer, nil] - # @param incomplete_details [OpenAI::Models::Beta::Threads::Message::IncompleteDetails, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param role [Symbol, OpenAI::Models::Beta::Threads::Message::Role] - # @param run_id [String, nil] - # @param status [Symbol, OpenAI::Models::Beta::Threads::Message::Status] - # @param thread_id [String] - # @param object [Symbol, :"thread.message"] + # @param id [String] The identifier, which can be referenced in API endpoints. + # + # @param assistant_id [String, nil] If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-re + # ... + # + # @param attachments [Array, nil] A list of files attached to the message, and the tools they were added to. + # + # @param completed_at [Integer, nil] The Unix timestamp (in seconds) for when the message was completed. + # + # @param content [Array] The content of the message in array of text and/or images. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the message was created. + # + # @param incomplete_at [Integer, nil] The Unix timestamp (in seconds) for when the message was marked as incomplete. + # + # @param incomplete_details [OpenAI::Models::Beta::Threads::Message::IncompleteDetails, nil] On an incomplete message, details about why the message is incomplete. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param role [Symbol, OpenAI::Models::Beta::Threads::Message::Role] The entity that produced the message. One of `user` or `assistant`. + # + # @param run_id [String, nil] The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associa + # ... + # + # @param status [Symbol, OpenAI::Models::Beta::Threads::Message::Status] The status of the message, which can be either `in_progress`, `incomplete`, or ` + # ... + # + # @param thread_id [String] The [thread](https://platform.openai.com/docs/api-reference/threads) ID that thi + # ... + # + # @param object [Symbol, :"thread.message"] The object type, which is always `thread.message`. class Attachment < OpenAI::Internal::Type::BaseModel # @!attribute file_id @@ -138,8 +158,9 @@ class Attachment < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::Threads::Message::Attachment::Tool] } # @!method initialize(file_id: nil, tools: nil) - # @param file_id [String] - # @param tools [Array] + # @param file_id [String] The ID of the file to attach to the message. + # + # @param tools [Array] The tools to add this file to. module Tool extend OpenAI::Internal::Type::Union @@ -156,7 +177,7 @@ class AssistantToolsFileSearchTypeOnly < OpenAI::Internal::Type::BaseModel required :type, const: :file_search # @!method initialize(type: :file_search) - # @param type [Symbol, :file_search] + # @param type [Symbol, :file_search] The type of tool being defined: `file_search` end # @!method self.variants @@ -175,7 +196,7 @@ class IncompleteDetails < OpenAI::Internal::Type::BaseModel # @!method initialize(reason:) # On an incomplete message, details about why the message is incomplete. # - # @param reason [Symbol, OpenAI::Models::Beta::Threads::Message::IncompleteDetails::Reason] + # @param reason [Symbol, OpenAI::Models::Beta::Threads::Message::IncompleteDetails::Reason] The reason the message is incomplete. # The reason the message is incomplete. # diff --git a/lib/openai/models/beta/threads/message_create_params.rb b/lib/openai/models/beta/threads/message_create_params.rb index 711686f8..ff6d233f 100644 --- a/lib/openai/models/beta/threads/message_create_params.rb +++ b/lib/openai/models/beta/threads/message_create_params.rb @@ -46,10 +46,17 @@ class MessageCreateParams < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(content:, role:, attachments: nil, metadata: nil, request_options: {}) - # @param content [String, Array] - # @param role [Symbol, OpenAI::Models::Beta::Threads::MessageCreateParams::Role] - # @param attachments [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::MessageCreateParams} for more details. + # + # @param content [String, Array] The text contents of the message. + # + # @param role [Symbol, OpenAI::Models::Beta::Threads::MessageCreateParams::Role] The role of the entity that is creating the message. Allowed values include: ... + # + # @param attachments [Array, nil] A list of files attached to the message, and the tools they should be added to. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The text contents of the message. @@ -100,8 +107,9 @@ class Attachment < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::Tool] } # @!method initialize(file_id: nil, tools: nil) - # @param file_id [String] - # @param tools [Array] + # @param file_id [String] The ID of the file to attach to the message. + # + # @param tools [Array] The tools to add this file to. module Tool extend OpenAI::Internal::Type::Union @@ -121,7 +129,7 @@ class FileSearch < OpenAI::Internal::Type::BaseModel required :type, const: :file_search # @!method initialize(type: :file_search) - # @param type [Symbol, :file_search] + # @param type [Symbol, :file_search] The type of tool being defined: `file_search` end # @!method self.variants diff --git a/lib/openai/models/beta/threads/message_delta.rb b/lib/openai/models/beta/threads/message_delta.rb index 04f0a1fd..a845cecd 100644 --- a/lib/openai/models/beta/threads/message_delta.rb +++ b/lib/openai/models/beta/threads/message_delta.rb @@ -21,8 +21,9 @@ class MessageDelta < OpenAI::Internal::Type::BaseModel # @!method initialize(content: nil, role: nil) # The delta containing the fields that have changed on the Message. # - # @param content [Array] - # @param role [Symbol, OpenAI::Models::Beta::Threads::MessageDelta::Role] + # @param content [Array] The content of the message in array of text and/or images. + # + # @param role [Symbol, OpenAI::Models::Beta::Threads::MessageDelta::Role] The entity that produced the message. One of `user` or `assistant`. # The entity that produced the message. One of `user` or `assistant`. # diff --git a/lib/openai/models/beta/threads/message_delta_event.rb b/lib/openai/models/beta/threads/message_delta_event.rb index e935e3bd..96c689fb 100644 --- a/lib/openai/models/beta/threads/message_delta_event.rb +++ b/lib/openai/models/beta/threads/message_delta_event.rb @@ -27,9 +27,11 @@ class MessageDeltaEvent < OpenAI::Internal::Type::BaseModel # Represents a message delta i.e. any changed fields on a message during # streaming. # - # @param id [String] - # @param delta [OpenAI::Models::Beta::Threads::MessageDelta] - # @param object [Symbol, :"thread.message.delta"] + # @param id [String] The identifier of the message, which can be referenced in API endpoints. + # + # @param delta [OpenAI::Models::Beta::Threads::MessageDelta] The delta containing the fields that have changed on the Message. + # + # @param object [Symbol, :"thread.message.delta"] The object type, which is always `thread.message.delta`. end end end diff --git a/lib/openai/models/beta/threads/message_list_params.rb b/lib/openai/models/beta/threads/message_list_params.rb index 2dbe8d80..911b6f57 100644 --- a/lib/openai/models/beta/threads/message_list_params.rb +++ b/lib/openai/models/beta/threads/message_list_params.rb @@ -48,11 +48,23 @@ class MessageListParams < OpenAI::Internal::Type::BaseModel optional :run_id, String # @!method initialize(after: nil, before: nil, limit: nil, order: nil, run_id: nil, request_options: {}) - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::Threads::MessageListParams::Order] - # @param run_id [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::MessageListParams} for more details. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::Threads::MessageListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # + # @param run_id [String] Filter messages by the run ID that generated them. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order by the `created_at` timestamp of the objects. `asc` for ascending diff --git a/lib/openai/models/beta/threads/message_update_params.rb b/lib/openai/models/beta/threads/message_update_params.rb index 09909fdc..ab23d244 100644 --- a/lib/openai/models/beta/threads/message_update_params.rb +++ b/lib/openai/models/beta/threads/message_update_params.rb @@ -26,8 +26,13 @@ class MessageUpdateParams < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(thread_id:, metadata: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::MessageUpdateParams} for more details. + # # @param thread_id [String] - # @param metadata [Hash{Symbol=>String}, nil] + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/beta/threads/refusal_content_block.rb b/lib/openai/models/beta/threads/refusal_content_block.rb index fcdce182..91eba521 100644 --- a/lib/openai/models/beta/threads/refusal_content_block.rb +++ b/lib/openai/models/beta/threads/refusal_content_block.rb @@ -20,7 +20,8 @@ class RefusalContentBlock < OpenAI::Internal::Type::BaseModel # The refusal content generated by the assistant. # # @param refusal [String] - # @param type [Symbol, :refusal] + # + # @param type [Symbol, :refusal] Always `refusal`. end end end diff --git a/lib/openai/models/beta/threads/refusal_delta_block.rb b/lib/openai/models/beta/threads/refusal_delta_block.rb index 9f1cc3a1..cdb3d1ea 100644 --- a/lib/openai/models/beta/threads/refusal_delta_block.rb +++ b/lib/openai/models/beta/threads/refusal_delta_block.rb @@ -25,9 +25,11 @@ class RefusalDeltaBlock < OpenAI::Internal::Type::BaseModel # @!method initialize(index:, refusal: nil, type: :refusal) # The refusal content that is part of a message. # - # @param index [Integer] + # @param index [Integer] The index of the refusal part in the message. + # # @param refusal [String] - # @param type [Symbol, :refusal] + # + # @param type [Symbol, :refusal] Always `refusal`. end end end diff --git a/lib/openai/models/beta/threads/required_action_function_tool_call.rb b/lib/openai/models/beta/threads/required_action_function_tool_call.rb index 7db514ed..f7a4a2b0 100644 --- a/lib/openai/models/beta/threads/required_action_function_tool_call.rb +++ b/lib/openai/models/beta/threads/required_action_function_tool_call.rb @@ -28,11 +28,19 @@ class RequiredActionFunctionToolCall < OpenAI::Internal::Type::BaseModel required :type, const: :function # @!method initialize(id:, function:, type: :function) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall} for more + # details. + # # Tool call objects # - # @param id [String] - # @param function [OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall::Function] - # @param type [Symbol, :function] + # @param id [String] The ID of the tool call. This ID must be referenced when you submit the tool out + # ... + # + # @param function [OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall::Function] The function definition. + # + # @param type [Symbol, :function] The type of tool call the output is required for. For now, this is always `funct + # ... # @see OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall#function class Function < OpenAI::Internal::Type::BaseModel @@ -51,8 +59,9 @@ class Function < OpenAI::Internal::Type::BaseModel # @!method initialize(arguments:, name:) # The function definition. # - # @param arguments [String] - # @param name [String] + # @param arguments [String] The arguments that the model expects you to pass to the function. + # + # @param name [String] The name of the function. end end end diff --git a/lib/openai/models/beta/threads/run.rb b/lib/openai/models/beta/threads/run.rb index 7638e17a..51b736e9 100644 --- a/lib/openai/models/beta/threads/run.rb +++ b/lib/openai/models/beta/threads/run.rb @@ -220,36 +220,79 @@ class Run < OpenAI::Internal::Type::BaseModel optional :top_p, Float, nil?: true # @!method initialize(id:, assistant_id:, cancelled_at:, completed_at:, created_at:, expires_at:, failed_at:, incomplete_details:, instructions:, last_error:, max_completion_tokens:, max_prompt_tokens:, metadata:, model:, parallel_tool_calls:, required_action:, response_format:, started_at:, status:, thread_id:, tool_choice:, tools:, truncation_strategy:, usage:, temperature: nil, top_p: nil, object: :"thread.run") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Run} for more details. + # # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). # - # @param id [String] - # @param assistant_id [String] - # @param cancelled_at [Integer, nil] - # @param completed_at [Integer, nil] - # @param created_at [Integer] - # @param expires_at [Integer, nil] - # @param failed_at [Integer, nil] - # @param incomplete_details [OpenAI::Models::Beta::Threads::Run::IncompleteDetails, nil] - # @param instructions [String] - # @param last_error [OpenAI::Models::Beta::Threads::Run::LastError, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_prompt_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param parallel_tool_calls [Boolean] - # @param required_action [OpenAI::Models::Beta::Threads::Run::RequiredAction, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param started_at [Integer, nil] - # @param status [Symbol, OpenAI::Models::Beta::Threads::RunStatus] - # @param thread_id [String] - # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] - # @param tools [Array] - # @param truncation_strategy [OpenAI::Models::Beta::Threads::Run::TruncationStrategy, nil] - # @param usage [OpenAI::Models::Beta::Threads::Run::Usage, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param object [Symbol, :"thread.run"] + # @param id [String] The identifier, which can be referenced in API endpoints. + # + # @param assistant_id [String] The ID of the [assistant](https://platform.openai.com/docs/api-reference/assista + # ... + # + # @param cancelled_at [Integer, nil] The Unix timestamp (in seconds) for when the run was cancelled. + # + # @param completed_at [Integer, nil] The Unix timestamp (in seconds) for when the run was completed. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the run was created. + # + # @param expires_at [Integer, nil] The Unix timestamp (in seconds) for when the run will expire. + # + # @param failed_at [Integer, nil] The Unix timestamp (in seconds) for when the run failed. + # + # @param incomplete_details [OpenAI::Models::Beta::Threads::Run::IncompleteDetails, nil] Details on why the run is incomplete. Will be `null` if the run is not incomplet + # ... + # + # @param instructions [String] The instructions that the [assistant](https://platform.openai.com/docs/api-refer + # ... + # + # @param last_error [OpenAI::Models::Beta::Threads::Run::LastError, nil] The last error associated with this run. Will be `null` if there are no errors. + # + # @param max_completion_tokens [Integer, nil] The maximum number of completion tokens specified to have been used over the cou + # ... + # + # @param max_prompt_tokens [Integer, nil] The maximum number of prompt tokens specified to have been used over the course + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String] The model that the [assistant](https://platform.openai.com/docs/api-reference/as + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param required_action [OpenAI::Models::Beta::Threads::Run::RequiredAction, nil] Details on the action required to continue the run. Will be `null` if no action + # ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param started_at [Integer, nil] The Unix timestamp (in seconds) for when the run was started. + # + # @param status [Symbol, OpenAI::Models::Beta::Threads::RunStatus] The status of the run, which can be either `queued`, `in_progress`, `requires_ac + # ... + # + # @param thread_id [String] The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) t + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] Controls which (if any) tool is called by the model. ... + # + # @param tools [Array] The list of tools that the [assistant](https://platform.openai.com/docs/api-refe + # ... + # + # @param truncation_strategy [OpenAI::Models::Beta::Threads::Run::TruncationStrategy, nil] Controls for how a thread will be truncated prior to the run. Use this to contro + # ... + # + # @param usage [OpenAI::Models::Beta::Threads::Run::Usage, nil] Usage statistics related to the run. This value will be `null` if the run is not + # ... + # + # @param temperature [Float, nil] The sampling temperature used for this run. If not set, defaults to 1. + # + # @param top_p [Float, nil] The nucleus sampling value used for this run. If not set, defaults to 1. + # + # @param object [Symbol, :"thread.run"] The object type, which is always `thread.run`. # @see OpenAI::Models::Beta::Threads::Run#incomplete_details class IncompleteDetails < OpenAI::Internal::Type::BaseModel @@ -261,10 +304,14 @@ class IncompleteDetails < OpenAI::Internal::Type::BaseModel optional :reason, enum: -> { OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason } # @!method initialize(reason: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Run::IncompleteDetails} for more details. + # # Details on why the run is incomplete. Will be `null` if the run is not # incomplete. # - # @param reason [Symbol, OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason] + # @param reason [Symbol, OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason] The reason why the run is incomplete. This will point to which specific token li + # ... # The reason why the run is incomplete. This will point to which specific token # limit was reached over the course of the run. @@ -298,8 +345,9 @@ class LastError < OpenAI::Internal::Type::BaseModel # @!method initialize(code:, message:) # The last error associated with this run. Will be `null` if there are no errors. # - # @param code [Symbol, OpenAI::Models::Beta::Threads::Run::LastError::Code] - # @param message [String] + # @param code [Symbol, OpenAI::Models::Beta::Threads::Run::LastError::Code] One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + # + # @param message [String] A human-readable description of the error. # One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. # @@ -335,8 +383,9 @@ class RequiredAction < OpenAI::Internal::Type::BaseModel # Details on the action required to continue the run. Will be `null` if no action # is required. # - # @param submit_tool_outputs [OpenAI::Models::Beta::Threads::Run::RequiredAction::SubmitToolOutputs] - # @param type [Symbol, :submit_tool_outputs] + # @param submit_tool_outputs [OpenAI::Models::Beta::Threads::Run::RequiredAction::SubmitToolOutputs] Details on the tool outputs needed for this run to continue. + # + # @param type [Symbol, :submit_tool_outputs] For now, this is always `submit_tool_outputs`. # @see OpenAI::Models::Beta::Threads::Run::RequiredAction#submit_tool_outputs class SubmitToolOutputs < OpenAI::Internal::Type::BaseModel @@ -350,7 +399,7 @@ class SubmitToolOutputs < OpenAI::Internal::Type::BaseModel # @!method initialize(tool_calls:) # Details on the tool outputs needed for this run to continue. # - # @param tool_calls [Array] + # @param tool_calls [Array] A list of the relevant tool calls. end end @@ -373,11 +422,17 @@ class TruncationStrategy < OpenAI::Internal::Type::BaseModel optional :last_messages, Integer, nil?: true # @!method initialize(type:, last_messages: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Run::TruncationStrategy} for more details. + # # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. # - # @param type [Symbol, OpenAI::Models::Beta::Threads::Run::TruncationStrategy::Type] - # @param last_messages [Integer, nil] + # @param type [Symbol, OpenAI::Models::Beta::Threads::Run::TruncationStrategy::Type] The truncation strategy to use for the thread. The default is `auto`. If set to + # ... + # + # @param last_messages [Integer, nil] The number of most recent messages from the thread when constructing the context + # ... # The truncation strategy to use for the thread. The default is `auto`. If set to # `last_messages`, the thread will be truncated to the n most recent messages in @@ -420,9 +475,11 @@ class Usage < OpenAI::Internal::Type::BaseModel # Usage statistics related to the run. This value will be `null` if the run is not # in a terminal state (i.e. `in_progress`, `queued`, etc.). # - # @param completion_tokens [Integer] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param completion_tokens [Integer] Number of completion tokens used over the course of the run. + # + # @param prompt_tokens [Integer] Number of prompt tokens used over the course of the run. + # + # @param total_tokens [Integer] Total number of tokens used (prompt + completion). end end end diff --git a/lib/openai/models/beta/threads/run_create_params.rb b/lib/openai/models/beta/threads/run_create_params.rb index 6af10c28..d47e1177 100644 --- a/lib/openai/models/beta/threads/run_create_params.rb +++ b/lib/openai/models/beta/threads/run_create_params.rb @@ -189,23 +189,56 @@ class RunCreateParams < OpenAI::Internal::Type::BaseModel nil?: true # @!method initialize(assistant_id:, include: nil, additional_instructions: nil, additional_messages: nil, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_choice: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {}) - # @param assistant_id [String] - # @param include [Array] - # @param additional_instructions [String, nil] - # @param additional_messages [Array, nil] - # @param instructions [String, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_prompt_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] - # @param parallel_tool_calls [Boolean] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] - # @param tools [Array, nil] - # @param top_p [Float, nil] - # @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunCreateParams} for more details. + # + # @param assistant_id [String] The ID of the [assistant](https://platform.openai.com/docs/api-reference/assista + # ... + # + # @param include [Array] A list of additional fields to include in the response. Currently the only suppo + # ... + # + # @param additional_instructions [String, nil] Appends additional instructions at the end of the instructions for the run. This + # ... + # + # @param additional_messages [Array, nil] Adds additional messages to the thread before creating the run. + # + # @param instructions [String, nil] Overrides the [instructions](https://platform.openai.com/docs/api-reference/assi + # ... + # + # @param max_completion_tokens [Integer, nil] The maximum number of completion tokens that may be used over the course of the + # ... + # + # @param max_prompt_tokens [Integer, nil] The maximum number of prompt tokens that may be used over the course of the run. + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] Controls which (if any) tool is called by the model. ... + # + # @param tools [Array, nil] Override the tools the assistant can use for this run. This is useful for modify + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil] Controls for how a thread will be truncated prior to the run. Use this to contro + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] class AdditionalMessage < OpenAI::Internal::Type::BaseModel @@ -247,10 +280,17 @@ class AdditionalMessage < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(content:, role:, attachments: nil, metadata: nil) - # @param content [String, Array] - # @param role [Symbol, OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Role] - # @param attachments [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage} for more + # details. + # + # @param content [String, Array] The text contents of the message. + # + # @param role [Symbol, OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Role] The role of the entity that is creating the message. Allowed values include: ... + # + # @param attachments [Array, nil] A list of files attached to the message, and the tools they should be added to. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... # The text contents of the message. # @@ -304,8 +344,9 @@ class Attachment < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool] } # @!method initialize(file_id: nil, tools: nil) - # @param file_id [String] - # @param tools [Array] + # @param file_id [String] The ID of the file to attach to the message. + # + # @param tools [Array] The tools to add this file to. module Tool extend OpenAI::Internal::Type::Union @@ -325,7 +366,7 @@ class FileSearch < OpenAI::Internal::Type::BaseModel required :type, const: :file_search # @!method initialize(type: :file_search) - # @param type [Symbol, :file_search] + # @param type [Symbol, :file_search] The type of tool being defined: `file_search` end # @!method self.variants @@ -368,11 +409,18 @@ class TruncationStrategy < OpenAI::Internal::Type::BaseModel optional :last_messages, Integer, nil?: true # @!method initialize(type:, last_messages: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy} for more + # details. + # # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. # - # @param type [Symbol, OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy::Type] - # @param last_messages [Integer, nil] + # @param type [Symbol, OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy::Type] The truncation strategy to use for the thread. The default is `auto`. If set to + # ... + # + # @param last_messages [Integer, nil] The number of most recent messages from the thread when constructing the context + # ... # The truncation strategy to use for the thread. The default is `auto`. If set to # `last_messages`, the thread will be truncated to the n most recent messages in diff --git a/lib/openai/models/beta/threads/run_list_params.rb b/lib/openai/models/beta/threads/run_list_params.rb index 85e39197..1ef700a7 100644 --- a/lib/openai/models/beta/threads/run_list_params.rb +++ b/lib/openai/models/beta/threads/run_list_params.rb @@ -42,10 +42,21 @@ class RunListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::Beta::Threads::RunListParams::Order } # @!method initialize(after: nil, before: nil, limit: nil, order: nil, request_options: {}) - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::Threads::RunListParams::Order] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunListParams} for more details. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::Threads::RunListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order by the `created_at` timestamp of the objects. `asc` for ascending diff --git a/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb b/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb index 34faf0fa..3ac75a5c 100644 --- a/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb +++ b/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb @@ -25,7 +25,9 @@ class RunSubmitToolOutputsParams < OpenAI::Internal::Type::BaseModel # @!method initialize(thread_id:, tool_outputs:, request_options: {}) # @param thread_id [String] - # @param tool_outputs [Array] + # + # @param tool_outputs [Array] A list of tools for which the outputs are being submitted. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] class ToolOutput < OpenAI::Internal::Type::BaseModel @@ -43,8 +45,14 @@ class ToolOutput < OpenAI::Internal::Type::BaseModel optional :tool_call_id, String # @!method initialize(output: nil, tool_call_id: nil) - # @param output [String] - # @param tool_call_id [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput} for more + # details. + # + # @param output [String] The output of the tool call to be submitted to continue the run. + # + # @param tool_call_id [String] The ID of the tool call in the `required_action` object within the run object th + # ... end end end diff --git a/lib/openai/models/beta/threads/run_update_params.rb b/lib/openai/models/beta/threads/run_update_params.rb index 2d418080..6210136c 100644 --- a/lib/openai/models/beta/threads/run_update_params.rb +++ b/lib/openai/models/beta/threads/run_update_params.rb @@ -26,8 +26,13 @@ class RunUpdateParams < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(thread_id:, metadata: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunUpdateParams} for more details. + # # @param thread_id [String] - # @param metadata [Hash{Symbol=>String}, nil] + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/beta/threads/runs/code_interpreter_logs.rb b/lib/openai/models/beta/threads/runs/code_interpreter_logs.rb index ad3f6c66..2abe8916 100644 --- a/lib/openai/models/beta/threads/runs/code_interpreter_logs.rb +++ b/lib/openai/models/beta/threads/runs/code_interpreter_logs.rb @@ -27,9 +27,11 @@ class CodeInterpreterLogs < OpenAI::Internal::Type::BaseModel # @!method initialize(index:, logs: nil, type: :logs) # Text output from the Code Interpreter tool call as part of a run step. # - # @param index [Integer] - # @param logs [String] - # @param type [Symbol, :logs] + # @param index [Integer] The index of the output in the outputs array. + # + # @param logs [String] The text output from the Code Interpreter tool call. + # + # @param type [Symbol, :logs] Always `logs`. end end end diff --git a/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rb b/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rb index 7e0c8ae1..b4458c9c 100644 --- a/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rb +++ b/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rb @@ -24,9 +24,11 @@ class CodeInterpreterOutputImage < OpenAI::Internal::Type::BaseModel optional :image, -> { OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage::Image } # @!method initialize(index:, image: nil, type: :image) - # @param index [Integer] + # @param index [Integer] The index of the output in the outputs array. + # # @param image [OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage::Image] - # @param type [Symbol, :image] + # + # @param type [Symbol, :image] Always `image`. # @see OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage#image class Image < OpenAI::Internal::Type::BaseModel @@ -38,7 +40,12 @@ class Image < OpenAI::Internal::Type::BaseModel optional :file_id, String # @!method initialize(file_id: nil) - # @param file_id [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage::Image} for + # more details. + # + # @param file_id [String] The [file](https://platform.openai.com/docs/api-reference/files) ID of the image + # ... end end end diff --git a/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb b/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb index 8c7683ea..88f00a99 100644 --- a/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb +++ b/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb @@ -27,11 +27,17 @@ class CodeInterpreterToolCall < OpenAI::Internal::Type::BaseModel required :type, const: :code_interpreter # @!method initialize(id:, code_interpreter:, type: :code_interpreter) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall} for more details. + # # Details of the Code Interpreter tool call the run step was involved in. # - # @param id [String] - # @param code_interpreter [OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter] - # @param type [Symbol, :code_interpreter] + # @param id [String] The ID of the tool call. + # + # @param code_interpreter [OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter] The Code Interpreter tool call definition. + # + # @param type [Symbol, :code_interpreter] The type of tool call. This is always going to be `code_interpreter` for this ty + # ... # @see OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall#code_interpreter class CodeInterpreter < OpenAI::Internal::Type::BaseModel @@ -51,10 +57,16 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output] } # @!method initialize(input:, outputs:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter} + # for more details. + # # The Code Interpreter tool call definition. # - # @param input [String] - # @param outputs [Array] + # @param input [String] The input to the Code Interpreter tool call. + # + # @param outputs [Array] The outputs from the Code Interpreter tool call. Code Interpreter can output one + # ... # Text output from the Code Interpreter tool call as part of a run step. module Output @@ -85,8 +97,9 @@ class Logs < OpenAI::Internal::Type::BaseModel # @!method initialize(logs:, type: :logs) # Text output from the Code Interpreter tool call as part of a run step. # - # @param logs [String] - # @param type [Symbol, :logs] + # @param logs [String] The text output from the Code Interpreter tool call. + # + # @param type [Symbol, :logs] Always `logs`. end class Image < OpenAI::Internal::Type::BaseModel @@ -104,7 +117,8 @@ class Image < OpenAI::Internal::Type::BaseModel # @!method initialize(image:, type: :image) # @param image [OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image::Image] - # @param type [Symbol, :image] + # + # @param type [Symbol, :image] Always `image`. # @see OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image#image class Image < OpenAI::Internal::Type::BaseModel @@ -116,7 +130,12 @@ class Image < OpenAI::Internal::Type::BaseModel required :file_id, String # @!method initialize(file_id:) - # @param file_id [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image::Image} + # for more details. + # + # @param file_id [String] The [file](https://platform.openai.com/docs/api-reference/files) ID of the image + # ... end end diff --git a/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb b/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb index 84e66baf..204d059b 100644 --- a/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb +++ b/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb @@ -33,12 +33,20 @@ class CodeInterpreterToolCallDelta < OpenAI::Internal::Type::BaseModel -> { OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter } # @!method initialize(index:, id: nil, code_interpreter: nil, type: :code_interpreter) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta} for more + # details. + # # Details of the Code Interpreter tool call the run step was involved in. # - # @param index [Integer] - # @param id [String] - # @param code_interpreter [OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter] - # @param type [Symbol, :code_interpreter] + # @param index [Integer] The index of the tool call in the tool calls array. + # + # @param id [String] The ID of the tool call. + # + # @param code_interpreter [OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter] The Code Interpreter tool call definition. + # + # @param type [Symbol, :code_interpreter] The type of tool call. This is always going to be `code_interpreter` for this ty + # ... # @see OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta#code_interpreter class CodeInterpreter < OpenAI::Internal::Type::BaseModel @@ -58,10 +66,16 @@ class CodeInterpreter < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter::Output] } # @!method initialize(input: nil, outputs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter} + # for more details. + # # The Code Interpreter tool call definition. # - # @param input [String] - # @param outputs [Array] + # @param input [String] The input to the Code Interpreter tool call. + # + # @param outputs [Array] The outputs from the Code Interpreter tool call. Code Interpreter can output one + # ... # Text output from the Code Interpreter tool call as part of a run step. module Output diff --git a/lib/openai/models/beta/threads/runs/file_search_tool_call.rb b/lib/openai/models/beta/threads/runs/file_search_tool_call.rb index f42b150c..d6149f24 100644 --- a/lib/openai/models/beta/threads/runs/file_search_tool_call.rb +++ b/lib/openai/models/beta/threads/runs/file_search_tool_call.rb @@ -26,9 +26,15 @@ class FileSearchToolCall < OpenAI::Internal::Type::BaseModel required :type, const: :file_search # @!method initialize(id:, file_search:, type: :file_search) - # @param id [String] - # @param file_search [OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch] - # @param type [Symbol, :file_search] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall} for more details. + # + # @param id [String] The ID of the tool call object. + # + # @param file_search [OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch] For now, this is always going to be an empty object. + # + # @param type [Symbol, :file_search] The type of tool call. This is always going to be `file_search` for this type of + # ... # @see OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall#file_search class FileSearch < OpenAI::Internal::Type::BaseModel @@ -49,8 +55,9 @@ class FileSearch < OpenAI::Internal::Type::BaseModel # @!method initialize(ranking_options: nil, results: nil) # For now, this is always going to be an empty object. # - # @param ranking_options [OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions] - # @param results [Array] + # @param ranking_options [OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions] The ranking options for the file search. + # + # @param results [Array] The results of the file search. # @see OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch#ranking_options class RankingOptions < OpenAI::Internal::Type::BaseModel @@ -70,10 +77,17 @@ class RankingOptions < OpenAI::Internal::Type::BaseModel required :score_threshold, Float # @!method initialize(ranker:, score_threshold:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions} + # for more details. + # # The ranking options for the file search. # - # @param ranker [Symbol, OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions::Ranker] - # @param score_threshold [Float] + # @param ranker [Symbol, OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions::Ranker] The ranker to use for the file search. If not specified will use the `auto` rank + # ... + # + # @param score_threshold [Float] The score threshold for the file search. All values must be a floating point num + # ... # The ranker to use for the file search. If not specified will use the `auto` # ranker. @@ -119,12 +133,21 @@ class Result < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content] } # @!method initialize(file_id:, file_name:, score:, content: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result} + # for more details. + # # A result instance of the file search. # - # @param file_id [String] - # @param file_name [String] - # @param score [Float] - # @param content [Array] + # @param file_id [String] The ID of the file that result was found in. + # + # @param file_name [String] The name of the file that result was found in. + # + # @param score [Float] The score of the result. All values must be a floating point number between 0 an + # ... + # + # @param content [Array] The content of the result that was found. The content is only included if reques + # ... class Content < OpenAI::Internal::Type::BaseModel # @!attribute text @@ -141,8 +164,9 @@ class Content < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content::Type } # @!method initialize(text: nil, type: nil) - # @param text [String] - # @param type [Symbol, OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content::Type] + # @param text [String] The text content of the file. + # + # @param type [Symbol, OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content::Type] The type of the content. # The type of the content. # diff --git a/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rb b/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rb index 31b50baf..de1c0704 100644 --- a/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rb +++ b/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rb @@ -32,10 +32,17 @@ class FileSearchToolCallDelta < OpenAI::Internal::Type::BaseModel optional :id, String # @!method initialize(file_search:, index:, id: nil, type: :file_search) - # @param file_search [Object] - # @param index [Integer] - # @param id [String] - # @param type [Symbol, :file_search] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FileSearchToolCallDelta} for more details. + # + # @param file_search [Object] For now, this is always going to be an empty object. + # + # @param index [Integer] The index of the tool call in the tool calls array. + # + # @param id [String] The ID of the tool call object. + # + # @param type [Symbol, :file_search] The type of tool call. This is always going to be `file_search` for this type of + # ... end end end diff --git a/lib/openai/models/beta/threads/runs/function_tool_call.rb b/lib/openai/models/beta/threads/runs/function_tool_call.rb index eb5ccad9..bb0655e2 100644 --- a/lib/openai/models/beta/threads/runs/function_tool_call.rb +++ b/lib/openai/models/beta/threads/runs/function_tool_call.rb @@ -26,9 +26,15 @@ class FunctionToolCall < OpenAI::Internal::Type::BaseModel required :type, const: :function # @!method initialize(id:, function:, type: :function) - # @param id [String] - # @param function [OpenAI::Models::Beta::Threads::Runs::FunctionToolCall::Function] - # @param type [Symbol, :function] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FunctionToolCall} for more details. + # + # @param id [String] The ID of the tool call object. + # + # @param function [OpenAI::Models::Beta::Threads::Runs::FunctionToolCall::Function] The definition of the function that was called. + # + # @param type [Symbol, :function] The type of tool call. This is always going to be `function` for this type of to + # ... # @see OpenAI::Models::Beta::Threads::Runs::FunctionToolCall#function class Function < OpenAI::Internal::Type::BaseModel @@ -53,11 +59,18 @@ class Function < OpenAI::Internal::Type::BaseModel required :output, String, nil?: true # @!method initialize(arguments:, name:, output:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FunctionToolCall::Function} for more + # details. + # # The definition of the function that was called. # - # @param arguments [String] - # @param name [String] - # @param output [String, nil] + # @param arguments [String] The arguments passed to the function. + # + # @param name [String] The name of the function. + # + # @param output [String, nil] The output of the function. This will be `null` if the outputs have not been [su + # ... end end end diff --git a/lib/openai/models/beta/threads/runs/function_tool_call_delta.rb b/lib/openai/models/beta/threads/runs/function_tool_call_delta.rb index c9af620f..62f29656 100644 --- a/lib/openai/models/beta/threads/runs/function_tool_call_delta.rb +++ b/lib/openai/models/beta/threads/runs/function_tool_call_delta.rb @@ -32,10 +32,17 @@ class FunctionToolCallDelta < OpenAI::Internal::Type::BaseModel optional :function, -> { OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function } # @!method initialize(index:, id: nil, function: nil, type: :function) - # @param index [Integer] - # @param id [String] - # @param function [OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function] - # @param type [Symbol, :function] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta} for more details. + # + # @param index [Integer] The index of the tool call in the tool calls array. + # + # @param id [String] The ID of the tool call object. + # + # @param function [OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function] The definition of the function that was called. + # + # @param type [Symbol, :function] The type of tool call. This is always going to be `function` for this type of to + # ... # @see OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta#function class Function < OpenAI::Internal::Type::BaseModel @@ -60,11 +67,18 @@ class Function < OpenAI::Internal::Type::BaseModel optional :output, String, nil?: true # @!method initialize(arguments: nil, name: nil, output: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function} for more + # details. + # # The definition of the function that was called. # - # @param arguments [String] - # @param name [String] - # @param output [String, nil] + # @param arguments [String] The arguments passed to the function. + # + # @param name [String] The name of the function. + # + # @param output [String, nil] The output of the function. This will be `null` if the outputs have not been [su + # ... end end end diff --git a/lib/openai/models/beta/threads/runs/message_creation_step_details.rb b/lib/openai/models/beta/threads/runs/message_creation_step_details.rb index 575eb64f..727d980b 100644 --- a/lib/openai/models/beta/threads/runs/message_creation_step_details.rb +++ b/lib/openai/models/beta/threads/runs/message_creation_step_details.rb @@ -22,7 +22,8 @@ class MessageCreationStepDetails < OpenAI::Internal::Type::BaseModel # Details of the message creation by the run step. # # @param message_creation [OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails::MessageCreation] - # @param type [Symbol, :message_creation] + # + # @param type [Symbol, :message_creation] Always `message_creation`. # @see OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails#message_creation class MessageCreation < OpenAI::Internal::Type::BaseModel @@ -33,7 +34,7 @@ class MessageCreation < OpenAI::Internal::Type::BaseModel required :message_id, String # @!method initialize(message_id:) - # @param message_id [String] + # @param message_id [String] The ID of the message that was created by this run step. end end end diff --git a/lib/openai/models/beta/threads/runs/run_step.rb b/lib/openai/models/beta/threads/runs/run_step.rb index d4fe0c67..c5076851 100644 --- a/lib/openai/models/beta/threads/runs/run_step.rb +++ b/lib/openai/models/beta/threads/runs/run_step.rb @@ -117,24 +117,49 @@ class RunStep < OpenAI::Internal::Type::BaseModel required :usage, -> { OpenAI::Models::Beta::Threads::Runs::RunStep::Usage }, nil?: true # @!method initialize(id:, assistant_id:, cancelled_at:, completed_at:, created_at:, expired_at:, failed_at:, last_error:, metadata:, run_id:, status:, step_details:, thread_id:, type:, usage:, object: :"thread.run.step") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::RunStep} for more details. + # # Represents a step in execution of a run. # - # @param id [String] - # @param assistant_id [String] - # @param cancelled_at [Integer, nil] - # @param completed_at [Integer, nil] - # @param created_at [Integer] - # @param expired_at [Integer, nil] - # @param failed_at [Integer, nil] - # @param last_error [OpenAI::Models::Beta::Threads::Runs::RunStep::LastError, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param run_id [String] - # @param status [Symbol, OpenAI::Models::Beta::Threads::Runs::RunStep::Status] - # @param step_details [OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails, OpenAI::Models::Beta::Threads::Runs::ToolCallsStepDetails] - # @param thread_id [String] - # @param type [Symbol, OpenAI::Models::Beta::Threads::Runs::RunStep::Type] - # @param usage [OpenAI::Models::Beta::Threads::Runs::RunStep::Usage, nil] - # @param object [Symbol, :"thread.run.step"] + # @param id [String] The identifier of the run step, which can be referenced in API endpoints. + # + # @param assistant_id [String] The ID of the [assistant](https://platform.openai.com/docs/api-reference/assista + # ... + # + # @param cancelled_at [Integer, nil] The Unix timestamp (in seconds) for when the run step was cancelled. + # + # @param completed_at [Integer, nil] The Unix timestamp (in seconds) for when the run step completed. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the run step was created. + # + # @param expired_at [Integer, nil] The Unix timestamp (in seconds) for when the run step expired. A step is conside + # ... + # + # @param failed_at [Integer, nil] The Unix timestamp (in seconds) for when the run step failed. + # + # @param last_error [OpenAI::Models::Beta::Threads::Runs::RunStep::LastError, nil] The last error associated with this run step. Will be `null` if there are no err + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param run_id [String] The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that th + # ... + # + # @param status [Symbol, OpenAI::Models::Beta::Threads::Runs::RunStep::Status] The status of the run step, which can be either `in_progress`, `cancelled`, `fai + # ... + # + # @param step_details [OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails, OpenAI::Models::Beta::Threads::Runs::ToolCallsStepDetails] The details of the run step. + # + # @param thread_id [String] The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) t + # ... + # + # @param type [Symbol, OpenAI::Models::Beta::Threads::Runs::RunStep::Type] The type of run step, which can be either `message_creation` or `tool_calls`. + # + # @param usage [OpenAI::Models::Beta::Threads::Runs::RunStep::Usage, nil] Usage statistics related to the run step. This value will be `null` while the ru + # ... + # + # @param object [Symbol, :"thread.run.step"] The object type, which is always `thread.run.step`. # @see OpenAI::Models::Beta::Threads::Runs::RunStep#last_error class LastError < OpenAI::Internal::Type::BaseModel @@ -154,8 +179,9 @@ class LastError < OpenAI::Internal::Type::BaseModel # The last error associated with this run step. Will be `null` if there are no # errors. # - # @param code [Symbol, OpenAI::Models::Beta::Threads::Runs::RunStep::LastError::Code] - # @param message [String] + # @param code [Symbol, OpenAI::Models::Beta::Threads::Runs::RunStep::LastError::Code] One of `server_error` or `rate_limit_exceeded`. + # + # @param message [String] A human-readable description of the error. # One of `server_error` or `rate_limit_exceeded`. # @@ -243,9 +269,11 @@ class Usage < OpenAI::Internal::Type::BaseModel # Usage statistics related to the run step. This value will be `null` while the # run step's status is `in_progress`. # - # @param completion_tokens [Integer] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param completion_tokens [Integer] Number of completion tokens used over the course of the run step. + # + # @param prompt_tokens [Integer] Number of prompt tokens used over the course of the run step. + # + # @param total_tokens [Integer] Total number of tokens used (prompt + completion). end end end diff --git a/lib/openai/models/beta/threads/runs/run_step_delta.rb b/lib/openai/models/beta/threads/runs/run_step_delta.rb index ec46591a..2a53c523 100644 --- a/lib/openai/models/beta/threads/runs/run_step_delta.rb +++ b/lib/openai/models/beta/threads/runs/run_step_delta.rb @@ -15,7 +15,7 @@ class RunStepDelta < OpenAI::Internal::Type::BaseModel # @!method initialize(step_details: nil) # The delta containing the fields that have changed on the run step. # - # @param step_details [OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta, OpenAI::Models::Beta::Threads::Runs::ToolCallDeltaObject] + # @param step_details [OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta, OpenAI::Models::Beta::Threads::Runs::ToolCallDeltaObject] The details of the run step. # The details of the run step. # diff --git a/lib/openai/models/beta/threads/runs/run_step_delta_event.rb b/lib/openai/models/beta/threads/runs/run_step_delta_event.rb index 4d83e30e..f5c81ffe 100644 --- a/lib/openai/models/beta/threads/runs/run_step_delta_event.rb +++ b/lib/openai/models/beta/threads/runs/run_step_delta_event.rb @@ -28,9 +28,11 @@ class RunStepDeltaEvent < OpenAI::Internal::Type::BaseModel # Represents a run step delta i.e. any changed fields on a run step during # streaming. # - # @param id [String] - # @param delta [OpenAI::Models::Beta::Threads::Runs::RunStepDelta] - # @param object [Symbol, :"thread.run.step.delta"] + # @param id [String] The identifier of the run step, which can be referenced in API endpoints. + # + # @param delta [OpenAI::Models::Beta::Threads::Runs::RunStepDelta] The delta containing the fields that have changed on the run step. + # + # @param object [Symbol, :"thread.run.step.delta"] The object type, which is always `thread.run.step.delta`. end end diff --git a/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb b/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb index 4335b875..85fdad6f 100644 --- a/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb +++ b/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb @@ -22,7 +22,8 @@ class RunStepDeltaMessageDelta < OpenAI::Internal::Type::BaseModel # Details of the message creation by the run step. # # @param message_creation [OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta::MessageCreation] - # @param type [Symbol, :message_creation] + # + # @param type [Symbol, :message_creation] Always `message_creation`. # @see OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta#message_creation class MessageCreation < OpenAI::Internal::Type::BaseModel @@ -33,7 +34,7 @@ class MessageCreation < OpenAI::Internal::Type::BaseModel optional :message_id, String # @!method initialize(message_id: nil) - # @param message_id [String] + # @param message_id [String] The ID of the message that was created by this run step. end end end diff --git a/lib/openai/models/beta/threads/runs/step_list_params.rb b/lib/openai/models/beta/threads/runs/step_list_params.rb index 75b02311..2bcb9cb5 100644 --- a/lib/openai/models/beta/threads/runs/step_list_params.rb +++ b/lib/openai/models/beta/threads/runs/step_list_params.rb @@ -61,12 +61,26 @@ class StepListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::Beta::Threads::Runs::StepListParams::Order } # @!method initialize(thread_id:, after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::StepListParams} for more details. + # # @param thread_id [String] - # @param after [String] - # @param before [String] - # @param include [Array] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::Threads::Runs::StepListParams::Order] + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param include [Array] A list of additional fields to include in the response. Currently the only suppo + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::Threads::Runs::StepListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order by the `created_at` timestamp of the objects. `asc` for ascending diff --git a/lib/openai/models/beta/threads/runs/step_retrieve_params.rb b/lib/openai/models/beta/threads/runs/step_retrieve_params.rb index 00db2d8a..4a2c095e 100644 --- a/lib/openai/models/beta/threads/runs/step_retrieve_params.rb +++ b/lib/openai/models/beta/threads/runs/step_retrieve_params.rb @@ -34,9 +34,16 @@ class StepRetrieveParams < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Models::Beta::Threads::Runs::RunStepInclude] } # @!method initialize(thread_id:, run_id:, include: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::StepRetrieveParams} for more details. + # # @param thread_id [String] + # # @param run_id [String] - # @param include [Array] + # + # @param include [Array] A list of additional fields to include in the response. Currently the only suppo + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/beta/threads/runs/tool_call_delta_object.rb b/lib/openai/models/beta/threads/runs/tool_call_delta_object.rb index 417a924a..51c5d074 100644 --- a/lib/openai/models/beta/threads/runs/tool_call_delta_object.rb +++ b/lib/openai/models/beta/threads/runs/tool_call_delta_object.rb @@ -22,10 +22,15 @@ class ToolCallDeltaObject < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Beta::Threads::Runs::ToolCallDelta] } # @!method initialize(tool_calls: nil, type: :tool_calls) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::ToolCallDeltaObject} for more details. + # # Details of the tool call. # - # @param tool_calls [Array] - # @param type [Symbol, :tool_calls] + # @param tool_calls [Array] An array of tool calls the run step was involved in. These can be associated wit + # ... + # + # @param type [Symbol, :tool_calls] Always `tool_calls`. end end end diff --git a/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb b/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb index 08393ac6..3a8800d6 100644 --- a/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb +++ b/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb @@ -22,10 +22,15 @@ class ToolCallsStepDetails < OpenAI::Internal::Type::BaseModel required :type, const: :tool_calls # @!method initialize(tool_calls:, type: :tool_calls) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::ToolCallsStepDetails} for more details. + # # Details of the tool call. # - # @param tool_calls [Array] - # @param type [Symbol, :tool_calls] + # @param tool_calls [Array] An array of tool calls the run step was involved in. These can be associated wit + # ... + # + # @param type [Symbol, :tool_calls] Always `tool_calls`. end end end diff --git a/lib/openai/models/beta/threads/text.rb b/lib/openai/models/beta/threads/text.rb index aa0282e1..8c5eb9f0 100644 --- a/lib/openai/models/beta/threads/text.rb +++ b/lib/openai/models/beta/threads/text.rb @@ -19,7 +19,8 @@ class Text < OpenAI::Internal::Type::BaseModel # @!method initialize(annotations:, value:) # @param annotations [Array] - # @param value [String] + # + # @param value [String] The data that makes up the text. end end end diff --git a/lib/openai/models/beta/threads/text_content_block.rb b/lib/openai/models/beta/threads/text_content_block.rb index 7d8eb24b..9f61e404 100644 --- a/lib/openai/models/beta/threads/text_content_block.rb +++ b/lib/openai/models/beta/threads/text_content_block.rb @@ -20,7 +20,8 @@ class TextContentBlock < OpenAI::Internal::Type::BaseModel # The text content that is part of a message. # # @param text [OpenAI::Models::Beta::Threads::Text] - # @param type [Symbol, :text] + # + # @param type [Symbol, :text] Always `text`. end end end diff --git a/lib/openai/models/beta/threads/text_content_block_param.rb b/lib/openai/models/beta/threads/text_content_block_param.rb index 26880392..89ff6435 100644 --- a/lib/openai/models/beta/threads/text_content_block_param.rb +++ b/lib/openai/models/beta/threads/text_content_block_param.rb @@ -20,8 +20,9 @@ class TextContentBlockParam < OpenAI::Internal::Type::BaseModel # @!method initialize(text:, type: :text) # The text content that is part of a message. # - # @param text [String] - # @param type [Symbol, :text] + # @param text [String] Text content to be sent to the model + # + # @param type [Symbol, :text] Always `text`. end end end diff --git a/lib/openai/models/beta/threads/text_delta.rb b/lib/openai/models/beta/threads/text_delta.rb index 2d767df4..20b88879 100644 --- a/lib/openai/models/beta/threads/text_delta.rb +++ b/lib/openai/models/beta/threads/text_delta.rb @@ -19,7 +19,8 @@ class TextDelta < OpenAI::Internal::Type::BaseModel # @!method initialize(annotations: nil, value: nil) # @param annotations [Array] - # @param value [String] + # + # @param value [String] The data that makes up the text. end end end diff --git a/lib/openai/models/beta/threads/text_delta_block.rb b/lib/openai/models/beta/threads/text_delta_block.rb index 7191d790..c0172733 100644 --- a/lib/openai/models/beta/threads/text_delta_block.rb +++ b/lib/openai/models/beta/threads/text_delta_block.rb @@ -25,9 +25,11 @@ class TextDeltaBlock < OpenAI::Internal::Type::BaseModel # @!method initialize(index:, text: nil, type: :text) # The text content that is part of a message. # - # @param index [Integer] + # @param index [Integer] The index of the content part in the message. + # # @param text [OpenAI::Models::Beta::Threads::TextDelta] - # @param type [Symbol, :text] + # + # @param type [Symbol, :text] Always `text`. end end end diff --git a/lib/openai/models/chat/chat_completion.rb b/lib/openai/models/chat/chat_completion.rb index 2e58ff3d..15613a18 100644 --- a/lib/openai/models/chat/chat_completion.rb +++ b/lib/openai/models/chat/chat_completion.rb @@ -76,17 +76,30 @@ class ChatCompletion < OpenAI::Internal::Type::BaseModel optional :usage, -> { OpenAI::Models::CompletionUsage } # @!method initialize(id:, choices:, created:, model:, service_tier: nil, system_fingerprint: nil, usage: nil, object: :"chat.completion") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletion} for more details. + # # Represents a chat completion response returned by model, based on the provided # input. # - # @param id [String] - # @param choices [Array] - # @param created [Integer] - # @param model [String] - # @param service_tier [Symbol, OpenAI::Models::Chat::ChatCompletion::ServiceTier, nil] - # @param system_fingerprint [String] - # @param usage [OpenAI::Models::CompletionUsage] - # @param object [Symbol, :"chat.completion"] + # @param id [String] A unique identifier for the chat completion. + # + # @param choices [Array] A list of chat completion choices. Can be more than one if `n` is greater than 1 + # ... + # + # @param created [Integer] The Unix timestamp (in seconds) of when the chat completion was created. + # + # @param model [String] The model used for the chat completion. + # + # @param service_tier [Symbol, OpenAI::Models::Chat::ChatCompletion::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param system_fingerprint [String] This fingerprint represents the backend configuration that the model runs with. + # ... + # + # @param usage [OpenAI::Models::CompletionUsage] Usage statistics for the completion request. + # + # @param object [Symbol, :"chat.completion"] The object type, which is always `chat.completion`. class Choice < OpenAI::Internal::Type::BaseModel # @!attribute finish_reason @@ -119,10 +132,17 @@ class Choice < OpenAI::Internal::Type::BaseModel required :message, -> { OpenAI::Models::Chat::ChatCompletionMessage } # @!method initialize(finish_reason:, index:, logprobs:, message:) - # @param finish_reason [Symbol, OpenAI::Models::Chat::ChatCompletion::Choice::FinishReason] - # @param index [Integer] - # @param logprobs [OpenAI::Models::Chat::ChatCompletion::Choice::Logprobs, nil] - # @param message [OpenAI::Models::Chat::ChatCompletionMessage] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletion::Choice} for more details. + # + # @param finish_reason [Symbol, OpenAI::Models::Chat::ChatCompletion::Choice::FinishReason] The reason the model stopped generating tokens. This will be `stop` if the model + # ... + # + # @param index [Integer] The index of the choice in the list of choices. + # + # @param logprobs [OpenAI::Models::Chat::ChatCompletion::Choice::Logprobs, nil] Log probability information for the choice. + # + # @param message [OpenAI::Models::Chat::ChatCompletionMessage] A chat completion message generated by the model. # The reason the model stopped generating tokens. This will be `stop` if the model # hit a natural stop point or a provided stop sequence, `length` if the maximum @@ -166,8 +186,9 @@ class Logprobs < OpenAI::Internal::Type::BaseModel # @!method initialize(content:, refusal:) # Log probability information for the choice. # - # @param content [Array, nil] - # @param refusal [Array, nil] + # @param content [Array, nil] A list of message content tokens with log probability information. + # + # @param refusal [Array, nil] A list of message refusal tokens with log probability information. end end diff --git a/lib/openai/models/chat/chat_completion_assistant_message_param.rb b/lib/openai/models/chat/chat_completion_assistant_message_param.rb index a139420e..f5bc27e0 100644 --- a/lib/openai/models/chat/chat_completion_assistant_message_param.rb +++ b/lib/openai/models/chat/chat_completion_assistant_message_param.rb @@ -58,15 +58,27 @@ class ChatCompletionAssistantMessageParam < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Chat::ChatCompletionMessageToolCall] } # @!method initialize(audio: nil, content: nil, function_call: nil, name: nil, refusal: nil, tool_calls: nil, role: :assistant) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionAssistantMessageParam} for more details. + # # Messages sent by the model in response to user messages. # - # @param audio [OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio, nil] - # @param content [String, Array, nil] - # @param function_call [OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::FunctionCall, nil] - # @param name [String] - # @param refusal [String, nil] - # @param tool_calls [Array] - # @param role [Symbol, :assistant] + # @param audio [OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio, nil] Data about a previous audio response from the model. ... + # + # @param content [String, Array, nil] The contents of the assistant message. Required unless `tool_calls` or `function + # ... + # + # @param function_call [OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::FunctionCall, nil] Deprecated and replaced by `tool_calls`. The name and arguments of a function th + # ... + # + # @param name [String] An optional name for the participant. Provides the model information to differen + # ... + # + # @param refusal [String, nil] The refusal message by the assistant. + # + # @param tool_calls [Array] The tool calls generated by the model, such as function calls. + # + # @param role [Symbol, :assistant] The role of the messages author, in this case `assistant`. # @see OpenAI::Models::Chat::ChatCompletionAssistantMessageParam#audio class Audio < OpenAI::Internal::Type::BaseModel @@ -77,10 +89,14 @@ class Audio < OpenAI::Internal::Type::BaseModel required :id, String # @!method initialize(id:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio} for more + # details. + # # Data about a previous audio response from the model. # [Learn more](https://platform.openai.com/docs/guides/audio). # - # @param id [String] + # @param id [String] Unique identifier for a previous audio response from the model. ... end # The contents of the assistant message. Required unless `tool_calls` or @@ -139,11 +155,17 @@ class FunctionCall < OpenAI::Internal::Type::BaseModel required :name, String # @!method initialize(arguments:, name:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::FunctionCall} for + # more details. + # # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. # - # @param arguments [String] - # @param name [String] + # @param arguments [String] The arguments to call the function with, as generated by the model in JSON forma + # ... + # + # @param name [String] The name of the function to call. end end end diff --git a/lib/openai/models/chat/chat_completion_audio.rb b/lib/openai/models/chat/chat_completion_audio.rb index e56cae38..4ade12b4 100644 --- a/lib/openai/models/chat/chat_completion_audio.rb +++ b/lib/openai/models/chat/chat_completion_audio.rb @@ -31,14 +31,20 @@ class ChatCompletionAudio < OpenAI::Internal::Type::BaseModel required :transcript, String # @!method initialize(id:, data:, expires_at:, transcript:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionAudio} for more details. + # # If the audio output modality is requested, this object contains data about the # audio response from the model. # [Learn more](https://platform.openai.com/docs/guides/audio). # - # @param id [String] - # @param data [String] - # @param expires_at [Integer] - # @param transcript [String] + # @param id [String] Unique identifier for this audio response. + # + # @param data [String] Base64 encoded audio bytes generated by the model, in the format ... + # + # @param expires_at [Integer] The Unix timestamp (in seconds) for when this audio response will ... + # + # @param transcript [String] Transcript of the audio generated by the model. end end diff --git a/lib/openai/models/chat/chat_completion_audio_param.rb b/lib/openai/models/chat/chat_completion_audio_param.rb index 3374567d..faff16ff 100644 --- a/lib/openai/models/chat/chat_completion_audio_param.rb +++ b/lib/openai/models/chat/chat_completion_audio_param.rb @@ -19,12 +19,16 @@ class ChatCompletionAudioParam < OpenAI::Internal::Type::BaseModel required :voice, union: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice } # @!method initialize(format_:, voice:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionAudioParam} for more details. + # # Parameters for audio output. Required when audio output is requested with # `modalities: ["audio"]`. # [Learn more](https://platform.openai.com/docs/guides/audio). # - # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format] - # @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] + # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format] Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, ... + # + # @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] The voice the model uses to respond. Supported voices are ... # Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, # or `pcm16`. diff --git a/lib/openai/models/chat/chat_completion_chunk.rb b/lib/openai/models/chat/chat_completion_chunk.rb index 05970b9f..e663c989 100644 --- a/lib/openai/models/chat/chat_completion_chunk.rb +++ b/lib/openai/models/chat/chat_completion_chunk.rb @@ -81,18 +81,32 @@ class ChatCompletionChunk < OpenAI::Internal::Type::BaseModel optional :usage, -> { OpenAI::Models::CompletionUsage }, nil?: true # @!method initialize(id:, choices:, created:, model:, service_tier: nil, system_fingerprint: nil, usage: nil, object: :"chat.completion.chunk") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionChunk} for more details. + # # Represents a streamed chunk of a chat completion response returned by the model, # based on the provided input. # [Learn more](https://platform.openai.com/docs/guides/streaming-responses). # - # @param id [String] - # @param choices [Array] - # @param created [Integer] - # @param model [String] - # @param service_tier [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::ServiceTier, nil] - # @param system_fingerprint [String] - # @param usage [OpenAI::Models::CompletionUsage, nil] - # @param object [Symbol, :"chat.completion.chunk"] + # @param id [String] A unique identifier for the chat completion. Each chunk has the same ID. + # + # @param choices [Array] A list of chat completion choices. Can contain more than one elements if `n` is + # ... + # + # @param created [Integer] The Unix timestamp (in seconds) of when the chat completion was created. Each ch + # ... + # + # @param model [String] The model to generate the completion. + # + # @param service_tier [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param system_fingerprint [String] This fingerprint represents the backend configuration that the model runs with. + # ... + # + # @param usage [OpenAI::Models::CompletionUsage, nil] An optional field that will only be present when you set ... + # + # @param object [Symbol, :"chat.completion.chunk"] The object type, which is always `chat.completion.chunk`. class Choice < OpenAI::Internal::Type::BaseModel # @!attribute delta @@ -127,10 +141,17 @@ class Choice < OpenAI::Internal::Type::BaseModel optional :logprobs, -> { OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs }, nil?: true # @!method initialize(delta:, finish_reason:, index:, logprobs: nil) - # @param delta [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta] - # @param finish_reason [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::FinishReason, nil] - # @param index [Integer] - # @param logprobs [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionChunk::Choice} for more details. + # + # @param delta [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta] A chat completion delta generated by streamed model responses. + # + # @param finish_reason [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::FinishReason, nil] The reason the model stopped generating tokens. This will be `stop` if the model + # ... + # + # @param index [Integer] The index of the choice in the list of choices. + # + # @param logprobs [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs, nil] Log probability information for the choice. # @see OpenAI::Models::Chat::ChatCompletionChunk::Choice#delta class Delta < OpenAI::Internal::Type::BaseModel @@ -168,12 +189,20 @@ class Delta < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall] } # @!method initialize(content: nil, function_call: nil, refusal: nil, role: nil, tool_calls: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta} for more details. + # # A chat completion delta generated by streamed model responses. # - # @param content [String, nil] - # @param function_call [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall] - # @param refusal [String, nil] - # @param role [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Role] + # @param content [String, nil] The contents of the chunk message. + # + # @param function_call [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall] Deprecated and replaced by `tool_calls`. The name and arguments of a function th + # ... + # + # @param refusal [String, nil] The refusal message generated by the model. + # + # @param role [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Role] The role of the author of this message. + # # @param tool_calls [Array] # @deprecated @@ -196,11 +225,17 @@ class FunctionCall < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(arguments: nil, name: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall} for + # more details. + # # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. # - # @param arguments [String] - # @param name [String] + # @param arguments [String] The arguments to call the function with, as generated by the model in JSON forma + # ... + # + # @param name [String] The name of the function to call. end # The role of the author of this message. @@ -244,9 +279,12 @@ class ToolCall < OpenAI::Internal::Type::BaseModel # @!method initialize(index:, id: nil, function: nil, type: nil) # @param index [Integer] - # @param id [String] + # + # @param id [String] The ID of the tool call. + # # @param function [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function] - # @param type [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Type] + # + # @param type [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Type] The type of the tool. Currently, only `function` is supported. # @see OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall#function class Function < OpenAI::Internal::Type::BaseModel @@ -266,8 +304,14 @@ class Function < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(arguments: nil, name: nil) - # @param arguments [String] - # @param name [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function} + # for more details. + # + # @param arguments [String] The arguments to call the function with, as generated by the model in JSON forma + # ... + # + # @param name [String] The name of the function to call. end # The type of the tool. Currently, only `function` is supported. @@ -326,8 +370,9 @@ class Logprobs < OpenAI::Internal::Type::BaseModel # @!method initialize(content:, refusal:) # Log probability information for the choice. # - # @param content [Array, nil] - # @param refusal [Array, nil] + # @param content [Array, nil] A list of message content tokens with log probability information. + # + # @param refusal [Array, nil] A list of message refusal tokens with log probability information. end end diff --git a/lib/openai/models/chat/chat_completion_content_part.rb b/lib/openai/models/chat/chat_completion_content_part.rb index ecfb1d58..b00878ec 100644 --- a/lib/openai/models/chat/chat_completion_content_part.rb +++ b/lib/openai/models/chat/chat_completion_content_part.rb @@ -39,7 +39,8 @@ class File < OpenAI::Internal::Type::BaseModel # generation. # # @param file [OpenAI::Models::Chat::ChatCompletionContentPart::File::File] - # @param type [Symbol, :file] + # + # @param type [Symbol, :file] The type of the content part. Always `file`. # @see OpenAI::Models::Chat::ChatCompletionContentPart::File#file class File < OpenAI::Internal::Type::BaseModel @@ -63,9 +64,14 @@ class File < OpenAI::Internal::Type::BaseModel optional :filename, String # @!method initialize(file_data: nil, file_id: nil, filename: nil) - # @param file_data [String] - # @param file_id [String] - # @param filename [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionContentPart::File::File} for more details. + # + # @param file_data [String] The base64 encoded file data, used when passing the file to the model ... + # + # @param file_id [String] The ID of an uploaded file to use as input. ... + # + # @param filename [String] The name of the file, used when passing the file to the model as a ... end end diff --git a/lib/openai/models/chat/chat_completion_content_part_image.rb b/lib/openai/models/chat/chat_completion_content_part_image.rb index 06c450d2..69462ff7 100644 --- a/lib/openai/models/chat/chat_completion_content_part_image.rb +++ b/lib/openai/models/chat/chat_completion_content_part_image.rb @@ -19,7 +19,8 @@ class ChatCompletionContentPartImage < OpenAI::Internal::Type::BaseModel # Learn about [image inputs](https://platform.openai.com/docs/guides/vision). # # @param image_url [OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL] - # @param type [Symbol, :image_url] + # + # @param type [Symbol, :image_url] The type of the content part. # @see OpenAI::Models::Chat::ChatCompletionContentPartImage#image_url class ImageURL < OpenAI::Internal::Type::BaseModel @@ -37,8 +38,14 @@ class ImageURL < OpenAI::Internal::Type::BaseModel optional :detail, enum: -> { OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::Detail } # @!method initialize(url:, detail: nil) - # @param url [String] - # @param detail [Symbol, OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::Detail] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL} for more + # details. + # + # @param url [String] Either a URL of the image or the base64 encoded image data. + # + # @param detail [Symbol, OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::Detail] Specifies the detail level of the image. Learn more in the [Vision guide](https: + # ... # Specifies the detail level of the image. Learn more in the # [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). diff --git a/lib/openai/models/chat/chat_completion_content_part_input_audio.rb b/lib/openai/models/chat/chat_completion_content_part_input_audio.rb index 9331e125..155990b0 100644 --- a/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +++ b/lib/openai/models/chat/chat_completion_content_part_input_audio.rb @@ -19,7 +19,8 @@ class ChatCompletionContentPartInputAudio < OpenAI::Internal::Type::BaseModel # Learn about [audio inputs](https://platform.openai.com/docs/guides/audio). # # @param input_audio [OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio] - # @param type [Symbol, :input_audio] + # + # @param type [Symbol, :input_audio] The type of the content part. Always `input_audio`. # @see OpenAI::Models::Chat::ChatCompletionContentPartInputAudio#input_audio class InputAudio < OpenAI::Internal::Type::BaseModel @@ -38,8 +39,13 @@ class InputAudio < OpenAI::Internal::Type::BaseModel api_name: :format # @!method initialize(data:, format_:) - # @param data [String] - # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio::Format] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio} for more + # details. + # + # @param data [String] Base64 encoded audio data. + # + # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio::Format] The format of the encoded audio data. Currently supports "wav" and "mp3". ... # The format of the encoded audio data. Currently supports "wav" and "mp3". # diff --git a/lib/openai/models/chat/chat_completion_content_part_refusal.rb b/lib/openai/models/chat/chat_completion_content_part_refusal.rb index 9137d008..5f1e561e 100644 --- a/lib/openai/models/chat/chat_completion_content_part_refusal.rb +++ b/lib/openai/models/chat/chat_completion_content_part_refusal.rb @@ -17,8 +17,9 @@ class ChatCompletionContentPartRefusal < OpenAI::Internal::Type::BaseModel required :type, const: :refusal # @!method initialize(refusal:, type: :refusal) - # @param refusal [String] - # @param type [Symbol, :refusal] + # @param refusal [String] The refusal message generated by the model. + # + # @param type [Symbol, :refusal] The type of the content part. end end diff --git a/lib/openai/models/chat/chat_completion_content_part_text.rb b/lib/openai/models/chat/chat_completion_content_part_text.rb index 212467d9..3800b650 100644 --- a/lib/openai/models/chat/chat_completion_content_part_text.rb +++ b/lib/openai/models/chat/chat_completion_content_part_text.rb @@ -20,8 +20,9 @@ class ChatCompletionContentPartText < OpenAI::Internal::Type::BaseModel # Learn about # [text inputs](https://platform.openai.com/docs/guides/text-generation). # - # @param text [String] - # @param type [Symbol, :text] + # @param text [String] The text content. + # + # @param type [Symbol, :text] The type of the content part. end end diff --git a/lib/openai/models/chat/chat_completion_deleted.rb b/lib/openai/models/chat/chat_completion_deleted.rb index a3125c86..2cec245f 100644 --- a/lib/openai/models/chat/chat_completion_deleted.rb +++ b/lib/openai/models/chat/chat_completion_deleted.rb @@ -24,9 +24,11 @@ class ChatCompletionDeleted < OpenAI::Internal::Type::BaseModel required :object, const: :"chat.completion.deleted" # @!method initialize(id:, deleted:, object: :"chat.completion.deleted") - # @param id [String] - # @param deleted [Boolean] - # @param object [Symbol, :"chat.completion.deleted"] + # @param id [String] The ID of the chat completion that was deleted. + # + # @param deleted [Boolean] Whether the chat completion was deleted. + # + # @param object [Symbol, :"chat.completion.deleted"] The type of object being deleted. end end diff --git a/lib/openai/models/chat/chat_completion_developer_message_param.rb b/lib/openai/models/chat/chat_completion_developer_message_param.rb index 2c7e20e4..df851c32 100644 --- a/lib/openai/models/chat/chat_completion_developer_message_param.rb +++ b/lib/openai/models/chat/chat_completion_developer_message_param.rb @@ -24,13 +24,19 @@ class ChatCompletionDeveloperMessageParam < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(content:, name: nil, role: :developer) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionDeveloperMessageParam} for more details. + # # Developer-provided instructions that the model should follow, regardless of # messages sent by the user. With o1 models and newer, `developer` messages # replace the previous `system` messages. # - # @param content [String, Array] - # @param name [String] - # @param role [Symbol, :developer] + # @param content [String, Array] The contents of the developer message. + # + # @param name [String] An optional name for the participant. Provides the model information to differen + # ... + # + # @param role [Symbol, :developer] The role of the messages author, in this case `developer`. # The contents of the developer message. # diff --git a/lib/openai/models/chat/chat_completion_function_call_option.rb b/lib/openai/models/chat/chat_completion_function_call_option.rb index 9c7d28fd..89566e41 100644 --- a/lib/openai/models/chat/chat_completion_function_call_option.rb +++ b/lib/openai/models/chat/chat_completion_function_call_option.rb @@ -14,7 +14,7 @@ class ChatCompletionFunctionCallOption < OpenAI::Internal::Type::BaseModel # Specifying a particular function via `{"name": "my_function"}` forces the model # to call that function. # - # @param name [String] + # @param name [String] The name of the function to call. end end diff --git a/lib/openai/models/chat/chat_completion_function_message_param.rb b/lib/openai/models/chat/chat_completion_function_message_param.rb index 4a8efb76..feb98749 100644 --- a/lib/openai/models/chat/chat_completion_function_message_param.rb +++ b/lib/openai/models/chat/chat_completion_function_message_param.rb @@ -24,9 +24,11 @@ class ChatCompletionFunctionMessageParam < OpenAI::Internal::Type::BaseModel required :role, const: :function # @!method initialize(content:, name:, role: :function) - # @param content [String, nil] - # @param name [String] - # @param role [Symbol, :function] + # @param content [String, nil] The contents of the function message. + # + # @param name [String] The name of the function to call. + # + # @param role [Symbol, :function] The role of the messages author, in this case `function`. end end diff --git a/lib/openai/models/chat/chat_completion_message.rb b/lib/openai/models/chat/chat_completion_message.rb index 21ca6db0..8a75e905 100644 --- a/lib/openai/models/chat/chat_completion_message.rb +++ b/lib/openai/models/chat/chat_completion_message.rb @@ -55,15 +55,25 @@ class ChatCompletionMessage < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Chat::ChatCompletionMessageToolCall] } # @!method initialize(content:, refusal:, annotations: nil, audio: nil, function_call: nil, tool_calls: nil, role: :assistant) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionMessage} for more details. + # # A chat completion message generated by the model. # - # @param content [String, nil] - # @param refusal [String, nil] - # @param annotations [Array] - # @param audio [OpenAI::Models::Chat::ChatCompletionAudio, nil] - # @param function_call [OpenAI::Models::Chat::ChatCompletionMessage::FunctionCall] - # @param tool_calls [Array] - # @param role [Symbol, :assistant] + # @param content [String, nil] The contents of the message. + # + # @param refusal [String, nil] The refusal message generated by the model. + # + # @param annotations [Array] Annotations for the message, when applicable, as when using the ... + # + # @param audio [OpenAI::Models::Chat::ChatCompletionAudio, nil] If the audio output modality is requested, this object contains data ... + # + # @param function_call [OpenAI::Models::Chat::ChatCompletionMessage::FunctionCall] Deprecated and replaced by `tool_calls`. The name and arguments of a function th + # ... + # + # @param tool_calls [Array] The tool calls generated by the model, such as function calls. + # + # @param role [Symbol, :assistant] The role of the author of this message. class Annotation < OpenAI::Internal::Type::BaseModel # @!attribute type @@ -81,8 +91,9 @@ class Annotation < OpenAI::Internal::Type::BaseModel # @!method initialize(url_citation:, type: :url_citation) # A URL citation when using web search. # - # @param url_citation [OpenAI::Models::Chat::ChatCompletionMessage::Annotation::URLCitation] - # @param type [Symbol, :url_citation] + # @param url_citation [OpenAI::Models::Chat::ChatCompletionMessage::Annotation::URLCitation] A URL citation when using web search. + # + # @param type [Symbol, :url_citation] The type of the URL citation. Always `url_citation`. # @see OpenAI::Models::Chat::ChatCompletionMessage::Annotation#url_citation class URLCitation < OpenAI::Internal::Type::BaseModel @@ -113,10 +124,13 @@ class URLCitation < OpenAI::Internal::Type::BaseModel # @!method initialize(end_index:, start_index:, title:, url:) # A URL citation when using web search. # - # @param end_index [Integer] - # @param start_index [Integer] - # @param title [String] - # @param url [String] + # @param end_index [Integer] The index of the last character of the URL citation in the message. + # + # @param start_index [Integer] The index of the first character of the URL citation in the message. + # + # @param title [String] The title of the web resource. + # + # @param url [String] The URL of the web resource. end end @@ -140,11 +154,16 @@ class FunctionCall < OpenAI::Internal::Type::BaseModel required :name, String # @!method initialize(arguments:, name:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionMessage::FunctionCall} for more details. + # # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. # - # @param arguments [String] - # @param name [String] + # @param arguments [String] The arguments to call the function with, as generated by the model in JSON forma + # ... + # + # @param name [String] The name of the function to call. end end end diff --git a/lib/openai/models/chat/chat_completion_message_tool_call.rb b/lib/openai/models/chat/chat_completion_message_tool_call.rb index adad4c9a..6ecdc5b5 100644 --- a/lib/openai/models/chat/chat_completion_message_tool_call.rb +++ b/lib/openai/models/chat/chat_completion_message_tool_call.rb @@ -23,9 +23,11 @@ class ChatCompletionMessageToolCall < OpenAI::Internal::Type::BaseModel required :type, const: :function # @!method initialize(id:, function:, type: :function) - # @param id [String] - # @param function [OpenAI::Models::Chat::ChatCompletionMessageToolCall::Function] - # @param type [Symbol, :function] + # @param id [String] The ID of the tool call. + # + # @param function [OpenAI::Models::Chat::ChatCompletionMessageToolCall::Function] The function that the model called. + # + # @param type [Symbol, :function] The type of the tool. Currently, only `function` is supported. # @see OpenAI::Models::Chat::ChatCompletionMessageToolCall#function class Function < OpenAI::Internal::Type::BaseModel @@ -45,10 +47,16 @@ class Function < OpenAI::Internal::Type::BaseModel required :name, String # @!method initialize(arguments:, name:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionMessageToolCall::Function} for more + # details. + # # The function that the model called. # - # @param arguments [String] - # @param name [String] + # @param arguments [String] The arguments to call the function with, as generated by the model in JSON forma + # ... + # + # @param name [String] The name of the function to call. end end end diff --git a/lib/openai/models/chat/chat_completion_named_tool_choice.rb b/lib/openai/models/chat/chat_completion_named_tool_choice.rb index d6d7a955..245af016 100644 --- a/lib/openai/models/chat/chat_completion_named_tool_choice.rb +++ b/lib/openai/models/chat/chat_completion_named_tool_choice.rb @@ -20,7 +20,8 @@ class ChatCompletionNamedToolChoice < OpenAI::Internal::Type::BaseModel # function. # # @param function [OpenAI::Models::Chat::ChatCompletionNamedToolChoice::Function] - # @param type [Symbol, :function] + # + # @param type [Symbol, :function] The type of the tool. Currently, only `function` is supported. # @see OpenAI::Models::Chat::ChatCompletionNamedToolChoice#function class Function < OpenAI::Internal::Type::BaseModel @@ -31,7 +32,7 @@ class Function < OpenAI::Internal::Type::BaseModel required :name, String # @!method initialize(name:) - # @param name [String] + # @param name [String] The name of the function to call. end end end diff --git a/lib/openai/models/chat/chat_completion_prediction_content.rb b/lib/openai/models/chat/chat_completion_prediction_content.rb index b6c130fb..3669e9d3 100644 --- a/lib/openai/models/chat/chat_completion_prediction_content.rb +++ b/lib/openai/models/chat/chat_completion_prediction_content.rb @@ -20,11 +20,15 @@ class ChatCompletionPredictionContent < OpenAI::Internal::Type::BaseModel required :type, const: :content # @!method initialize(content:, type: :content) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionPredictionContent} for more details. + # # Static predicted output content, such as the content of a text file that is # being regenerated. # - # @param content [String, Array] - # @param type [Symbol, :content] + # @param content [String, Array] The content that should be matched when generating a model response. ... + # + # @param type [Symbol, :content] The type of the predicted content you want to provide. This type is ... # The content that should be matched when generating a model response. If # generated tokens would match this content, the entire model response can be diff --git a/lib/openai/models/chat/chat_completion_store_message.rb b/lib/openai/models/chat/chat_completion_store_message.rb index 119b5a36..cd926898 100644 --- a/lib/openai/models/chat/chat_completion_store_message.rb +++ b/lib/openai/models/chat/chat_completion_store_message.rb @@ -13,7 +13,7 @@ class ChatCompletionStoreMessage < OpenAI::Models::Chat::ChatCompletionMessage # @!method initialize(id:) # A chat completion message generated by the model. # - # @param id [String] + # @param id [String] The identifier of the chat message. end end diff --git a/lib/openai/models/chat/chat_completion_stream_options.rb b/lib/openai/models/chat/chat_completion_stream_options.rb index 4bc8cef1..de346443 100644 --- a/lib/openai/models/chat/chat_completion_stream_options.rb +++ b/lib/openai/models/chat/chat_completion_stream_options.rb @@ -17,9 +17,12 @@ class ChatCompletionStreamOptions < OpenAI::Internal::Type::BaseModel optional :include_usage, OpenAI::Internal::Type::Boolean # @!method initialize(include_usage: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionStreamOptions} for more details. + # # Options for streaming response. Only set this when you set `stream: true`. # - # @param include_usage [Boolean] + # @param include_usage [Boolean] If set, an additional chunk will be streamed before the `data: [DONE]` ... end end diff --git a/lib/openai/models/chat/chat_completion_system_message_param.rb b/lib/openai/models/chat/chat_completion_system_message_param.rb index 19d5d598..99e35629 100644 --- a/lib/openai/models/chat/chat_completion_system_message_param.rb +++ b/lib/openai/models/chat/chat_completion_system_message_param.rb @@ -24,13 +24,19 @@ class ChatCompletionSystemMessageParam < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(content:, name: nil, role: :system) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionSystemMessageParam} for more details. + # # Developer-provided instructions that the model should follow, regardless of # messages sent by the user. With o1 models and newer, use `developer` messages # for this purpose instead. # - # @param content [String, Array] - # @param name [String] - # @param role [Symbol, :system] + # @param content [String, Array] The contents of the system message. + # + # @param name [String] An optional name for the participant. Provides the model information to differen + # ... + # + # @param role [Symbol, :system] The role of the messages author, in this case `system`. # The contents of the system message. # diff --git a/lib/openai/models/chat/chat_completion_token_logprob.rb b/lib/openai/models/chat/chat_completion_token_logprob.rb index 1ab8dd0f..2dfadc88 100644 --- a/lib/openai/models/chat/chat_completion_token_logprob.rb +++ b/lib/openai/models/chat/chat_completion_token_logprob.rb @@ -37,10 +37,19 @@ class ChatCompletionTokenLogprob < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob] } # @!method initialize(token:, bytes:, logprob:, top_logprobs:) - # @param token [String] - # @param bytes [Array, nil] - # @param logprob [Float] - # @param top_logprobs [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionTokenLogprob} for more details. + # + # @param token [String] The token. + # + # @param bytes [Array, nil] A list of integers representing the UTF-8 bytes representation of the token. Use + # ... + # + # @param logprob [Float] The log probability of this token, if it is within the top 20 most likely tokens + # ... + # + # @param top_logprobs [Array] List of the most likely tokens and their log probability, at this token position + # ... class TopLogprob < OpenAI::Internal::Type::BaseModel # @!attribute token @@ -67,9 +76,16 @@ class TopLogprob < OpenAI::Internal::Type::BaseModel required :logprob, Float # @!method initialize(token:, bytes:, logprob:) - # @param token [String] - # @param bytes [Array, nil] - # @param logprob [Float] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob} for more details. + # + # @param token [String] The token. + # + # @param bytes [Array, nil] A list of integers representing the UTF-8 bytes representation of the token. Use + # ... + # + # @param logprob [Float] The log probability of this token, if it is within the top 20 most likely tokens + # ... end end end diff --git a/lib/openai/models/chat/chat_completion_tool.rb b/lib/openai/models/chat/chat_completion_tool.rb index 1cef5fd5..c06b28d0 100644 --- a/lib/openai/models/chat/chat_completion_tool.rb +++ b/lib/openai/models/chat/chat_completion_tool.rb @@ -17,7 +17,8 @@ class ChatCompletionTool < OpenAI::Internal::Type::BaseModel # @!method initialize(function:, type: :function) # @param function [OpenAI::Models::FunctionDefinition] - # @param type [Symbol, :function] + # + # @param type [Symbol, :function] The type of the tool. Currently, only `function` is supported. end end diff --git a/lib/openai/models/chat/chat_completion_tool_message_param.rb b/lib/openai/models/chat/chat_completion_tool_message_param.rb index a0718af1..e03505be 100644 --- a/lib/openai/models/chat/chat_completion_tool_message_param.rb +++ b/lib/openai/models/chat/chat_completion_tool_message_param.rb @@ -23,9 +23,11 @@ class ChatCompletionToolMessageParam < OpenAI::Internal::Type::BaseModel required :tool_call_id, String # @!method initialize(content:, tool_call_id:, role: :tool) - # @param content [String, Array] - # @param tool_call_id [String] - # @param role [Symbol, :tool] + # @param content [String, Array] The contents of the tool message. + # + # @param tool_call_id [String] Tool call that this message is responding to. + # + # @param role [Symbol, :tool] The role of the messages author, in this case `tool`. # The contents of the tool message. # diff --git a/lib/openai/models/chat/chat_completion_user_message_param.rb b/lib/openai/models/chat/chat_completion_user_message_param.rb index 7f72cdc3..3aa9532f 100644 --- a/lib/openai/models/chat/chat_completion_user_message_param.rb +++ b/lib/openai/models/chat/chat_completion_user_message_param.rb @@ -24,12 +24,18 @@ class ChatCompletionUserMessageParam < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(content:, name: nil, role: :user) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::ChatCompletionUserMessageParam} for more details. + # # Messages sent by an end user, containing prompts or additional context # information. # - # @param content [String, Array] - # @param name [String] - # @param role [Symbol, :user] + # @param content [String, Array] The contents of the user message. ... + # + # @param name [String] An optional name for the participant. Provides the model information to differen + # ... + # + # @param role [Symbol, :user] The role of the messages author, in this case `user`. # The contents of the user message. # diff --git a/lib/openai/models/chat/completion_create_params.rb b/lib/openai/models/chat/completion_create_params.rb index 045de7a8..185edac2 100644 --- a/lib/openai/models/chat/completion_create_params.rb +++ b/lib/openai/models/chat/completion_create_params.rb @@ -329,36 +329,76 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel optional :web_search_options, -> { OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions } # @!method initialize(messages:, model:, audio: nil, frequency_penalty: nil, function_call: nil, functions: nil, logit_bias: nil, logprobs: nil, max_completion_tokens: nil, max_tokens: nil, metadata: nil, modalities: nil, n: nil, parallel_tool_calls: nil, prediction: nil, presence_penalty: nil, reasoning_effort: nil, response_format: nil, seed: nil, service_tier: nil, stop: nil, store: nil, stream_options: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, user: nil, web_search_options: nil, request_options: {}) - # @param messages [Array] - # @param model [String, Symbol, OpenAI::Models::ChatModel] - # @param audio [OpenAI::Models::Chat::ChatCompletionAudioParam, nil] - # @param frequency_penalty [Float, nil] - # @param function_call [Symbol, OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode, OpenAI::Models::Chat::ChatCompletionFunctionCallOption] - # @param functions [Array] - # @param logit_bias [Hash{Symbol=>Integer}, nil] - # @param logprobs [Boolean, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param modalities [Array, nil] - # @param n [Integer, nil] - # @param parallel_tool_calls [Boolean] - # @param prediction [OpenAI::Models::Chat::ChatCompletionPredictionContent, nil] - # @param presence_penalty [Float, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] - # @param seed [Integer, nil] - # @param service_tier [Symbol, OpenAI::Models::Chat::CompletionCreateParams::ServiceTier, nil] - # @param stop [String, Array, nil] - # @param store [Boolean, nil] - # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] - # @param temperature [Float, nil] - # @param tool_choice [Symbol, OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto, OpenAI::Models::Chat::ChatCompletionNamedToolChoice] - # @param tools [Array] - # @param top_logprobs [Integer, nil] - # @param top_p [Float, nil] - # @param user [String] - # @param web_search_options [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionCreateParams} for more details. + # + # @param messages [Array] A list of messages comprising the conversation so far. Depending on the ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel] Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI ... + # + # @param audio [OpenAI::Models::Chat::ChatCompletionAudioParam, nil] Parameters for audio output. Required when audio output is requested with ... + # + # @param frequency_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on ... + # + # @param function_call [Symbol, OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode, OpenAI::Models::Chat::ChatCompletionFunctionCallOption] Deprecated in favor of `tool_choice`. ... + # + # @param functions [Array] Deprecated in favor of `tools`. ... + # + # @param logit_bias [Hash{Symbol=>Integer}, nil] Modify the likelihood of specified tokens appearing in the completion. ... + # + # @param logprobs [Boolean, nil] Whether to return log probabilities of the output tokens or not. If true, ... + # + # @param max_completion_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a completion, + # ... + # + # @param max_tokens [Integer, nil] The maximum number of [tokens](/tokenizer) that can be generated in the ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param modalities [Array, nil] Output types that you would like the model to generate. ... + # + # @param n [Integer, nil] How many chat completion choices to generate for each input message. Note that y + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param prediction [OpenAI::Models::Chat::ChatCompletionPredictionContent, nil] Static predicted output content, such as the content of a text file that is ... + # + # @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] An object specifying the format that the model must output. ... + # + # @param seed [Integer, nil] This feature is in Beta. ... + # + # @param service_tier [Symbol, OpenAI::Models::Chat::CompletionCreateParams::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param stop [String, Array, nil] Not supported with latest reasoning models `o3` and `o4-mini`. ... + # + # @param store [Boolean, nil] Whether or not to store the output of this chat completion request for ... + # + # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] Options for streaming response. Only set this when you set `stream: true`. ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto, OpenAI::Models::Chat::ChatCompletionNamedToolChoice] Controls which (if any) tool is called by the model. ... + # + # @param tools [Array] A list of tools the model may call. Currently, only functions are supported as a + # ... + # + # @param top_logprobs [Integer, nil] An integer between 0 and 20 specifying the number of most likely tokens to ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # + # @param web_search_options [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions] This tool searches the web for relevant results to use in a response. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a @@ -452,9 +492,17 @@ class Function < OpenAI::Internal::Type::BaseModel optional :parameters, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] # @!method initialize(name:, description: nil, parameters: nil) - # @param name [String] - # @param description [String] - # @param parameters [Hash{Symbol=>Object}] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionCreateParams::Function} for more details. + # + # @param name [String] The name of the function to be called. Must be a-z, A-Z, 0-9, or contain undersc + # ... + # + # @param description [String] A description of what the function does, used by the model to choose when and ho + # ... + # + # @param parameters [Hash{Symbol=>Object}] The parameters the functions accepts, described as a JSON Schema object. See the + # ... end module Modality @@ -560,12 +608,17 @@ class WebSearchOptions < OpenAI::Internal::Type::BaseModel nil?: true # @!method initialize(search_context_size: nil, user_location: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions} for more + # details. + # # This tool searches the web for relevant results to use in a response. Learn more # about the # [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). # - # @param search_context_size [Symbol, OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize] - # @param user_location [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation, nil] + # @param search_context_size [Symbol, OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize] High level guidance for the amount of context window space to use for the ... + # + # @param user_location [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation, nil] Approximate location parameters for the search. ... # High level guidance for the amount of context window space to use for the # search. One of `low`, `medium`, or `high`. `medium` is the default. @@ -598,10 +651,15 @@ class UserLocation < OpenAI::Internal::Type::BaseModel required :type, const: :approximate # @!method initialize(approximate:, type: :approximate) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation} + # for more details. + # # Approximate location parameters for the search. # - # @param approximate [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate] - # @param type [Symbol, :approximate] + # @param approximate [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate] Approximate location parameters for the search. + # + # @param type [Symbol, :approximate] The type of location approximation. Always `approximate`. ... # @see OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation#approximate class Approximate < OpenAI::Internal::Type::BaseModel @@ -632,12 +690,19 @@ class Approximate < OpenAI::Internal::Type::BaseModel optional :timezone, String # @!method initialize(city: nil, country: nil, region: nil, timezone: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate} + # for more details. + # # Approximate location parameters for the search. # - # @param city [String] - # @param country [String] - # @param region [String] - # @param timezone [String] + # @param city [String] Free text input for the city of the user, e.g. `San Francisco`. ... + # + # @param country [String] The two-letter ... + # + # @param region [String] Free text input for the region of the user, e.g. `California`. ... + # + # @param timezone [String] The [IANA timezone](https://timeapi.io/documentation/iana-timezones) ... end end end diff --git a/lib/openai/models/chat/completion_list_params.rb b/lib/openai/models/chat/completion_list_params.rb index ab7f9060..ea9cb4c5 100644 --- a/lib/openai/models/chat/completion_list_params.rb +++ b/lib/openai/models/chat/completion_list_params.rb @@ -42,11 +42,20 @@ class CompletionListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::Chat::CompletionListParams::Order } # @!method initialize(after: nil, limit: nil, metadata: nil, model: nil, order: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param order [Symbol, OpenAI::Models::Chat::CompletionListParams::Order] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionListParams} for more details. + # + # @param after [String] Identifier for the last chat completion from the previous pagination request. + # + # @param limit [Integer] Number of Chat Completions to retrieve. + # + # @param metadata [Hash{Symbol=>String}, nil] A list of metadata keys to filter the Chat Completions by. Example: ... + # + # @param model [String] The model used to generate the Chat Completions. + # + # @param order [Symbol, OpenAI::Models::Chat::CompletionListParams::Order] Sort order for Chat Completions by timestamp. Use `asc` for ascending order or ` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order for Chat Completions by timestamp. Use `asc` for ascending order or diff --git a/lib/openai/models/chat/completion_update_params.rb b/lib/openai/models/chat/completion_update_params.rb index b3a23cff..3c2e662d 100644 --- a/lib/openai/models/chat/completion_update_params.rb +++ b/lib/openai/models/chat/completion_update_params.rb @@ -20,7 +20,11 @@ class CompletionUpdateParams < OpenAI::Internal::Type::BaseModel required :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(metadata:, request_options: {}) - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionUpdateParams} for more details. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/chat/completions/message_list_params.rb b/lib/openai/models/chat/completions/message_list_params.rb index 19a29905..775be46e 100644 --- a/lib/openai/models/chat/completions/message_list_params.rb +++ b/lib/openai/models/chat/completions/message_list_params.rb @@ -29,9 +29,16 @@ class MessageListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::Chat::Completions::MessageListParams::Order } # @!method initialize(after: nil, limit: nil, order: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Chat::Completions::MessageListParams::Order] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::Completions::MessageListParams} for more details. + # + # @param after [String] Identifier for the last message from the previous pagination request. + # + # @param limit [Integer] Number of messages to retrieve. + # + # @param order [Symbol, OpenAI::Models::Chat::Completions::MessageListParams::Order] Sort order for messages by timestamp. Use `asc` for ascending order or `desc` fo + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order for messages by timestamp. Use `asc` for ascending order or `desc` diff --git a/lib/openai/models/comparison_filter.rb b/lib/openai/models/comparison_filter.rb index 81515805..2969dedd 100644 --- a/lib/openai/models/comparison_filter.rb +++ b/lib/openai/models/comparison_filter.rb @@ -30,12 +30,18 @@ class ComparisonFilter < OpenAI::Internal::Type::BaseModel required :value, union: -> { OpenAI::Models::ComparisonFilter::Value } # @!method initialize(key:, type:, value:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ComparisonFilter} for more details. + # # A filter used to compare a specified attribute key to a given value using a # defined comparison operation. # - # @param key [String] - # @param type [Symbol, OpenAI::Models::ComparisonFilter::Type] - # @param value [String, Float, Boolean] + # @param key [String] The key to compare against the value. + # + # @param type [Symbol, OpenAI::Models::ComparisonFilter::Type] Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. ... + # + # @param value [String, Float, Boolean] The value to compare against the attribute key; supports string, number, or bool + # ... # Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. # diff --git a/lib/openai/models/completion.rb b/lib/openai/models/completion.rb index 4980830d..c493a5c5 100644 --- a/lib/openai/models/completion.rb +++ b/lib/openai/models/completion.rb @@ -52,16 +52,26 @@ class Completion < OpenAI::Internal::Type::BaseModel optional :usage, -> { OpenAI::Models::CompletionUsage } # @!method initialize(id:, choices:, created:, model:, system_fingerprint: nil, usage: nil, object: :text_completion) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Completion} for more details. + # # Represents a completion response from the API. Note: both the streamed and # non-streamed response objects share the same shape (unlike the chat endpoint). # - # @param id [String] - # @param choices [Array] - # @param created [Integer] - # @param model [String] - # @param system_fingerprint [String] - # @param usage [OpenAI::Models::CompletionUsage] - # @param object [Symbol, :text_completion] + # @param id [String] A unique identifier for the completion. + # + # @param choices [Array] The list of completion choices the model generated for the input prompt. + # + # @param created [Integer] The Unix timestamp (in seconds) of when the completion was created. + # + # @param model [String] The model used for completion. + # + # @param system_fingerprint [String] This fingerprint represents the backend configuration that the model runs with. + # ... + # + # @param usage [OpenAI::Models::CompletionUsage] Usage statistics for the completion request. + # + # @param object [Symbol, :text_completion] The object type, which is always "text_completion" end end end diff --git a/lib/openai/models/completion_choice.rb b/lib/openai/models/completion_choice.rb index 3fcd5752..5bca4663 100644 --- a/lib/openai/models/completion_choice.rb +++ b/lib/openai/models/completion_choice.rb @@ -28,9 +28,16 @@ class CompletionChoice < OpenAI::Internal::Type::BaseModel required :text, String # @!method initialize(finish_reason:, index:, logprobs:, text:) - # @param finish_reason [Symbol, OpenAI::Models::CompletionChoice::FinishReason] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::CompletionChoice} for more details. + # + # @param finish_reason [Symbol, OpenAI::Models::CompletionChoice::FinishReason] The reason the model stopped generating tokens. This will be `stop` if the model + # ... + # # @param index [Integer] + # # @param logprobs [OpenAI::Models::CompletionChoice::Logprobs, nil] + # # @param text [String] # The reason the model stopped generating tokens. This will be `stop` if the model diff --git a/lib/openai/models/completion_create_params.rb b/lib/openai/models/completion_create_params.rb index 7084d9f5..c6f47865 100644 --- a/lib/openai/models/completion_create_params.rb +++ b/lib/openai/models/completion_create_params.rb @@ -183,23 +183,54 @@ class CompletionCreateParams < OpenAI::Internal::Type::BaseModel optional :user, String # @!method initialize(model:, prompt:, best_of: nil, echo: nil, frequency_penalty: nil, logit_bias: nil, logprobs: nil, max_tokens: nil, n: nil, presence_penalty: nil, seed: nil, stop: nil, stream_options: nil, suffix: nil, temperature: nil, top_p: nil, user: nil, request_options: {}) - # @param model [String, Symbol, OpenAI::Models::CompletionCreateParams::Model] - # @param prompt [String, Array, Array, Array>, nil] - # @param best_of [Integer, nil] - # @param echo [Boolean, nil] - # @param frequency_penalty [Float, nil] - # @param logit_bias [Hash{Symbol=>Integer}, nil] - # @param logprobs [Integer, nil] - # @param max_tokens [Integer, nil] - # @param n [Integer, nil] - # @param presence_penalty [Float, nil] - # @param seed [Integer, nil] - # @param stop [String, Array, nil] - # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] - # @param suffix [String, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param user [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::CompletionCreateParams} for more details. + # + # @param model [String, Symbol, OpenAI::Models::CompletionCreateParams::Model] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param prompt [String, Array, Array, Array>, nil] The prompt(s) to generate completions for, encoded as a string, array of strings + # ... + # + # @param best_of [Integer, nil] Generates `best_of` completions server-side and returns the "best" (the one with + # ... + # + # @param echo [Boolean, nil] Echo back the prompt in addition to the completion ... + # + # @param frequency_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on their + # ... + # + # @param logit_bias [Hash{Symbol=>Integer}, nil] Modify the likelihood of specified tokens appearing in the completion. ... + # + # @param logprobs [Integer, nil] Include the log probabilities on the `logprobs` most likely output tokens, as we + # ... + # + # @param max_tokens [Integer, nil] The maximum number of [tokens](/tokenizer) that can be generated in the completi + # ... + # + # @param n [Integer, nil] How many completions to generate for each prompt. ... + # + # @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on whethe + # ... + # + # @param seed [Integer, nil] If specified, our system will make a best effort to sample deterministically, su + # ... + # + # @param stop [String, Array, nil] Not supported with latest reasoning models `o3` and `o4-mini`. ... + # + # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] Options for streaming response. Only set this when you set `stream: true`. ... + # + # @param suffix [String, nil] The suffix that comes after a completion of inserted text. ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # ID of the model to use. You can use the diff --git a/lib/openai/models/completion_usage.rb b/lib/openai/models/completion_usage.rb index e2b4092d..defd2f03 100644 --- a/lib/openai/models/completion_usage.rb +++ b/lib/openai/models/completion_usage.rb @@ -36,11 +36,15 @@ class CompletionUsage < OpenAI::Internal::Type::BaseModel # @!method initialize(completion_tokens:, prompt_tokens:, total_tokens:, completion_tokens_details: nil, prompt_tokens_details: nil) # Usage statistics for the completion request. # - # @param completion_tokens [Integer] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] - # @param completion_tokens_details [OpenAI::Models::CompletionUsage::CompletionTokensDetails] - # @param prompt_tokens_details [OpenAI::Models::CompletionUsage::PromptTokensDetails] + # @param completion_tokens [Integer] Number of tokens in the generated completion. + # + # @param prompt_tokens [Integer] Number of tokens in the prompt. + # + # @param total_tokens [Integer] Total number of tokens used in the request (prompt + completion). + # + # @param completion_tokens_details [OpenAI::Models::CompletionUsage::CompletionTokensDetails] Breakdown of tokens used in a completion. + # + # @param prompt_tokens_details [OpenAI::Models::CompletionUsage::PromptTokensDetails] Breakdown of tokens used in the prompt. # @see OpenAI::Models::CompletionUsage#completion_tokens_details class CompletionTokensDetails < OpenAI::Internal::Type::BaseModel @@ -73,12 +77,18 @@ class CompletionTokensDetails < OpenAI::Internal::Type::BaseModel optional :rejected_prediction_tokens, Integer # @!method initialize(accepted_prediction_tokens: nil, audio_tokens: nil, reasoning_tokens: nil, rejected_prediction_tokens: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::CompletionUsage::CompletionTokensDetails} for more details. + # # Breakdown of tokens used in a completion. # - # @param accepted_prediction_tokens [Integer] - # @param audio_tokens [Integer] - # @param reasoning_tokens [Integer] - # @param rejected_prediction_tokens [Integer] + # @param accepted_prediction_tokens [Integer] When using Predicted Outputs, the number of tokens in the ... + # + # @param audio_tokens [Integer] Audio input tokens generated by the model. + # + # @param reasoning_tokens [Integer] Tokens generated by the model for reasoning. + # + # @param rejected_prediction_tokens [Integer] When using Predicted Outputs, the number of tokens in the ... end # @see OpenAI::Models::CompletionUsage#prompt_tokens_details @@ -98,8 +108,9 @@ class PromptTokensDetails < OpenAI::Internal::Type::BaseModel # @!method initialize(audio_tokens: nil, cached_tokens: nil) # Breakdown of tokens used in the prompt. # - # @param audio_tokens [Integer] - # @param cached_tokens [Integer] + # @param audio_tokens [Integer] Audio input tokens present in the prompt. + # + # @param cached_tokens [Integer] Cached tokens present in the prompt. end end end diff --git a/lib/openai/models/compound_filter.rb b/lib/openai/models/compound_filter.rb index 228c5572..9dc2a93d 100644 --- a/lib/openai/models/compound_filter.rb +++ b/lib/openai/models/compound_filter.rb @@ -17,10 +17,15 @@ class CompoundFilter < OpenAI::Internal::Type::BaseModel required :type, enum: -> { OpenAI::Models::CompoundFilter::Type } # @!method initialize(filters:, type:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::CompoundFilter} for more details. + # # Combine multiple filters using `and` or `or`. # - # @param filters [Array] - # @param type [Symbol, OpenAI::Models::CompoundFilter::Type] + # @param filters [Array] Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter` + # ... + # + # @param type [Symbol, OpenAI::Models::CompoundFilter::Type] Type of operation: `and` or `or`. # A filter used to compare a specified attribute key to a given value using a # defined comparison operation. diff --git a/lib/openai/models/create_embedding_response.rb b/lib/openai/models/create_embedding_response.rb index 35e2aa45..e1030791 100644 --- a/lib/openai/models/create_embedding_response.rb +++ b/lib/openai/models/create_embedding_response.rb @@ -29,10 +29,13 @@ class CreateEmbeddingResponse < OpenAI::Internal::Type::BaseModel required :usage, -> { OpenAI::Models::CreateEmbeddingResponse::Usage } # @!method initialize(data:, model:, usage:, object: :list) - # @param data [Array] - # @param model [String] - # @param usage [OpenAI::Models::CreateEmbeddingResponse::Usage] - # @param object [Symbol, :list] + # @param data [Array] The list of embeddings generated by the model. + # + # @param model [String] The name of the model used to generate the embedding. + # + # @param usage [OpenAI::Models::CreateEmbeddingResponse::Usage] The usage information for the request. + # + # @param object [Symbol, :list] The object type, which is always "list". # @see OpenAI::Models::CreateEmbeddingResponse#usage class Usage < OpenAI::Internal::Type::BaseModel @@ -51,8 +54,9 @@ class Usage < OpenAI::Internal::Type::BaseModel # @!method initialize(prompt_tokens:, total_tokens:) # The usage information for the request. # - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param prompt_tokens [Integer] The number of tokens used by the prompt. + # + # @param total_tokens [Integer] The total number of tokens used by the request. end end end diff --git a/lib/openai/models/embedding.rb b/lib/openai/models/embedding.rb index e1e28ded..41792b3d 100644 --- a/lib/openai/models/embedding.rb +++ b/lib/openai/models/embedding.rb @@ -24,11 +24,17 @@ class Embedding < OpenAI::Internal::Type::BaseModel required :object, const: :embedding # @!method initialize(embedding:, index:, object: :embedding) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Embedding} for more details. + # # Represents an embedding vector returned by embedding endpoint. # - # @param embedding [Array] - # @param index [Integer] - # @param object [Symbol, :embedding] + # @param embedding [Array] The embedding vector, which is a list of floats. The length of vector depends on + # ... + # + # @param index [Integer] The index of the embedding in the list of embeddings. + # + # @param object [Symbol, :embedding] The object type, which is always "embedding". end end end diff --git a/lib/openai/models/embedding_create_params.rb b/lib/openai/models/embedding_create_params.rb index ec1dfd3d..f3fe5c40 100644 --- a/lib/openai/models/embedding_create_params.rb +++ b/lib/openai/models/embedding_create_params.rb @@ -53,11 +53,24 @@ class EmbeddingCreateParams < OpenAI::Internal::Type::BaseModel optional :user, String # @!method initialize(input:, model:, dimensions: nil, encoding_format: nil, user: nil, request_options: {}) - # @param input [String, Array, Array, Array>] - # @param model [String, Symbol, OpenAI::Models::EmbeddingModel] - # @param dimensions [Integer] - # @param encoding_format [Symbol, OpenAI::Models::EmbeddingCreateParams::EncodingFormat] - # @param user [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EmbeddingCreateParams} for more details. + # + # @param input [String, Array, Array, Array>] Input text to embed, encoded as a string or array of tokens. To embed multiple i + # ... + # + # @param model [String, Symbol, OpenAI::Models::EmbeddingModel] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param dimensions [Integer] The number of dimensions the resulting output embeddings should have. Only suppo + # ... + # + # @param encoding_format [Symbol, OpenAI::Models::EmbeddingCreateParams::EncodingFormat] The format to return the embeddings in. Can be either `float` or [`base64`](http + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Input text to embed, encoded as a string or array of tokens. To embed multiple diff --git a/lib/openai/models/eval_create_params.rb b/lib/openai/models/eval_create_params.rb index 5f686026..8f14b19f 100644 --- a/lib/openai/models/eval_create_params.rb +++ b/lib/openai/models/eval_create_params.rb @@ -38,10 +38,17 @@ class EvalCreateParams < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(data_source_config:, testing_criteria:, metadata: nil, name: nil, request_options: {}) - # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] - # @param testing_criteria [Array] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams} for more details. + # + # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] The configuration for the data source used for the evaluation runs. + # + # @param testing_criteria [Array] A list of graders for all eval runs in this group. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the evaluation. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The configuration for the data source used for the evaluation runs. @@ -81,6 +88,9 @@ class Custom < OpenAI::Internal::Type::BaseModel optional :include_sample_schema, OpenAI::Internal::Type::Boolean # @!method initialize(item_schema:, include_sample_schema: nil, type: :custom) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom} for more details. + # # A CustomDataSourceConfig object that defines the schema for the data source used # for the evaluation runs. This schema is used to define the shape of the data # that will be: @@ -88,9 +98,12 @@ class Custom < OpenAI::Internal::Type::BaseModel # - Used to define your testing criteria and # - What data is required when creating a run # - # @param item_schema [Hash{Symbol=>Object}] - # @param include_sample_schema [Boolean] - # @param type [Symbol, :custom] + # @param item_schema [Hash{Symbol=>Object}] The json schema for each row in the data source. + # + # @param include_sample_schema [Boolean] Whether the eval should expect you to populate the sample namespace (ie, by gene + # ... + # + # @param type [Symbol, :custom] The type of data source. Always `custom`. end class Logs < OpenAI::Internal::Type::BaseModel @@ -111,8 +124,9 @@ class Logs < OpenAI::Internal::Type::BaseModel # completions query. This is usually metadata like `usecase=chatbot` or # `prompt-version=v2`, etc. # - # @param metadata [Hash{Symbol=>Object}] - # @param type [Symbol, :logs] + # @param metadata [Hash{Symbol=>Object}] Metadata filters for the logs data source. + # + # @param type [Symbol, :logs] The type of data source. Always `logs`. end # @!method self.variants @@ -182,15 +196,25 @@ class LabelModel < OpenAI::Internal::Type::BaseModel required :type, const: :label_model # @!method initialize(input:, labels:, model:, name:, passing_labels:, type: :label_model) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel} for more + # details. + # # A LabelModelGrader object which uses a model to assign labels to each item in # the evaluation. # - # @param input [Array] - # @param labels [Array] - # @param model [String] - # @param name [String] - # @param passing_labels [Array] - # @param type [Symbol, :label_model] + # @param input [Array] A list of chat messages forming the prompt or context. May include variable refe + # ... + # + # @param labels [Array] The labels to classify to each item in the evaluation. + # + # @param model [String] The model to use for the evaluation. Must support structured outputs. + # + # @param name [String] The name of the grader. + # + # @param passing_labels [Array] The labels that indicate a passing result. Must be a subset of labels. + # + # @param type [Symbol, :label_model] The object type, which is always `label_model`. # A chat message that makes up the prompt or context. May include variable # references to the "item" namespace, ie {{item.name}}. @@ -220,8 +244,9 @@ class SimpleInputMessage < OpenAI::Internal::Type::BaseModel required :role, String # @!method initialize(content:, role:) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end class EvalItem < OpenAI::Internal::Type::BaseModel @@ -248,15 +273,21 @@ class EvalItem < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem} + # for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText] - # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role] - # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -287,10 +318,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::Input::EvalItem::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants @@ -365,11 +401,15 @@ class Python < OpenAI::Internal::Type::BaseModel # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) # A PythonGrader object that runs a python script on the input. # - # @param name [String] - # @param source [String] - # @param image_tag [String] - # @param pass_threshold [Float] - # @param type [Symbol, :python] + # @param name [String] The name of the grader. + # + # @param source [String] The source code of the python script. + # + # @param image_tag [String] The image tag to use for the python script. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param type [Symbol, :python] The object type, which is always `python`. end class ScoreModel < OpenAI::Internal::Type::BaseModel @@ -419,13 +459,19 @@ class ScoreModel < OpenAI::Internal::Type::BaseModel # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) # A ScoreModelGrader object that uses a model to assign a score to the input. # - # @param input [Array] - # @param model [String] - # @param name [String] - # @param pass_threshold [Float] - # @param range [Array] - # @param sampling_params [Object] - # @param type [Symbol, :score_model] + # @param input [Array] The input text. This may include template strings. + # + # @param model [String] The model to use for the evaluation. + # + # @param name [String] The name of the grader. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param range [Array] The range of the score. Defaults to `[0, 1]`. + # + # @param sampling_params [Object] The sampling parameters for the model. + # + # @param type [Symbol, :score_model] The object type, which is always `score_model`. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -449,15 +495,21 @@ class Input < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input} for more + # details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText] - # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role] - # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -488,10 +540,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams::TestingCriterion::ScoreModel::Input::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants diff --git a/lib/openai/models/eval_create_response.rb b/lib/openai/models/eval_create_response.rb index 65885fd7..cd141022 100644 --- a/lib/openai/models/eval_create_response.rb +++ b/lib/openai/models/eval_create_response.rb @@ -53,6 +53,9 @@ class EvalCreateResponse < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalCreateResponse::TestingCriterion] } # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateResponse} for more details. + # # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -60,13 +63,19 @@ class EvalCreateResponse < OpenAI::Internal::Type::BaseModel # - See how well my chatbot handles customer support # - Check if o3-mini is better at my usecase than gpt-4o # - # @param id [String] - # @param created_at [Integer] - # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] - # @param testing_criteria [Array] - # @param object [Symbol, :eval] + # @param id [String] Unique identifier for the evaluation. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the eval was created. + # + # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] Configuration of data sources used in runs of the evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the evaluation. + # + # @param testing_criteria [Array] A list of testing criteria. + # + # @param object [Symbol, :eval] The object type. # Configuration of data sources used in runs of the evaluation. # @@ -149,11 +158,15 @@ class Python < OpenAI::Internal::Type::BaseModel # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) # A PythonGrader object that runs a python script on the input. # - # @param name [String] - # @param source [String] - # @param image_tag [String] - # @param pass_threshold [Float] - # @param type [Symbol, :python] + # @param name [String] The name of the grader. + # + # @param source [String] The source code of the python script. + # + # @param image_tag [String] The image tag to use for the python script. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param type [Symbol, :python] The object type, which is always `python`. end class ScoreModel < OpenAI::Internal::Type::BaseModel @@ -203,13 +216,19 @@ class ScoreModel < OpenAI::Internal::Type::BaseModel # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) # A ScoreModelGrader object that uses a model to assign a score to the input. # - # @param input [Array] - # @param model [String] - # @param name [String] - # @param pass_threshold [Float] - # @param range [Array] - # @param sampling_params [Object] - # @param type [Symbol, :score_model] + # @param input [Array] The input text. This may include template strings. + # + # @param model [String] The model to use for the evaluation. + # + # @param name [String] The name of the grader. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param range [Array] The range of the score. Defaults to `[0, 1]`. + # + # @param sampling_params [Object] The sampling parameters for the model. + # + # @param type [Symbol, :score_model] The object type, which is always `score_model`. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -233,15 +252,21 @@ class Input < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input} for + # more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] - # @param role [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role] - # @param type [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -272,10 +297,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants diff --git a/lib/openai/models/eval_custom_data_source_config.rb b/lib/openai/models/eval_custom_data_source_config.rb index 04e45803..84577b43 100644 --- a/lib/openai/models/eval_custom_data_source_config.rb +++ b/lib/openai/models/eval_custom_data_source_config.rb @@ -17,6 +17,9 @@ class EvalCustomDataSourceConfig < OpenAI::Internal::Type::BaseModel required :type, const: :custom # @!method initialize(schema:, type: :custom) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCustomDataSourceConfig} for more details. + # # A CustomDataSourceConfig which specifies the schema of your `item` and # optionally `sample` namespaces. The response schema defines the shape of the # data that will be: @@ -24,8 +27,9 @@ class EvalCustomDataSourceConfig < OpenAI::Internal::Type::BaseModel # - Used to define your testing criteria and # - What data is required when creating a run # - # @param schema [Hash{Symbol=>Object}] - # @param type [Symbol, :custom] + # @param schema [Hash{Symbol=>Object}] The json schema for the run data source items. ... + # + # @param type [Symbol, :custom] The type of data source. Always `custom`. end end end diff --git a/lib/openai/models/eval_label_model_grader.rb b/lib/openai/models/eval_label_model_grader.rb index 2af7746f..32db2840 100644 --- a/lib/openai/models/eval_label_model_grader.rb +++ b/lib/openai/models/eval_label_model_grader.rb @@ -43,11 +43,16 @@ class EvalLabelModelGrader < OpenAI::Internal::Type::BaseModel # the evaluation. # # @param input [Array] - # @param labels [Array] - # @param model [String] - # @param name [String] - # @param passing_labels [Array] - # @param type [Symbol, :label_model] + # + # @param labels [Array] The labels to assign to each item in the evaluation. + # + # @param model [String] The model to use for the evaluation. Must support structured outputs. + # + # @param name [String] The name of the grader. + # + # @param passing_labels [Array] The labels that indicate a passing result. Must be a subset of labels. + # + # @param type [Symbol, :label_model] The object type, which is always `label_model`. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -70,15 +75,20 @@ class Input < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::EvalLabelModelGrader::Input::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalLabelModelGrader::Input} for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText] - # @param role [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Role] - # @param type [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::EvalLabelModelGrader::Input::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -109,10 +119,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalLabelModelGrader::Input::Content::OutputText} for more + # details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants diff --git a/lib/openai/models/eval_list_params.rb b/lib/openai/models/eval_list_params.rb index 3888ef6c..7fa913a0 100644 --- a/lib/openai/models/eval_list_params.rb +++ b/lib/openai/models/eval_list_params.rb @@ -34,10 +34,18 @@ class EvalListParams < OpenAI::Internal::Type::BaseModel optional :order_by, enum: -> { OpenAI::Models::EvalListParams::OrderBy } # @!method initialize(after: nil, limit: nil, order: nil, order_by: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::EvalListParams::Order] - # @param order_by [Symbol, OpenAI::Models::EvalListParams::OrderBy] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalListParams} for more details. + # + # @param after [String] Identifier for the last eval from the previous pagination request. + # + # @param limit [Integer] Number of evals to retrieve. + # + # @param order [Symbol, OpenAI::Models::EvalListParams::Order] Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for d + # ... + # + # @param order_by [Symbol, OpenAI::Models::EvalListParams::OrderBy] Evals can be ordered by creation time or last updated time. Use ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for diff --git a/lib/openai/models/eval_list_response.rb b/lib/openai/models/eval_list_response.rb index d80085f0..b7bf7898 100644 --- a/lib/openai/models/eval_list_response.rb +++ b/lib/openai/models/eval_list_response.rb @@ -53,6 +53,9 @@ class EvalListResponse < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalListResponse::TestingCriterion] } # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalListResponse} for more details. + # # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -60,13 +63,19 @@ class EvalListResponse < OpenAI::Internal::Type::BaseModel # - See how well my chatbot handles customer support # - Check if o3-mini is better at my usecase than gpt-4o # - # @param id [String] - # @param created_at [Integer] - # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] - # @param testing_criteria [Array] - # @param object [Symbol, :eval] + # @param id [String] Unique identifier for the evaluation. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the eval was created. + # + # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] Configuration of data sources used in runs of the evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the evaluation. + # + # @param testing_criteria [Array] A list of testing criteria. + # + # @param object [Symbol, :eval] The object type. # Configuration of data sources used in runs of the evaluation. # @@ -149,11 +158,15 @@ class Python < OpenAI::Internal::Type::BaseModel # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) # A PythonGrader object that runs a python script on the input. # - # @param name [String] - # @param source [String] - # @param image_tag [String] - # @param pass_threshold [Float] - # @param type [Symbol, :python] + # @param name [String] The name of the grader. + # + # @param source [String] The source code of the python script. + # + # @param image_tag [String] The image tag to use for the python script. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param type [Symbol, :python] The object type, which is always `python`. end class ScoreModel < OpenAI::Internal::Type::BaseModel @@ -203,13 +216,19 @@ class ScoreModel < OpenAI::Internal::Type::BaseModel # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) # A ScoreModelGrader object that uses a model to assign a score to the input. # - # @param input [Array] - # @param model [String] - # @param name [String] - # @param pass_threshold [Float] - # @param range [Array] - # @param sampling_params [Object] - # @param type [Symbol, :score_model] + # @param input [Array] The input text. This may include template strings. + # + # @param model [String] The model to use for the evaluation. + # + # @param name [String] The name of the grader. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param range [Array] The range of the score. Defaults to `[0, 1]`. + # + # @param sampling_params [Object] The sampling parameters for the model. + # + # @param type [Symbol, :score_model] The object type, which is always `score_model`. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -233,15 +252,21 @@ class Input < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input} for more + # details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] - # @param role [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role] - # @param type [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -272,10 +297,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalListResponse::TestingCriterion::ScoreModel::Input::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants diff --git a/lib/openai/models/eval_retrieve_response.rb b/lib/openai/models/eval_retrieve_response.rb index e90d4965..f6f13166 100644 --- a/lib/openai/models/eval_retrieve_response.rb +++ b/lib/openai/models/eval_retrieve_response.rb @@ -53,6 +53,9 @@ class EvalRetrieveResponse < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalRetrieveResponse::TestingCriterion] } # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalRetrieveResponse} for more details. + # # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -60,13 +63,19 @@ class EvalRetrieveResponse < OpenAI::Internal::Type::BaseModel # - See how well my chatbot handles customer support # - Check if o3-mini is better at my usecase than gpt-4o # - # @param id [String] - # @param created_at [Integer] - # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] - # @param testing_criteria [Array] - # @param object [Symbol, :eval] + # @param id [String] Unique identifier for the evaluation. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the eval was created. + # + # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] Configuration of data sources used in runs of the evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the evaluation. + # + # @param testing_criteria [Array] A list of testing criteria. + # + # @param object [Symbol, :eval] The object type. # Configuration of data sources used in runs of the evaluation. # @@ -149,11 +158,15 @@ class Python < OpenAI::Internal::Type::BaseModel # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) # A PythonGrader object that runs a python script on the input. # - # @param name [String] - # @param source [String] - # @param image_tag [String] - # @param pass_threshold [Float] - # @param type [Symbol, :python] + # @param name [String] The name of the grader. + # + # @param source [String] The source code of the python script. + # + # @param image_tag [String] The image tag to use for the python script. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param type [Symbol, :python] The object type, which is always `python`. end class ScoreModel < OpenAI::Internal::Type::BaseModel @@ -203,13 +216,19 @@ class ScoreModel < OpenAI::Internal::Type::BaseModel # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) # A ScoreModelGrader object that uses a model to assign a score to the input. # - # @param input [Array] - # @param model [String] - # @param name [String] - # @param pass_threshold [Float] - # @param range [Array] - # @param sampling_params [Object] - # @param type [Symbol, :score_model] + # @param input [Array] The input text. This may include template strings. + # + # @param model [String] The model to use for the evaluation. + # + # @param name [String] The name of the grader. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param range [Array] The range of the score. Defaults to `[0, 1]`. + # + # @param sampling_params [Object] The sampling parameters for the model. + # + # @param type [Symbol, :score_model] The object type, which is always `score_model`. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -235,15 +254,21 @@ class Input < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input} for + # more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] - # @param role [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role] - # @param type [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -274,10 +299,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalRetrieveResponse::TestingCriterion::ScoreModel::Input::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants diff --git a/lib/openai/models/eval_stored_completions_data_source_config.rb b/lib/openai/models/eval_stored_completions_data_source_config.rb index 53940b3e..0055f9bc 100644 --- a/lib/openai/models/eval_stored_completions_data_source_config.rb +++ b/lib/openai/models/eval_stored_completions_data_source_config.rb @@ -28,15 +28,20 @@ class EvalStoredCompletionsDataSourceConfig < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(schema:, metadata: nil, type: :stored_completions) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalStoredCompletionsDataSourceConfig} for more details. + # # A StoredCompletionsDataSourceConfig which specifies the metadata property of # your stored completions query. This is usually metadata like `usecase=chatbot` # or `prompt-version=v2`, etc. The schema returned by this data source config is # used to defined what variables are available in your evals. `item` and `sample` # are both defined when using this data source config. # - # @param schema [Hash{Symbol=>Object}] - # @param metadata [Hash{Symbol=>String}, nil] - # @param type [Symbol, :stored_completions] + # @param schema [Hash{Symbol=>Object}] The json schema for the run data source items. ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param type [Symbol, :stored_completions] The type of data source. Always `stored_completions`. end end end diff --git a/lib/openai/models/eval_string_check_grader.rb b/lib/openai/models/eval_string_check_grader.rb index 421bb059..8563a345 100644 --- a/lib/openai/models/eval_string_check_grader.rb +++ b/lib/openai/models/eval_string_check_grader.rb @@ -37,11 +37,15 @@ class EvalStringCheckGrader < OpenAI::Internal::Type::BaseModel # A StringCheckGrader object that performs a string comparison between input and # reference using a specified operation. # - # @param input [String] - # @param name [String] - # @param operation [Symbol, OpenAI::Models::EvalStringCheckGrader::Operation] - # @param reference [String] - # @param type [Symbol, :string_check] + # @param input [String] The input text. This may include template strings. + # + # @param name [String] The name of the grader. + # + # @param operation [Symbol, OpenAI::Models::EvalStringCheckGrader::Operation] The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. + # + # @param reference [String] The reference text. This may include template strings. + # + # @param type [Symbol, :string_check] The object type, which is always `string_check`. # The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. # diff --git a/lib/openai/models/eval_text_similarity_grader.rb b/lib/openai/models/eval_text_similarity_grader.rb index 2a8d70e0..4118b58b 100644 --- a/lib/openai/models/eval_text_similarity_grader.rb +++ b/lib/openai/models/eval_text_similarity_grader.rb @@ -41,14 +41,23 @@ class EvalTextSimilarityGrader < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(evaluation_metric:, input:, pass_threshold:, reference:, name: nil, type: :text_similarity) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalTextSimilarityGrader} for more details. + # # A TextSimilarityGrader object which grades text based on similarity metrics. # - # @param evaluation_metric [Symbol, OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric] - # @param input [String] - # @param pass_threshold [Float] - # @param reference [String] - # @param name [String] - # @param type [Symbol, :text_similarity] + # @param evaluation_metric [Symbol, OpenAI::Models::EvalTextSimilarityGrader::EvaluationMetric] The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, `r + # ... + # + # @param input [String] The text being graded. + # + # @param pass_threshold [Float] A float score where a value greater than or equal indicates a passing grade. + # + # @param reference [String] The text being graded against. + # + # @param name [String] The name of the grader. + # + # @param type [Symbol, :text_similarity] The type of grader. # The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, # `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. diff --git a/lib/openai/models/eval_update_params.rb b/lib/openai/models/eval_update_params.rb index c8476dcf..baad5c63 100644 --- a/lib/openai/models/eval_update_params.rb +++ b/lib/openai/models/eval_update_params.rb @@ -25,8 +25,13 @@ class EvalUpdateParams < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(metadata: nil, name: nil, request_options: {}) - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalUpdateParams} for more details. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] Rename the evaluation. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/eval_update_response.rb b/lib/openai/models/eval_update_response.rb index 923a9e03..2bc0b524 100644 --- a/lib/openai/models/eval_update_response.rb +++ b/lib/openai/models/eval_update_response.rb @@ -53,6 +53,9 @@ class EvalUpdateResponse < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::EvalUpdateResponse::TestingCriterion] } # @!method initialize(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalUpdateResponse} for more details. + # # An Eval object with a data source config and testing criteria. An Eval # represents a task to be done for your LLM integration. Like: # @@ -60,13 +63,19 @@ class EvalUpdateResponse < OpenAI::Internal::Type::BaseModel # - See how well my chatbot handles customer support # - Check if o3-mini is better at my usecase than gpt-4o # - # @param id [String] - # @param created_at [Integer] - # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] - # @param testing_criteria [Array] - # @param object [Symbol, :eval] + # @param id [String] Unique identifier for the evaluation. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the eval was created. + # + # @param data_source_config [OpenAI::Models::EvalCustomDataSourceConfig, OpenAI::Models::EvalStoredCompletionsDataSourceConfig] Configuration of data sources used in runs of the evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the evaluation. + # + # @param testing_criteria [Array] A list of testing criteria. + # + # @param object [Symbol, :eval] The object type. # Configuration of data sources used in runs of the evaluation. # @@ -149,11 +158,15 @@ class Python < OpenAI::Internal::Type::BaseModel # @!method initialize(name:, source:, image_tag: nil, pass_threshold: nil, type: :python) # A PythonGrader object that runs a python script on the input. # - # @param name [String] - # @param source [String] - # @param image_tag [String] - # @param pass_threshold [Float] - # @param type [Symbol, :python] + # @param name [String] The name of the grader. + # + # @param source [String] The source code of the python script. + # + # @param image_tag [String] The image tag to use for the python script. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param type [Symbol, :python] The object type, which is always `python`. end class ScoreModel < OpenAI::Internal::Type::BaseModel @@ -203,13 +216,19 @@ class ScoreModel < OpenAI::Internal::Type::BaseModel # @!method initialize(input:, model:, name:, pass_threshold: nil, range: nil, sampling_params: nil, type: :score_model) # A ScoreModelGrader object that uses a model to assign a score to the input. # - # @param input [Array] - # @param model [String] - # @param name [String] - # @param pass_threshold [Float] - # @param range [Array] - # @param sampling_params [Object] - # @param type [Symbol, :score_model] + # @param input [Array] The input text. This may include template strings. + # + # @param model [String] The model to use for the evaluation. + # + # @param name [String] The name of the grader. + # + # @param pass_threshold [Float] The threshold for the score. + # + # @param range [Array] The range of the score. Defaults to `[0, 1]`. + # + # @param sampling_params [Object] The sampling parameters for the model. + # + # @param type [Symbol, :score_model] The object type, which is always `score_model`. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -233,15 +252,21 @@ class Input < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input} for + # more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] - # @param role [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role] - # @param type [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -272,10 +297,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalUpdateResponse::TestingCriterion::ScoreModel::Input::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants diff --git a/lib/openai/models/evals/create_eval_completions_run_data_source.rb b/lib/openai/models/evals/create_eval_completions_run_data_source.rb index d4f61b7b..eaa0f6e4 100644 --- a/lib/openai/models/evals/create_eval_completions_run_data_source.rb +++ b/lib/openai/models/evals/create_eval_completions_run_data_source.rb @@ -35,12 +35,19 @@ class CreateEvalCompletionsRunDataSource < OpenAI::Internal::Type::BaseModel -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams } # @!method initialize(source:, type:, input_messages: nil, model: nil, sampling_params: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource} for more details. + # # A CompletionsRunDataSource object describing a model sampling configuration. # - # @param source [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions] - # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type] + # @param source [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::FileID, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions] A StoredCompletionsRunDataSource configuration describing a set of filters ... + # + # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Type] The type of run data source. Always `completions`. + # # @param input_messages [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::ItemReference] - # @param model [String] + # + # @param model [String] The name of the model to use for generating completions (e.g. "o3-mini"). + # # @param sampling_params [OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams] # A StoredCompletionsRunDataSource configuration describing a set of filters @@ -75,8 +82,9 @@ class FileContent < OpenAI::Internal::Type::BaseModel required :type, const: :file_content # @!method initialize(content:, type: :file_content) - # @param content [Array] - # @param type [Symbol, :file_content] + # @param content [Array] The content of the jsonl file. + # + # @param type [Symbol, :file_content] The type of jsonl source. Always `file_content`. class Content < OpenAI::Internal::Type::BaseModel # @!attribute item @@ -109,8 +117,9 @@ class FileID < OpenAI::Internal::Type::BaseModel required :type, const: :file_id # @!method initialize(id:, type: :file_id) - # @param id [String] - # @param type [Symbol, :file_id] + # @param id [String] The identifier of the file. + # + # @param type [Symbol, :file_id] The type of jsonl source. Always `file_id`. end class StoredCompletions < OpenAI::Internal::Type::BaseModel @@ -156,14 +165,23 @@ class StoredCompletions < OpenAI::Internal::Type::BaseModel optional :model, String, nil?: true # @!method initialize(created_after: nil, created_before: nil, limit: nil, metadata: nil, model: nil, type: :stored_completions) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::Source::StoredCompletions} + # for more details. + # # A StoredCompletionsRunDataSource configuration describing a set of filters # - # @param created_after [Integer, nil] - # @param created_before [Integer, nil] - # @param limit [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, nil] - # @param type [Symbol, :stored_completions] + # @param created_after [Integer, nil] An optional Unix timestamp to filter items created after this time. + # + # @param created_before [Integer, nil] An optional Unix timestamp to filter items created before this time. + # + # @param limit [Integer, nil] An optional maximum number of items to return. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, nil] An optional model to filter by (e.g., 'gpt-4o'). + # + # @param type [Symbol, :stored_completions] The type of source. Always `stored_completions`. end # @!method self.variants @@ -210,8 +228,14 @@ class Template < OpenAI::Internal::Type::BaseModel required :type, const: :template # @!method initialize(template:, type: :template) - # @param template [Array] - # @param type [Symbol, :template] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template} + # for more details. + # + # @param template [Array] A list of chat messages forming the prompt or context. May include variable refe + # ... + # + # @param type [Symbol, :template] The type of input messages. Always `template`. # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take @@ -262,15 +286,21 @@ class Message < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message} + # for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText] - # @param role [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role] - # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -301,10 +331,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants @@ -359,8 +394,9 @@ class ItemReference < OpenAI::Internal::Type::BaseModel required :type, const: :item_reference # @!method initialize(item_reference:, type: :item_reference) - # @param item_reference [String] - # @param type [Symbol, :item_reference] + # @param item_reference [String] A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @param type [Symbol, :item_reference] The type of input messages. Always `item_reference`. end # @!method self.variants @@ -394,10 +430,13 @@ class SamplingParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) - # @param max_completion_tokens [Integer] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] + # @param max_completion_tokens [Integer] The maximum number of tokens in the generated output. + # + # @param seed [Integer] A seed value to initialize the randomness, during sampling. + # + # @param temperature [Float] A higher temperature increases randomness in the outputs. + # + # @param top_p [Float] An alternative to temperature for nucleus sampling; 1.0 includes all tokens. end end end diff --git a/lib/openai/models/evals/create_eval_jsonl_run_data_source.rb b/lib/openai/models/evals/create_eval_jsonl_run_data_source.rb index 2ddad8b0..ae1cedae 100644 --- a/lib/openai/models/evals/create_eval_jsonl_run_data_source.rb +++ b/lib/openai/models/evals/create_eval_jsonl_run_data_source.rb @@ -20,7 +20,8 @@ class CreateEvalJSONLRunDataSource < OpenAI::Internal::Type::BaseModel # eval # # @param source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource::Source::FileContent, OpenAI::Models::Evals::CreateEvalJSONLRunDataSource::Source::FileID] - # @param type [Symbol, :jsonl] + # + # @param type [Symbol, :jsonl] The type of data source. Always `jsonl`. # @see OpenAI::Models::Evals::CreateEvalJSONLRunDataSource#source module Source @@ -47,8 +48,9 @@ class FileContent < OpenAI::Internal::Type::BaseModel required :type, const: :file_content # @!method initialize(content:, type: :file_content) - # @param content [Array] - # @param type [Symbol, :file_content] + # @param content [Array] The content of the jsonl file. + # + # @param type [Symbol, :file_content] The type of jsonl source. Always `file_content`. class Content < OpenAI::Internal::Type::BaseModel # @!attribute item @@ -81,8 +83,9 @@ class FileID < OpenAI::Internal::Type::BaseModel required :type, const: :file_id # @!method initialize(id:, type: :file_id) - # @param id [String] - # @param type [Symbol, :file_id] + # @param id [String] The identifier of the file. + # + # @param type [Symbol, :file_id] The type of jsonl source. Always `file_id`. end # @!method self.variants diff --git a/lib/openai/models/evals/eval_api_error.rb b/lib/openai/models/evals/eval_api_error.rb index 4d88b8dc..87f11122 100644 --- a/lib/openai/models/evals/eval_api_error.rb +++ b/lib/openai/models/evals/eval_api_error.rb @@ -19,8 +19,9 @@ class EvalAPIError < OpenAI::Internal::Type::BaseModel # @!method initialize(code:, message:) # An object representing an error response from the Eval API. # - # @param code [String] - # @param message [String] + # @param code [String] The error code. + # + # @param message [String] The error message. end end diff --git a/lib/openai/models/evals/run_cancel_response.rb b/lib/openai/models/evals/run_cancel_response.rb index 2412cad7..da5f330b 100644 --- a/lib/openai/models/evals/run_cancel_response.rb +++ b/lib/openai/models/evals/run_cancel_response.rb @@ -97,22 +97,38 @@ class RunCancelResponse < OpenAI::Internal::Type::BaseModel required :status, String # @!method initialize(id:, created_at:, data_source:, error:, eval_id:, metadata:, model:, name:, per_model_usage:, per_testing_criteria_results:, report_url:, result_counts:, status:, object: :"eval.run") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCancelResponse} for more details. + # # A schema representing an evaluation run. # - # @param id [String] - # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions] - # @param error [OpenAI::Models::Evals::EvalAPIError] - # @param eval_id [String] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param name [String] - # @param per_model_usage [Array] - # @param per_testing_criteria_results [Array] - # @param report_url [String] - # @param result_counts [OpenAI::Models::Evals::RunCancelResponse::ResultCounts] - # @param status [String] - # @param object [Symbol, :"eval.run"] + # @param id [String] Unique identifier for the evaluation run. + # + # @param created_at [Integer] Unix timestamp (in seconds) when the evaluation run was created. + # + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions] Information about the run's data source. + # + # @param error [OpenAI::Models::Evals::EvalAPIError] An object representing an error response from the Eval API. ... + # + # @param eval_id [String] The identifier of the associated evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String] The model that is evaluated, if applicable. + # + # @param name [String] The name of the evaluation run. + # + # @param per_model_usage [Array] Usage statistics for each model during the evaluation run. + # + # @param per_testing_criteria_results [Array] Results per testing criteria applied during the evaluation run. + # + # @param report_url [String] The URL to the rendered evaluation run report on the UI dashboard. + # + # @param result_counts [OpenAI::Models::Evals::RunCancelResponse::ResultCounts] Counters summarizing the outcomes of the evaluation run. + # + # @param status [String] The status of the evaluation run. + # + # @param object [Symbol, :"eval.run"] The type of the object. Always "eval.run". # Information about the run's data source. # @@ -163,13 +179,21 @@ class Completions < OpenAI::Internal::Type::BaseModel -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams } # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions} for more + # details. + # # A ResponsesRunDataSource object describing a model sampling configuration. # - # @param source [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses] + # @param source [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses] A EvalResponsesSource object describing a run data source configuration. ... + # # @param input_messages [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::ItemReference] - # @param model [String] + # + # @param model [String] The name of the model to use for generating completions (e.g. "o3-mini"). + # # @param sampling_params [OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::SamplingParams] - # @param type [Symbol, :completions] + # + # @param type [Symbol, :completions] The type of run data source. Always `completions`. # A EvalResponsesSource object describing a run data source configuration. # @@ -203,8 +227,9 @@ class FileContent < OpenAI::Internal::Type::BaseModel required :type, const: :file_content # @!method initialize(content:, type: :file_content) - # @param content [Array] - # @param type [Symbol, :file_content] + # @param content [Array] The content of the jsonl file. + # + # @param type [Symbol, :file_content] The type of jsonl source. Always `file_content`. class Content < OpenAI::Internal::Type::BaseModel # @!attribute item @@ -237,8 +262,9 @@ class FileID < OpenAI::Internal::Type::BaseModel required :type, const: :file_id # @!method initialize(id:, type: :file_id) - # @param id [String] - # @param type [Symbol, :file_id] + # @param id [String] The identifier of the file. + # + # @param type [Symbol, :file_id] The type of jsonl source. Always `file_id`. end class Responses < OpenAI::Internal::Type::BaseModel @@ -323,20 +349,43 @@ class Responses < OpenAI::Internal::Type::BaseModel optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::Source::Responses} + # for more details. + # # A EvalResponsesSource object describing a run data source configuration. # - # @param allow_parallel_tool_calls [Boolean, nil] - # @param created_after [Integer, nil] - # @param created_before [Integer, nil] - # @param has_tool_calls [Boolean, nil] - # @param instructions_search [String, nil] - # @param metadata [Object, nil] - # @param model [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param users [Array, nil] - # @param type [Symbol, :responses] + # @param allow_parallel_tool_calls [Boolean, nil] Whether to allow parallel tool calls. This is a query parameter used to select r + # ... + # + # @param created_after [Integer, nil] Only include items created after this timestamp (inclusive). This is a query par + # ... + # + # @param created_before [Integer, nil] Only include items created before this timestamp (inclusive). This is a query pa + # ... + # + # @param has_tool_calls [Boolean, nil] Whether the response has tool calls. This is a query parameter used to select re + # ... + # + # @param instructions_search [String, nil] Optional search string for instructions. This is a query parameter used to selec + # ... + # + # @param metadata [Object, nil] Metadata filter for the responses. This is a query parameter used to select resp + # ... + # + # @param model [String, nil] The name of the model to find responses for. This is a query parameter used to s + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Optional reasoning effort parameter. This is a query parameter used to select re + # ... + # + # @param temperature [Float, nil] Sampling temperature. This is a query parameter used to select responses. + # + # @param top_p [Float, nil] Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @param users [Array, nil] List of user identifiers. This is a query parameter used to select responses. + # + # @param type [Symbol, :responses] The type of run data source. Always `responses`. end # @!method self.variants @@ -375,8 +424,14 @@ class Template < OpenAI::Internal::Type::BaseModel required :type, const: :template # @!method initialize(template:, type: :template) - # @param template [Array] - # @param type [Symbol, :template] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template} + # for more details. + # + # @param template [Array] A list of chat messages forming the prompt or context. May include variable refe + # ... + # + # @param type [Symbol, :template] The type of input messages. Always `template`. # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take @@ -409,8 +464,9 @@ class ChatMessage < OpenAI::Internal::Type::BaseModel required :role, String # @!method initialize(content:, role:) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end class EvalItem < OpenAI::Internal::Type::BaseModel @@ -437,15 +493,21 @@ class EvalItem < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem} + # for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] - # @param role [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] - # @param type [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -476,10 +538,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCancelResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants @@ -534,8 +601,9 @@ class ItemReference < OpenAI::Internal::Type::BaseModel required :type, const: :item_reference # @!method initialize(item_reference:, type: :item_reference) - # @param item_reference [String] - # @param type [Symbol, :item_reference] + # @param item_reference [String] A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @param type [Symbol, :item_reference] The type of input messages. Always `item_reference`. end # @!method self.variants @@ -569,10 +637,13 @@ class SamplingParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) - # @param max_completion_tokens [Integer] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] + # @param max_completion_tokens [Integer] The maximum number of tokens in the generated output. + # + # @param seed [Integer] A seed value to initialize the randomness, during sampling. + # + # @param temperature [Float] A higher temperature increases randomness in the outputs. + # + # @param top_p [Float] An alternative to temperature for nucleus sampling; 1.0 includes all tokens. end end @@ -618,12 +689,17 @@ class PerModelUsage < OpenAI::Internal::Type::BaseModel required :total_tokens, Integer # @!method initialize(cached_tokens:, completion_tokens:, invocation_count:, model_name:, prompt_tokens:, total_tokens:) - # @param cached_tokens [Integer] - # @param completion_tokens [Integer] - # @param invocation_count [Integer] - # @param model_name [String] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param cached_tokens [Integer] The number of tokens retrieved from cache. + # + # @param completion_tokens [Integer] The number of completion tokens generated. + # + # @param invocation_count [Integer] The number of invocations. + # + # @param model_name [String] The name of the model. + # + # @param prompt_tokens [Integer] The number of prompt tokens used. + # + # @param total_tokens [Integer] The total number of tokens used. end class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel @@ -646,9 +722,11 @@ class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel required :testing_criteria, String # @!method initialize(failed:, passed:, testing_criteria:) - # @param failed [Integer] - # @param passed [Integer] - # @param testing_criteria [String] + # @param failed [Integer] Number of tests failed for this criteria. + # + # @param passed [Integer] Number of tests passed for this criteria. + # + # @param testing_criteria [String] A description of the testing criteria. end # @see OpenAI::Models::Evals::RunCancelResponse#result_counts @@ -680,10 +758,13 @@ class ResultCounts < OpenAI::Internal::Type::BaseModel # @!method initialize(errored:, failed:, passed:, total:) # Counters summarizing the outcomes of the evaluation run. # - # @param errored [Integer] - # @param failed [Integer] - # @param passed [Integer] - # @param total [Integer] + # @param errored [Integer] Number of output items that resulted in an error. + # + # @param failed [Integer] Number of output items that failed to pass the evaluation. + # + # @param passed [Integer] Number of output items that passed the evaluation. + # + # @param total [Integer] Total number of executed output items. end end end diff --git a/lib/openai/models/evals/run_create_params.rb b/lib/openai/models/evals/run_create_params.rb index 6ee4266d..73ceb87e 100644 --- a/lib/openai/models/evals/run_create_params.rb +++ b/lib/openai/models/evals/run_create_params.rb @@ -32,9 +32,15 @@ class RunCreateParams < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(data_source:, metadata: nil, name: nil, request_options: {}) - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateParams} for more details. + # + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] Details about the run's data source. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the run. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Details about the run's data source. @@ -84,12 +90,20 @@ class CreateEvalResponsesRunDataSource < OpenAI::Internal::Type::BaseModel -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams } # @!method initialize(source:, type:, input_messages: nil, model: nil, sampling_params: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource} + # for more details. + # # A ResponsesRunDataSource object describing a model sampling configuration. # - # @param source [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses] - # @param type [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type] + # @param source [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileContent, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::FileID, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses] A EvalResponsesSource object describing a run data source configuration. ... + # + # @param type [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Type] The type of run data source. Always `completions`. + # # @param input_messages [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::ItemReference] - # @param model [String] + # + # @param model [String] The name of the model to use for generating completions (e.g. "o3-mini"). + # # @param sampling_params [OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams] # A EvalResponsesSource object describing a run data source configuration. @@ -129,8 +143,9 @@ class FileContent < OpenAI::Internal::Type::BaseModel required :type, const: :file_content # @!method initialize(content:, type: :file_content) - # @param content [Array] - # @param type [Symbol, :file_content] + # @param content [Array] The content of the jsonl file. + # + # @param type [Symbol, :file_content] The type of jsonl source. Always `file_content`. class Content < OpenAI::Internal::Type::BaseModel # @!attribute item @@ -163,8 +178,9 @@ class FileID < OpenAI::Internal::Type::BaseModel required :type, const: :file_id # @!method initialize(id:, type: :file_id) - # @param id [String] - # @param type [Symbol, :file_id] + # @param id [String] The identifier of the file. + # + # @param type [Symbol, :file_id] The type of jsonl source. Always `file_id`. end class Responses < OpenAI::Internal::Type::BaseModel @@ -249,20 +265,43 @@ class Responses < OpenAI::Internal::Type::BaseModel optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::Source::Responses} + # for more details. + # # A EvalResponsesSource object describing a run data source configuration. # - # @param allow_parallel_tool_calls [Boolean, nil] - # @param created_after [Integer, nil] - # @param created_before [Integer, nil] - # @param has_tool_calls [Boolean, nil] - # @param instructions_search [String, nil] - # @param metadata [Object, nil] - # @param model [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param users [Array, nil] - # @param type [Symbol, :responses] + # @param allow_parallel_tool_calls [Boolean, nil] Whether to allow parallel tool calls. This is a query parameter used to select r + # ... + # + # @param created_after [Integer, nil] Only include items created after this timestamp (inclusive). This is a query par + # ... + # + # @param created_before [Integer, nil] Only include items created before this timestamp (inclusive). This is a query pa + # ... + # + # @param has_tool_calls [Boolean, nil] Whether the response has tool calls. This is a query parameter used to select re + # ... + # + # @param instructions_search [String, nil] Optional search string for instructions. This is a query parameter used to selec + # ... + # + # @param metadata [Object, nil] Metadata filter for the responses. This is a query parameter used to select resp + # ... + # + # @param model [String, nil] The name of the model to find responses for. This is a query parameter used to s + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Optional reasoning effort parameter. This is a query parameter used to select re + # ... + # + # @param temperature [Float, nil] Sampling temperature. This is a query parameter used to select responses. + # + # @param top_p [Float, nil] Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @param users [Array, nil] List of user identifiers. This is a query parameter used to select responses. + # + # @param type [Symbol, :responses] The type of run data source. Always `responses`. end # @!method self.variants @@ -313,8 +352,14 @@ class Template < OpenAI::Internal::Type::BaseModel required :type, const: :template # @!method initialize(template:, type: :template) - # @param template [Array] - # @param type [Symbol, :template] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template} + # for more details. + # + # @param template [Array] A list of chat messages forming the prompt or context. May include variable refe + # ... + # + # @param type [Symbol, :template] The type of input messages. Always `template`. # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take @@ -347,8 +392,9 @@ class ChatMessage < OpenAI::Internal::Type::BaseModel required :role, String # @!method initialize(content:, role:) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end class EvalItem < OpenAI::Internal::Type::BaseModel @@ -375,15 +421,21 @@ class EvalItem < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem} + # for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText] - # @param role [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role] - # @param type [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -414,10 +466,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants @@ -472,8 +529,9 @@ class ItemReference < OpenAI::Internal::Type::BaseModel required :type, const: :item_reference # @!method initialize(item_reference:, type: :item_reference) - # @param item_reference [String] - # @param type [Symbol, :item_reference] + # @param item_reference [String] A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @param type [Symbol, :item_reference] The type of input messages. Always `item_reference`. end # @!method self.variants @@ -507,10 +565,13 @@ class SamplingParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) - # @param max_completion_tokens [Integer] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] + # @param max_completion_tokens [Integer] The maximum number of tokens in the generated output. + # + # @param seed [Integer] A seed value to initialize the randomness, during sampling. + # + # @param temperature [Float] A higher temperature increases randomness in the outputs. + # + # @param top_p [Float] An alternative to temperature for nucleus sampling; 1.0 includes all tokens. end end diff --git a/lib/openai/models/evals/run_create_response.rb b/lib/openai/models/evals/run_create_response.rb index 22a5752b..2326f6f0 100644 --- a/lib/openai/models/evals/run_create_response.rb +++ b/lib/openai/models/evals/run_create_response.rb @@ -97,22 +97,38 @@ class RunCreateResponse < OpenAI::Internal::Type::BaseModel required :status, String # @!method initialize(id:, created_at:, data_source:, error:, eval_id:, metadata:, model:, name:, per_model_usage:, per_testing_criteria_results:, report_url:, result_counts:, status:, object: :"eval.run") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateResponse} for more details. + # # A schema representing an evaluation run. # - # @param id [String] - # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions] - # @param error [OpenAI::Models::Evals::EvalAPIError] - # @param eval_id [String] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param name [String] - # @param per_model_usage [Array] - # @param per_testing_criteria_results [Array] - # @param report_url [String] - # @param result_counts [OpenAI::Models::Evals::RunCreateResponse::ResultCounts] - # @param status [String] - # @param object [Symbol, :"eval.run"] + # @param id [String] Unique identifier for the evaluation run. + # + # @param created_at [Integer] Unix timestamp (in seconds) when the evaluation run was created. + # + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions] Information about the run's data source. + # + # @param error [OpenAI::Models::Evals::EvalAPIError] An object representing an error response from the Eval API. ... + # + # @param eval_id [String] The identifier of the associated evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String] The model that is evaluated, if applicable. + # + # @param name [String] The name of the evaluation run. + # + # @param per_model_usage [Array] Usage statistics for each model during the evaluation run. + # + # @param per_testing_criteria_results [Array] Results per testing criteria applied during the evaluation run. + # + # @param report_url [String] The URL to the rendered evaluation run report on the UI dashboard. + # + # @param result_counts [OpenAI::Models::Evals::RunCreateResponse::ResultCounts] Counters summarizing the outcomes of the evaluation run. + # + # @param status [String] The status of the evaluation run. + # + # @param object [Symbol, :"eval.run"] The type of the object. Always "eval.run". # Information about the run's data source. # @@ -163,13 +179,21 @@ class Completions < OpenAI::Internal::Type::BaseModel -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams } # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions} for more + # details. + # # A ResponsesRunDataSource object describing a model sampling configuration. # - # @param source [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses] + # @param source [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses] A EvalResponsesSource object describing a run data source configuration. ... + # # @param input_messages [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::ItemReference] - # @param model [String] + # + # @param model [String] The name of the model to use for generating completions (e.g. "o3-mini"). + # # @param sampling_params [OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::SamplingParams] - # @param type [Symbol, :completions] + # + # @param type [Symbol, :completions] The type of run data source. Always `completions`. # A EvalResponsesSource object describing a run data source configuration. # @@ -203,8 +227,9 @@ class FileContent < OpenAI::Internal::Type::BaseModel required :type, const: :file_content # @!method initialize(content:, type: :file_content) - # @param content [Array] - # @param type [Symbol, :file_content] + # @param content [Array] The content of the jsonl file. + # + # @param type [Symbol, :file_content] The type of jsonl source. Always `file_content`. class Content < OpenAI::Internal::Type::BaseModel # @!attribute item @@ -237,8 +262,9 @@ class FileID < OpenAI::Internal::Type::BaseModel required :type, const: :file_id # @!method initialize(id:, type: :file_id) - # @param id [String] - # @param type [Symbol, :file_id] + # @param id [String] The identifier of the file. + # + # @param type [Symbol, :file_id] The type of jsonl source. Always `file_id`. end class Responses < OpenAI::Internal::Type::BaseModel @@ -323,20 +349,43 @@ class Responses < OpenAI::Internal::Type::BaseModel optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::Source::Responses} + # for more details. + # # A EvalResponsesSource object describing a run data source configuration. # - # @param allow_parallel_tool_calls [Boolean, nil] - # @param created_after [Integer, nil] - # @param created_before [Integer, nil] - # @param has_tool_calls [Boolean, nil] - # @param instructions_search [String, nil] - # @param metadata [Object, nil] - # @param model [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param users [Array, nil] - # @param type [Symbol, :responses] + # @param allow_parallel_tool_calls [Boolean, nil] Whether to allow parallel tool calls. This is a query parameter used to select r + # ... + # + # @param created_after [Integer, nil] Only include items created after this timestamp (inclusive). This is a query par + # ... + # + # @param created_before [Integer, nil] Only include items created before this timestamp (inclusive). This is a query pa + # ... + # + # @param has_tool_calls [Boolean, nil] Whether the response has tool calls. This is a query parameter used to select re + # ... + # + # @param instructions_search [String, nil] Optional search string for instructions. This is a query parameter used to selec + # ... + # + # @param metadata [Object, nil] Metadata filter for the responses. This is a query parameter used to select resp + # ... + # + # @param model [String, nil] The name of the model to find responses for. This is a query parameter used to s + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Optional reasoning effort parameter. This is a query parameter used to select re + # ... + # + # @param temperature [Float, nil] Sampling temperature. This is a query parameter used to select responses. + # + # @param top_p [Float, nil] Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @param users [Array, nil] List of user identifiers. This is a query parameter used to select responses. + # + # @param type [Symbol, :responses] The type of run data source. Always `responses`. end # @!method self.variants @@ -375,8 +424,14 @@ class Template < OpenAI::Internal::Type::BaseModel required :type, const: :template # @!method initialize(template:, type: :template) - # @param template [Array] - # @param type [Symbol, :template] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template} + # for more details. + # + # @param template [Array] A list of chat messages forming the prompt or context. May include variable refe + # ... + # + # @param type [Symbol, :template] The type of input messages. Always `template`. # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take @@ -409,8 +464,9 @@ class ChatMessage < OpenAI::Internal::Type::BaseModel required :role, String # @!method initialize(content:, role:) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end class EvalItem < OpenAI::Internal::Type::BaseModel @@ -437,15 +493,21 @@ class EvalItem < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem} + # for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] - # @param role [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] - # @param type [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -476,10 +538,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants @@ -534,8 +601,9 @@ class ItemReference < OpenAI::Internal::Type::BaseModel required :type, const: :item_reference # @!method initialize(item_reference:, type: :item_reference) - # @param item_reference [String] - # @param type [Symbol, :item_reference] + # @param item_reference [String] A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @param type [Symbol, :item_reference] The type of input messages. Always `item_reference`. end # @!method self.variants @@ -569,10 +637,13 @@ class SamplingParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) - # @param max_completion_tokens [Integer] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] + # @param max_completion_tokens [Integer] The maximum number of tokens in the generated output. + # + # @param seed [Integer] A seed value to initialize the randomness, during sampling. + # + # @param temperature [Float] A higher temperature increases randomness in the outputs. + # + # @param top_p [Float] An alternative to temperature for nucleus sampling; 1.0 includes all tokens. end end @@ -618,12 +689,17 @@ class PerModelUsage < OpenAI::Internal::Type::BaseModel required :total_tokens, Integer # @!method initialize(cached_tokens:, completion_tokens:, invocation_count:, model_name:, prompt_tokens:, total_tokens:) - # @param cached_tokens [Integer] - # @param completion_tokens [Integer] - # @param invocation_count [Integer] - # @param model_name [String] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param cached_tokens [Integer] The number of tokens retrieved from cache. + # + # @param completion_tokens [Integer] The number of completion tokens generated. + # + # @param invocation_count [Integer] The number of invocations. + # + # @param model_name [String] The name of the model. + # + # @param prompt_tokens [Integer] The number of prompt tokens used. + # + # @param total_tokens [Integer] The total number of tokens used. end class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel @@ -646,9 +722,11 @@ class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel required :testing_criteria, String # @!method initialize(failed:, passed:, testing_criteria:) - # @param failed [Integer] - # @param passed [Integer] - # @param testing_criteria [String] + # @param failed [Integer] Number of tests failed for this criteria. + # + # @param passed [Integer] Number of tests passed for this criteria. + # + # @param testing_criteria [String] A description of the testing criteria. end # @see OpenAI::Models::Evals::RunCreateResponse#result_counts @@ -680,10 +758,13 @@ class ResultCounts < OpenAI::Internal::Type::BaseModel # @!method initialize(errored:, failed:, passed:, total:) # Counters summarizing the outcomes of the evaluation run. # - # @param errored [Integer] - # @param failed [Integer] - # @param passed [Integer] - # @param total [Integer] + # @param errored [Integer] Number of output items that resulted in an error. + # + # @param failed [Integer] Number of output items that failed to pass the evaluation. + # + # @param passed [Integer] Number of output items that passed the evaluation. + # + # @param total [Integer] Total number of executed output items. end end end diff --git a/lib/openai/models/evals/run_list_params.rb b/lib/openai/models/evals/run_list_params.rb index 66cd4270..d828e118 100644 --- a/lib/openai/models/evals/run_list_params.rb +++ b/lib/openai/models/evals/run_list_params.rb @@ -35,10 +35,19 @@ class RunListParams < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Evals::RunListParams::Status } # @!method initialize(after: nil, limit: nil, order: nil, status: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Evals::RunListParams::Order] - # @param status [Symbol, OpenAI::Models::Evals::RunListParams::Status] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListParams} for more details. + # + # @param after [String] Identifier for the last run from the previous pagination request. + # + # @param limit [Integer] Number of runs to retrieve. + # + # @param order [Symbol, OpenAI::Models::Evals::RunListParams::Order] Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for de + # ... + # + # @param status [Symbol, OpenAI::Models::Evals::RunListParams::Status] Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for diff --git a/lib/openai/models/evals/run_list_response.rb b/lib/openai/models/evals/run_list_response.rb index 941d74e1..3e2e0deb 100644 --- a/lib/openai/models/evals/run_list_response.rb +++ b/lib/openai/models/evals/run_list_response.rb @@ -97,22 +97,38 @@ class RunListResponse < OpenAI::Internal::Type::BaseModel required :status, String # @!method initialize(id:, created_at:, data_source:, error:, eval_id:, metadata:, model:, name:, per_model_usage:, per_testing_criteria_results:, report_url:, result_counts:, status:, object: :"eval.run") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListResponse} for more details. + # # A schema representing an evaluation run. # - # @param id [String] - # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunListResponse::DataSource::Completions] - # @param error [OpenAI::Models::Evals::EvalAPIError] - # @param eval_id [String] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param name [String] - # @param per_model_usage [Array] - # @param per_testing_criteria_results [Array] - # @param report_url [String] - # @param result_counts [OpenAI::Models::Evals::RunListResponse::ResultCounts] - # @param status [String] - # @param object [Symbol, :"eval.run"] + # @param id [String] Unique identifier for the evaluation run. + # + # @param created_at [Integer] Unix timestamp (in seconds) when the evaluation run was created. + # + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunListResponse::DataSource::Completions] Information about the run's data source. + # + # @param error [OpenAI::Models::Evals::EvalAPIError] An object representing an error response from the Eval API. ... + # + # @param eval_id [String] The identifier of the associated evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String] The model that is evaluated, if applicable. + # + # @param name [String] The name of the evaluation run. + # + # @param per_model_usage [Array] Usage statistics for each model during the evaluation run. + # + # @param per_testing_criteria_results [Array] Results per testing criteria applied during the evaluation run. + # + # @param report_url [String] The URL to the rendered evaluation run report on the UI dashboard. + # + # @param result_counts [OpenAI::Models::Evals::RunListResponse::ResultCounts] Counters summarizing the outcomes of the evaluation run. + # + # @param status [String] The status of the evaluation run. + # + # @param object [Symbol, :"eval.run"] The type of the object. Always "eval.run". # Information about the run's data source. # @@ -163,13 +179,21 @@ class Completions < OpenAI::Internal::Type::BaseModel -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams } # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListResponse::DataSource::Completions} for more + # details. + # # A ResponsesRunDataSource object describing a model sampling configuration. # - # @param source [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses] + # @param source [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses] A EvalResponsesSource object describing a run data source configuration. ... + # # @param input_messages [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::ItemReference] - # @param model [String] + # + # @param model [String] The name of the model to use for generating completions (e.g. "o3-mini"). + # # @param sampling_params [OpenAI::Models::Evals::RunListResponse::DataSource::Completions::SamplingParams] - # @param type [Symbol, :completions] + # + # @param type [Symbol, :completions] The type of run data source. Always `completions`. # A EvalResponsesSource object describing a run data source configuration. # @@ -203,8 +227,9 @@ class FileContent < OpenAI::Internal::Type::BaseModel required :type, const: :file_content # @!method initialize(content:, type: :file_content) - # @param content [Array] - # @param type [Symbol, :file_content] + # @param content [Array] The content of the jsonl file. + # + # @param type [Symbol, :file_content] The type of jsonl source. Always `file_content`. class Content < OpenAI::Internal::Type::BaseModel # @!attribute item @@ -237,8 +262,9 @@ class FileID < OpenAI::Internal::Type::BaseModel required :type, const: :file_id # @!method initialize(id:, type: :file_id) - # @param id [String] - # @param type [Symbol, :file_id] + # @param id [String] The identifier of the file. + # + # @param type [Symbol, :file_id] The type of jsonl source. Always `file_id`. end class Responses < OpenAI::Internal::Type::BaseModel @@ -323,20 +349,43 @@ class Responses < OpenAI::Internal::Type::BaseModel optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListResponse::DataSource::Completions::Source::Responses} + # for more details. + # # A EvalResponsesSource object describing a run data source configuration. # - # @param allow_parallel_tool_calls [Boolean, nil] - # @param created_after [Integer, nil] - # @param created_before [Integer, nil] - # @param has_tool_calls [Boolean, nil] - # @param instructions_search [String, nil] - # @param metadata [Object, nil] - # @param model [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param users [Array, nil] - # @param type [Symbol, :responses] + # @param allow_parallel_tool_calls [Boolean, nil] Whether to allow parallel tool calls. This is a query parameter used to select r + # ... + # + # @param created_after [Integer, nil] Only include items created after this timestamp (inclusive). This is a query par + # ... + # + # @param created_before [Integer, nil] Only include items created before this timestamp (inclusive). This is a query pa + # ... + # + # @param has_tool_calls [Boolean, nil] Whether the response has tool calls. This is a query parameter used to select re + # ... + # + # @param instructions_search [String, nil] Optional search string for instructions. This is a query parameter used to selec + # ... + # + # @param metadata [Object, nil] Metadata filter for the responses. This is a query parameter used to select resp + # ... + # + # @param model [String, nil] The name of the model to find responses for. This is a query parameter used to s + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Optional reasoning effort parameter. This is a query parameter used to select re + # ... + # + # @param temperature [Float, nil] Sampling temperature. This is a query parameter used to select responses. + # + # @param top_p [Float, nil] Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @param users [Array, nil] List of user identifiers. This is a query parameter used to select responses. + # + # @param type [Symbol, :responses] The type of run data source. Always `responses`. end # @!method self.variants @@ -371,8 +420,14 @@ class Template < OpenAI::Internal::Type::BaseModel required :type, const: :template # @!method initialize(template:, type: :template) - # @param template [Array] - # @param type [Symbol, :template] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template} + # for more details. + # + # @param template [Array] A list of chat messages forming the prompt or context. May include variable refe + # ... + # + # @param type [Symbol, :template] The type of input messages. Always `template`. # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take @@ -405,8 +460,9 @@ class ChatMessage < OpenAI::Internal::Type::BaseModel required :role, String # @!method initialize(content:, role:) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end class EvalItem < OpenAI::Internal::Type::BaseModel @@ -433,15 +489,21 @@ class EvalItem < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem} + # for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] - # @param role [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] - # @param type [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -472,10 +534,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants @@ -530,8 +597,9 @@ class ItemReference < OpenAI::Internal::Type::BaseModel required :type, const: :item_reference # @!method initialize(item_reference:, type: :item_reference) - # @param item_reference [String] - # @param type [Symbol, :item_reference] + # @param item_reference [String] A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @param type [Symbol, :item_reference] The type of input messages. Always `item_reference`. end # @!method self.variants @@ -565,10 +633,13 @@ class SamplingParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) - # @param max_completion_tokens [Integer] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] + # @param max_completion_tokens [Integer] The maximum number of tokens in the generated output. + # + # @param seed [Integer] A seed value to initialize the randomness, during sampling. + # + # @param temperature [Float] A higher temperature increases randomness in the outputs. + # + # @param top_p [Float] An alternative to temperature for nucleus sampling; 1.0 includes all tokens. end end @@ -614,12 +685,17 @@ class PerModelUsage < OpenAI::Internal::Type::BaseModel required :total_tokens, Integer # @!method initialize(cached_tokens:, completion_tokens:, invocation_count:, model_name:, prompt_tokens:, total_tokens:) - # @param cached_tokens [Integer] - # @param completion_tokens [Integer] - # @param invocation_count [Integer] - # @param model_name [String] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param cached_tokens [Integer] The number of tokens retrieved from cache. + # + # @param completion_tokens [Integer] The number of completion tokens generated. + # + # @param invocation_count [Integer] The number of invocations. + # + # @param model_name [String] The name of the model. + # + # @param prompt_tokens [Integer] The number of prompt tokens used. + # + # @param total_tokens [Integer] The total number of tokens used. end class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel @@ -642,9 +718,11 @@ class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel required :testing_criteria, String # @!method initialize(failed:, passed:, testing_criteria:) - # @param failed [Integer] - # @param passed [Integer] - # @param testing_criteria [String] + # @param failed [Integer] Number of tests failed for this criteria. + # + # @param passed [Integer] Number of tests passed for this criteria. + # + # @param testing_criteria [String] A description of the testing criteria. end # @see OpenAI::Models::Evals::RunListResponse#result_counts @@ -676,10 +754,13 @@ class ResultCounts < OpenAI::Internal::Type::BaseModel # @!method initialize(errored:, failed:, passed:, total:) # Counters summarizing the outcomes of the evaluation run. # - # @param errored [Integer] - # @param failed [Integer] - # @param passed [Integer] - # @param total [Integer] + # @param errored [Integer] Number of output items that resulted in an error. + # + # @param failed [Integer] Number of output items that failed to pass the evaluation. + # + # @param passed [Integer] Number of output items that passed the evaluation. + # + # @param total [Integer] Total number of executed output items. end end end diff --git a/lib/openai/models/evals/run_retrieve_response.rb b/lib/openai/models/evals/run_retrieve_response.rb index 55c35341..1118a6ba 100644 --- a/lib/openai/models/evals/run_retrieve_response.rb +++ b/lib/openai/models/evals/run_retrieve_response.rb @@ -97,22 +97,38 @@ class RunRetrieveResponse < OpenAI::Internal::Type::BaseModel required :status, String # @!method initialize(id:, created_at:, data_source:, error:, eval_id:, metadata:, model:, name:, per_model_usage:, per_testing_criteria_results:, report_url:, result_counts:, status:, object: :"eval.run") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunRetrieveResponse} for more details. + # # A schema representing an evaluation run. # - # @param id [String] - # @param created_at [Integer] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions] - # @param error [OpenAI::Models::Evals::EvalAPIError] - # @param eval_id [String] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param name [String] - # @param per_model_usage [Array] - # @param per_testing_criteria_results [Array] - # @param report_url [String] - # @param result_counts [OpenAI::Models::Evals::RunRetrieveResponse::ResultCounts] - # @param status [String] - # @param object [Symbol, :"eval.run"] + # @param id [String] Unique identifier for the evaluation run. + # + # @param created_at [Integer] Unix timestamp (in seconds) when the evaluation run was created. + # + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions] Information about the run's data source. + # + # @param error [OpenAI::Models::Evals::EvalAPIError] An object representing an error response from the Eval API. ... + # + # @param eval_id [String] The identifier of the associated evaluation. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String] The model that is evaluated, if applicable. + # + # @param name [String] The name of the evaluation run. + # + # @param per_model_usage [Array] Usage statistics for each model during the evaluation run. + # + # @param per_testing_criteria_results [Array] Results per testing criteria applied during the evaluation run. + # + # @param report_url [String] The URL to the rendered evaluation run report on the UI dashboard. + # + # @param result_counts [OpenAI::Models::Evals::RunRetrieveResponse::ResultCounts] Counters summarizing the outcomes of the evaluation run. + # + # @param status [String] The status of the evaluation run. + # + # @param object [Symbol, :"eval.run"] The type of the object. Always "eval.run". # Information about the run's data source. # @@ -164,13 +180,21 @@ class Completions < OpenAI::Internal::Type::BaseModel -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams } # @!method initialize(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions} for more + # details. + # # A ResponsesRunDataSource object describing a model sampling configuration. # - # @param source [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses] + # @param source [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileContent, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::FileID, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses] A EvalResponsesSource object describing a run data source configuration. ... + # # @param input_messages [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::ItemReference] - # @param model [String] + # + # @param model [String] The name of the model to use for generating completions (e.g. "o3-mini"). + # # @param sampling_params [OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::SamplingParams] - # @param type [Symbol, :completions] + # + # @param type [Symbol, :completions] The type of run data source. Always `completions`. # A EvalResponsesSource object describing a run data source configuration. # @@ -205,8 +229,9 @@ class FileContent < OpenAI::Internal::Type::BaseModel required :type, const: :file_content # @!method initialize(content:, type: :file_content) - # @param content [Array] - # @param type [Symbol, :file_content] + # @param content [Array] The content of the jsonl file. + # + # @param type [Symbol, :file_content] The type of jsonl source. Always `file_content`. class Content < OpenAI::Internal::Type::BaseModel # @!attribute item @@ -239,8 +264,9 @@ class FileID < OpenAI::Internal::Type::BaseModel required :type, const: :file_id # @!method initialize(id:, type: :file_id) - # @param id [String] - # @param type [Symbol, :file_id] + # @param id [String] The identifier of the file. + # + # @param type [Symbol, :file_id] The type of jsonl source. Always `file_id`. end class Responses < OpenAI::Internal::Type::BaseModel @@ -325,20 +351,43 @@ class Responses < OpenAI::Internal::Type::BaseModel optional :users, OpenAI::Internal::Type::ArrayOf[String], nil?: true # @!method initialize(allow_parallel_tool_calls: nil, created_after: nil, created_before: nil, has_tool_calls: nil, instructions_search: nil, metadata: nil, model: nil, reasoning_effort: nil, temperature: nil, top_p: nil, users: nil, type: :responses) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::Source::Responses} + # for more details. + # # A EvalResponsesSource object describing a run data source configuration. # - # @param allow_parallel_tool_calls [Boolean, nil] - # @param created_after [Integer, nil] - # @param created_before [Integer, nil] - # @param has_tool_calls [Boolean, nil] - # @param instructions_search [String, nil] - # @param metadata [Object, nil] - # @param model [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param users [Array, nil] - # @param type [Symbol, :responses] + # @param allow_parallel_tool_calls [Boolean, nil] Whether to allow parallel tool calls. This is a query parameter used to select r + # ... + # + # @param created_after [Integer, nil] Only include items created after this timestamp (inclusive). This is a query par + # ... + # + # @param created_before [Integer, nil] Only include items created before this timestamp (inclusive). This is a query pa + # ... + # + # @param has_tool_calls [Boolean, nil] Whether the response has tool calls. This is a query parameter used to select re + # ... + # + # @param instructions_search [String, nil] Optional search string for instructions. This is a query parameter used to selec + # ... + # + # @param metadata [Object, nil] Metadata filter for the responses. This is a query parameter used to select resp + # ... + # + # @param model [String, nil] The name of the model to find responses for. This is a query parameter used to s + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Optional reasoning effort parameter. This is a query parameter used to select re + # ... + # + # @param temperature [Float, nil] Sampling temperature. This is a query parameter used to select responses. + # + # @param top_p [Float, nil] Nucleus sampling parameter. This is a query parameter used to select responses. + # + # @param users [Array, nil] List of user identifiers. This is a query parameter used to select responses. + # + # @param type [Symbol, :responses] The type of run data source. Always `responses`. end # @!method self.variants @@ -377,8 +426,14 @@ class Template < OpenAI::Internal::Type::BaseModel required :type, const: :template # @!method initialize(template:, type: :template) - # @param template [Array] - # @param type [Symbol, :template] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template} + # for more details. + # + # @param template [Array] A list of chat messages forming the prompt or context. May include variable refe + # ... + # + # @param type [Symbol, :template] The type of input messages. Always `template`. # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take @@ -411,8 +466,9 @@ class ChatMessage < OpenAI::Internal::Type::BaseModel required :role, String # @!method initialize(content:, role:) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end class EvalItem < OpenAI::Internal::Type::BaseModel @@ -439,15 +495,21 @@ class EvalItem < OpenAI::Internal::Type::BaseModel enum: -> { OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem} + # for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] - # @param role [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] - # @param type [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] + # @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText] Text inputs to the model - can contain template strings. ... + # + # @param role [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Type] The type of the message input. Always `message`. ... # Text inputs to the model - can contain template strings. # @@ -478,10 +540,15 @@ class OutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Completions::InputMessages::Template::Template::EvalItem::Content::OutputText} + # for more details. + # # A text output from the model. # - # @param text [String] - # @param type [Symbol, :output_text] + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... end # @!method self.variants @@ -536,8 +603,9 @@ class ItemReference < OpenAI::Internal::Type::BaseModel required :type, const: :item_reference # @!method initialize(item_reference:, type: :item_reference) - # @param item_reference [String] - # @param type [Symbol, :item_reference] + # @param item_reference [String] A reference to a variable in the "item" namespace. Ie, "item.name" + # + # @param type [Symbol, :item_reference] The type of input messages. Always `item_reference`. end # @!method self.variants @@ -571,10 +639,13 @@ class SamplingParams < OpenAI::Internal::Type::BaseModel optional :top_p, Float # @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil) - # @param max_completion_tokens [Integer] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] + # @param max_completion_tokens [Integer] The maximum number of tokens in the generated output. + # + # @param seed [Integer] A seed value to initialize the randomness, during sampling. + # + # @param temperature [Float] A higher temperature increases randomness in the outputs. + # + # @param top_p [Float] An alternative to temperature for nucleus sampling; 1.0 includes all tokens. end end @@ -620,12 +691,17 @@ class PerModelUsage < OpenAI::Internal::Type::BaseModel required :total_tokens, Integer # @!method initialize(cached_tokens:, completion_tokens:, invocation_count:, model_name:, prompt_tokens:, total_tokens:) - # @param cached_tokens [Integer] - # @param completion_tokens [Integer] - # @param invocation_count [Integer] - # @param model_name [String] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param cached_tokens [Integer] The number of tokens retrieved from cache. + # + # @param completion_tokens [Integer] The number of completion tokens generated. + # + # @param invocation_count [Integer] The number of invocations. + # + # @param model_name [String] The name of the model. + # + # @param prompt_tokens [Integer] The number of prompt tokens used. + # + # @param total_tokens [Integer] The total number of tokens used. end class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel @@ -648,9 +724,11 @@ class PerTestingCriteriaResult < OpenAI::Internal::Type::BaseModel required :testing_criteria, String # @!method initialize(failed:, passed:, testing_criteria:) - # @param failed [Integer] - # @param passed [Integer] - # @param testing_criteria [String] + # @param failed [Integer] Number of tests failed for this criteria. + # + # @param passed [Integer] Number of tests passed for this criteria. + # + # @param testing_criteria [String] A description of the testing criteria. end # @see OpenAI::Models::Evals::RunRetrieveResponse#result_counts @@ -682,10 +760,13 @@ class ResultCounts < OpenAI::Internal::Type::BaseModel # @!method initialize(errored:, failed:, passed:, total:) # Counters summarizing the outcomes of the evaluation run. # - # @param errored [Integer] - # @param failed [Integer] - # @param passed [Integer] - # @param total [Integer] + # @param errored [Integer] Number of output items that resulted in an error. + # + # @param failed [Integer] Number of output items that failed to pass the evaluation. + # + # @param passed [Integer] Number of output items that passed the evaluation. + # + # @param total [Integer] Total number of executed output items. end end end diff --git a/lib/openai/models/evals/runs/output_item_list_params.rb b/lib/openai/models/evals/runs/output_item_list_params.rb index 301d2acd..6eadd7fb 100644 --- a/lib/openai/models/evals/runs/output_item_list_params.rb +++ b/lib/openai/models/evals/runs/output_item_list_params.rb @@ -41,11 +41,20 @@ class OutputItemListParams < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Evals::Runs::OutputItemListParams::Status } # @!method initialize(eval_id:, after: nil, limit: nil, order: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::Runs::OutputItemListParams} for more details. + # # @param eval_id [String] - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Order] - # @param status [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Status] + # + # @param after [String] Identifier for the last output item from the previous pagination request. + # + # @param limit [Integer] Number of output items to retrieve. + # + # @param order [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Order] Sort order for output items by timestamp. Use `asc` for ascending order or `desc + # ... + # + # @param status [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Status] Filter output items by status. Use `failed` to filter by failed output ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order for output items by timestamp. Use `asc` for ascending order or diff --git a/lib/openai/models/evals/runs/output_item_list_response.rb b/lib/openai/models/evals/runs/output_item_list_response.rb index fc0d6e75..e5c369c9 100644 --- a/lib/openai/models/evals/runs/output_item_list_response.rb +++ b/lib/openai/models/evals/runs/output_item_list_response.rb @@ -70,16 +70,25 @@ class OutputItemListResponse < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, created_at:, datasource_item:, datasource_item_id:, eval_id:, results:, run_id:, sample:, status:, object: :"eval.run.output_item") # A schema representing an evaluation run output item. # - # @param id [String] - # @param created_at [Integer] - # @param datasource_item [Hash{Symbol=>Object}] - # @param datasource_item_id [Integer] - # @param eval_id [String] - # @param results [ArrayObject}>] - # @param run_id [String] - # @param sample [OpenAI::Models::Evals::Runs::OutputItemListResponse::Sample] - # @param status [String] - # @param object [Symbol, :"eval.run.output_item"] + # @param id [String] Unique identifier for the evaluation run output item. + # + # @param created_at [Integer] Unix timestamp (in seconds) when the evaluation run was created. + # + # @param datasource_item [Hash{Symbol=>Object}] Details of the input data source item. + # + # @param datasource_item_id [Integer] The identifier for the data source item. + # + # @param eval_id [String] The identifier of the evaluation group. + # + # @param results [ArrayObject}>] A list of results from the evaluation run. + # + # @param run_id [String] The identifier of the evaluation run associated with this output item. + # + # @param sample [OpenAI::Models::Evals::Runs::OutputItemListResponse::Sample] A sample containing the input and output of the evaluation run. + # + # @param status [String] The status of the evaluation run. + # + # @param object [Symbol, :"eval.run.output_item"] The type of the object. Always "eval.run.output_item". # @see OpenAI::Models::Evals::Runs::OutputItemListResponse#sample class Sample < OpenAI::Internal::Type::BaseModel @@ -146,18 +155,30 @@ class Sample < OpenAI::Internal::Type::BaseModel required :usage, -> { OpenAI::Models::Evals::Runs::OutputItemListResponse::Sample::Usage } # @!method initialize(error:, finish_reason:, input:, max_completion_tokens:, model:, output:, seed:, temperature:, top_p:, usage:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::Runs::OutputItemListResponse::Sample} for more details. + # # A sample containing the input and output of the evaluation run. # - # @param error [OpenAI::Models::Evals::EvalAPIError] - # @param finish_reason [String] - # @param input [Array] - # @param max_completion_tokens [Integer] - # @param model [String] - # @param output [Array] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] - # @param usage [OpenAI::Models::Evals::Runs::OutputItemListResponse::Sample::Usage] + # @param error [OpenAI::Models::Evals::EvalAPIError] An object representing an error response from the Eval API. ... + # + # @param finish_reason [String] The reason why the sample generation was finished. + # + # @param input [Array] An array of input messages. + # + # @param max_completion_tokens [Integer] The maximum number of tokens allowed for completion. + # + # @param model [String] The model used for generating the sample. + # + # @param output [Array] An array of output messages. + # + # @param seed [Integer] The seed used for generating the sample. + # + # @param temperature [Float] The sampling temperature used. + # + # @param top_p [Float] The top_p value used for sampling. + # + # @param usage [OpenAI::Models::Evals::Runs::OutputItemListResponse::Sample::Usage] Token usage details for the sample. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -175,8 +196,9 @@ class Input < OpenAI::Internal::Type::BaseModel # @!method initialize(content:, role:) # An input message. # - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message sender (e.g., system, user, developer). end class Output < OpenAI::Internal::Type::BaseModel @@ -193,8 +215,9 @@ class Output < OpenAI::Internal::Type::BaseModel optional :role, String # @!method initialize(content: nil, role: nil) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end # @see OpenAI::Models::Evals::Runs::OutputItemListResponse::Sample#usage @@ -226,10 +249,13 @@ class Usage < OpenAI::Internal::Type::BaseModel # @!method initialize(cached_tokens:, completion_tokens:, prompt_tokens:, total_tokens:) # Token usage details for the sample. # - # @param cached_tokens [Integer] - # @param completion_tokens [Integer] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param cached_tokens [Integer] The number of tokens retrieved from cache. + # + # @param completion_tokens [Integer] The number of completion tokens generated. + # + # @param prompt_tokens [Integer] The number of prompt tokens used. + # + # @param total_tokens [Integer] The total number of tokens used. end end end diff --git a/lib/openai/models/evals/runs/output_item_retrieve_response.rb b/lib/openai/models/evals/runs/output_item_retrieve_response.rb index eec2ea1a..70b4c3ab 100644 --- a/lib/openai/models/evals/runs/output_item_retrieve_response.rb +++ b/lib/openai/models/evals/runs/output_item_retrieve_response.rb @@ -70,16 +70,25 @@ class OutputItemRetrieveResponse < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, created_at:, datasource_item:, datasource_item_id:, eval_id:, results:, run_id:, sample:, status:, object: :"eval.run.output_item") # A schema representing an evaluation run output item. # - # @param id [String] - # @param created_at [Integer] - # @param datasource_item [Hash{Symbol=>Object}] - # @param datasource_item_id [Integer] - # @param eval_id [String] - # @param results [ArrayObject}>] - # @param run_id [String] - # @param sample [OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Sample] - # @param status [String] - # @param object [Symbol, :"eval.run.output_item"] + # @param id [String] Unique identifier for the evaluation run output item. + # + # @param created_at [Integer] Unix timestamp (in seconds) when the evaluation run was created. + # + # @param datasource_item [Hash{Symbol=>Object}] Details of the input data source item. + # + # @param datasource_item_id [Integer] The identifier for the data source item. + # + # @param eval_id [String] The identifier of the evaluation group. + # + # @param results [ArrayObject}>] A list of results from the evaluation run. + # + # @param run_id [String] The identifier of the evaluation run associated with this output item. + # + # @param sample [OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Sample] A sample containing the input and output of the evaluation run. + # + # @param status [String] The status of the evaluation run. + # + # @param object [Symbol, :"eval.run.output_item"] The type of the object. Always "eval.run.output_item". # @see OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse#sample class Sample < OpenAI::Internal::Type::BaseModel @@ -146,18 +155,31 @@ class Sample < OpenAI::Internal::Type::BaseModel required :usage, -> { OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Sample::Usage } # @!method initialize(error:, finish_reason:, input:, max_completion_tokens:, model:, output:, seed:, temperature:, top_p:, usage:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Sample} for more + # details. + # # A sample containing the input and output of the evaluation run. # - # @param error [OpenAI::Models::Evals::EvalAPIError] - # @param finish_reason [String] - # @param input [Array] - # @param max_completion_tokens [Integer] - # @param model [String] - # @param output [Array] - # @param seed [Integer] - # @param temperature [Float] - # @param top_p [Float] - # @param usage [OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Sample::Usage] + # @param error [OpenAI::Models::Evals::EvalAPIError] An object representing an error response from the Eval API. ... + # + # @param finish_reason [String] The reason why the sample generation was finished. + # + # @param input [Array] An array of input messages. + # + # @param max_completion_tokens [Integer] The maximum number of tokens allowed for completion. + # + # @param model [String] The model used for generating the sample. + # + # @param output [Array] An array of output messages. + # + # @param seed [Integer] The seed used for generating the sample. + # + # @param temperature [Float] The sampling temperature used. + # + # @param top_p [Float] The top_p value used for sampling. + # + # @param usage [OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Sample::Usage] Token usage details for the sample. class Input < OpenAI::Internal::Type::BaseModel # @!attribute content @@ -175,8 +197,9 @@ class Input < OpenAI::Internal::Type::BaseModel # @!method initialize(content:, role:) # An input message. # - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message sender (e.g., system, user, developer). end class Output < OpenAI::Internal::Type::BaseModel @@ -193,8 +216,9 @@ class Output < OpenAI::Internal::Type::BaseModel optional :role, String # @!method initialize(content: nil, role: nil) - # @param content [String] - # @param role [String] + # @param content [String] The content of the message. + # + # @param role [String] The role of the message (e.g. "system", "assistant", "user"). end # @see OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Sample#usage @@ -226,10 +250,13 @@ class Usage < OpenAI::Internal::Type::BaseModel # @!method initialize(cached_tokens:, completion_tokens:, prompt_tokens:, total_tokens:) # Token usage details for the sample. # - # @param cached_tokens [Integer] - # @param completion_tokens [Integer] - # @param prompt_tokens [Integer] - # @param total_tokens [Integer] + # @param cached_tokens [Integer] The number of tokens retrieved from cache. + # + # @param completion_tokens [Integer] The number of completion tokens generated. + # + # @param prompt_tokens [Integer] The number of prompt tokens used. + # + # @param total_tokens [Integer] The total number of tokens used. end end end diff --git a/lib/openai/models/file_create_params.rb b/lib/openai/models/file_create_params.rb index 28d5f936..94e5f46f 100644 --- a/lib/openai/models/file_create_params.rb +++ b/lib/openai/models/file_create_params.rb @@ -23,8 +23,14 @@ class FileCreateParams < OpenAI::Internal::Type::BaseModel required :purpose, enum: -> { OpenAI::Models::FilePurpose } # @!method initialize(file:, purpose:, request_options: {}) - # @param file [Pathname, StringIO] - # @param purpose [Symbol, OpenAI::Models::FilePurpose] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FileCreateParams} for more details. + # + # @param file [Pathname, StringIO] The File object (not file name) to be uploaded. ... + # + # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of: - `assistants`: Used in the A + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/file_list_params.rb b/lib/openai/models/file_list_params.rb index 76de1996..423236ed 100644 --- a/lib/openai/models/file_list_params.rb +++ b/lib/openai/models/file_list_params.rb @@ -37,10 +37,20 @@ class FileListParams < OpenAI::Internal::Type::BaseModel optional :purpose, String # @!method initialize(after: nil, limit: nil, order: nil, purpose: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::FileListParams::Order] - # @param purpose [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FileListParams} for more details. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::FileListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # + # @param purpose [String] Only return files with the given purpose. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order by the `created_at` timestamp of the objects. `asc` for ascending diff --git a/lib/openai/models/file_object.rb b/lib/openai/models/file_object.rb index b6825ae1..942e2361 100644 --- a/lib/openai/models/file_object.rb +++ b/lib/openai/models/file_object.rb @@ -67,17 +67,31 @@ class FileObject < OpenAI::Internal::Type::BaseModel optional :status_details, String # @!method initialize(id:, bytes:, created_at:, filename:, purpose:, status:, expires_at: nil, status_details: nil, object: :file) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FileObject} for more details. + # # The `File` object represents a document that has been uploaded to OpenAI. # - # @param id [String] - # @param bytes [Integer] - # @param created_at [Integer] - # @param filename [String] - # @param purpose [Symbol, OpenAI::Models::FileObject::Purpose] - # @param status [Symbol, OpenAI::Models::FileObject::Status] - # @param expires_at [Integer] - # @param status_details [String] - # @param object [Symbol, :file] + # @param id [String] The file identifier, which can be referenced in the API endpoints. + # + # @param bytes [Integer] The size of the file, in bytes. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the file was created. + # + # @param filename [String] The name of the file. + # + # @param purpose [Symbol, OpenAI::Models::FileObject::Purpose] The intended purpose of the file. Supported values are `assistants`, `assistants + # ... + # + # @param status [Symbol, OpenAI::Models::FileObject::Status] Deprecated. The current status of the file, which can be either `uploaded`, `pro + # ... + # + # @param expires_at [Integer] The Unix timestamp (in seconds) for when the file will expire. + # + # @param status_details [String] Deprecated. For details on why a fine-tuning training file failed validation, se + # ... + # + # @param object [Symbol, :file] The object type, which is always `file`. # The intended purpose of the file. Supported values are `assistants`, # `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` diff --git a/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rb b/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rb index 8a333418..448911d4 100644 --- a/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rb +++ b/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rb @@ -16,7 +16,8 @@ class PermissionCreateParams < OpenAI::Internal::Type::BaseModel required :project_ids, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(project_ids:, request_options: {}) - # @param project_ids [Array] + # @param project_ids [Array] The project identifiers to grant access to. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rb b/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rb index ed9e10fe..efe00e34 100644 --- a/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rb +++ b/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rb @@ -34,10 +34,13 @@ class PermissionCreateResponse < OpenAI::Internal::Type::BaseModel # The `checkpoint.permission` object represents a permission for a fine-tuned # model checkpoint. # - # @param id [String] - # @param created_at [Integer] - # @param project_id [String] - # @param object [Symbol, :"checkpoint.permission"] + # @param id [String] The permission identifier, which can be referenced in the API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the permission was created. + # + # @param project_id [String] The project identifier that the permission is for. + # + # @param object [Symbol, :"checkpoint.permission"] The object type, which is always "checkpoint.permission". end end end diff --git a/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rb b/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rb index 1fce739b..483d4664 100644 --- a/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rb +++ b/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rb @@ -25,9 +25,11 @@ class PermissionDeleteResponse < OpenAI::Internal::Type::BaseModel required :object, const: :"checkpoint.permission" # @!method initialize(id:, deleted:, object: :"checkpoint.permission") - # @param id [String] - # @param deleted [Boolean] - # @param object [Symbol, :"checkpoint.permission"] + # @param id [String] The ID of the fine-tuned model checkpoint permission that was deleted. + # + # @param deleted [Boolean] Whether the fine-tuned model checkpoint permission was successfully deleted. + # + # @param object [Symbol, :"checkpoint.permission"] The object type, which is always "checkpoint.permission". end end end diff --git a/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rb b/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rb index 6c272af8..cddf06b9 100644 --- a/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rb +++ b/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rb @@ -34,10 +34,14 @@ class PermissionRetrieveParams < OpenAI::Internal::Type::BaseModel optional :project_id, String # @!method initialize(after: nil, limit: nil, order: nil, project_id: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveParams::Order] - # @param project_id [String] + # @param after [String] Identifier for the last permission ID from the previous pagination request. + # + # @param limit [Integer] Number of permissions to retrieve. + # + # @param order [Symbol, OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveParams::Order] The order in which to retrieve permissions. + # + # @param project_id [String] The ID of the project to get permissions for. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The order in which to retrieve permissions. diff --git a/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rb b/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rb index 1de51fee..6ffbdf4d 100644 --- a/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rb +++ b/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rb @@ -68,10 +68,13 @@ class Data < OpenAI::Internal::Type::BaseModel # The `checkpoint.permission` object represents a permission for a fine-tuned # model checkpoint. # - # @param id [String] - # @param created_at [Integer] - # @param project_id [String] - # @param object [Symbol, :"checkpoint.permission"] + # @param id [String] The permission identifier, which can be referenced in the API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the permission was created. + # + # @param project_id [String] The project identifier that the permission is for. + # + # @param object [Symbol, :"checkpoint.permission"] The object type, which is always "checkpoint.permission". end end end diff --git a/lib/openai/models/fine_tuning/fine_tuning_job.rb b/lib/openai/models/fine_tuning/fine_tuning_job.rb index a5e3d2a9..36cc8d69 100644 --- a/lib/openai/models/fine_tuning/fine_tuning_job.rb +++ b/lib/openai/models/fine_tuning/fine_tuning_job.rb @@ -139,28 +139,59 @@ class FineTuningJob < OpenAI::Internal::Type::BaseModel optional :method_, -> { OpenAI::Models::FineTuning::FineTuningJob::Method }, api_name: :method # @!method initialize(id:, created_at:, error:, fine_tuned_model:, finished_at:, hyperparameters:, model:, organization_id:, result_files:, seed:, status:, trained_tokens:, training_file:, validation_file:, estimated_finish: nil, integrations: nil, metadata: nil, method_: nil, object: :"fine_tuning.job") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::FineTuningJob} for more details. + # # The `fine_tuning.job` object represents a fine-tuning job that has been created # through the API. # - # @param id [String] - # @param created_at [Integer] - # @param error [OpenAI::Models::FineTuning::FineTuningJob::Error, nil] - # @param fine_tuned_model [String, nil] - # @param finished_at [Integer, nil] - # @param hyperparameters [OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters] - # @param model [String] - # @param organization_id [String] - # @param result_files [Array] - # @param seed [Integer] - # @param status [Symbol, OpenAI::Models::FineTuning::FineTuningJob::Status] - # @param trained_tokens [Integer, nil] - # @param training_file [String] - # @param validation_file [String, nil] - # @param estimated_finish [Integer, nil] - # @param integrations [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param method_ [OpenAI::Models::FineTuning::FineTuningJob::Method] - # @param object [Symbol, :"fine_tuning.job"] + # @param id [String] The object identifier, which can be referenced in the API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the fine-tuning job was created. + # + # @param error [OpenAI::Models::FineTuning::FineTuningJob::Error, nil] For fine-tuning jobs that have `failed`, this will contain more information on t + # ... + # + # @param fine_tuned_model [String, nil] The name of the fine-tuned model that is being created. The value will be null i + # ... + # + # @param finished_at [Integer, nil] The Unix timestamp (in seconds) for when the fine-tuning job was finished. The v + # ... + # + # @param hyperparameters [OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters] The hyperparameters used for the fine-tuning job. This value will only be return + # ... + # + # @param model [String] The base model that is being fine-tuned. + # + # @param organization_id [String] The organization that owns the fine-tuning job. + # + # @param result_files [Array] The compiled results file ID(s) for the fine-tuning job. You can retrieve the re + # ... + # + # @param seed [Integer] The seed used for the fine-tuning job. + # + # @param status [Symbol, OpenAI::Models::FineTuning::FineTuningJob::Status] The current status of the fine-tuning job, which can be either `validating_files + # ... + # + # @param trained_tokens [Integer, nil] The total number of billable tokens processed by this fine-tuning job. The value + # ... + # + # @param training_file [String] The file ID used for training. You can retrieve the training data with the [File + # ... + # + # @param validation_file [String, nil] The file ID used for validation. You can retrieve the validation results with th + # ... + # + # @param estimated_finish [Integer, nil] The Unix timestamp (in seconds) for when the fine-tuning job is estimated to fin + # ... + # + # @param integrations [Array, nil] A list of integrations to enable for this fine-tuning job. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param method_ [OpenAI::Models::FineTuning::FineTuningJob::Method] The method used for fine-tuning. + # + # @param object [Symbol, :"fine_tuning.job"] The object type, which is always "fine_tuning.job". # @see OpenAI::Models::FineTuning::FineTuningJob#error class Error < OpenAI::Internal::Type::BaseModel @@ -184,12 +215,18 @@ class Error < OpenAI::Internal::Type::BaseModel required :param, String, nil?: true # @!method initialize(code:, message:, param:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::FineTuningJob::Error} for more details. + # # For fine-tuning jobs that have `failed`, this will contain more information on # the cause of the failure. # - # @param code [String] - # @param message [String] - # @param param [String, nil] + # @param code [String] A machine-readable error code. + # + # @param message [String] A human-readable error message. + # + # @param param [String, nil] The parameter that was invalid, usually `training_file` or `validation_file`. Th + # ... end # @see OpenAI::Models::FineTuning::FineTuningJob#hyperparameters @@ -217,12 +254,20 @@ class Hyperparameters < OpenAI::Internal::Type::BaseModel optional :n_epochs, union: -> { OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters::NEpochs } # @!method initialize(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters} for more details. + # # The hyperparameters used for the fine-tuning job. This value will only be # returned when running `supervised` jobs. # - # @param batch_size [Symbol, :auto, Integer] - # @param learning_rate_multiplier [Symbol, :auto, Float] - # @param n_epochs [Symbol, :auto, Integer] + # @param batch_size [Symbol, :auto, Integer] Number of examples in each batch. A larger batch size means that model parameter + # ... + # + # @param learning_rate_multiplier [Symbol, :auto, Float] Scaling factor for the learning rate. A smaller learning rate may be useful to a + # ... + # + # @param n_epochs [Symbol, :auto, Integer] The number of epochs to train the model for. An epoch refers to one full cycle + # ... # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. @@ -311,9 +356,11 @@ class Method < OpenAI::Internal::Type::BaseModel # @!method initialize(dpo: nil, supervised: nil, type: nil) # The method used for fine-tuning. # - # @param dpo [OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo] - # @param supervised [OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised] - # @param type [Symbol, OpenAI::Models::FineTuning::FineTuningJob::Method::Type] + # @param dpo [OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo] Configuration for the DPO fine-tuning method. + # + # @param supervised [OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised] Configuration for the supervised fine-tuning method. + # + # @param type [Symbol, OpenAI::Models::FineTuning::FineTuningJob::Method::Type] The type of method. Is either `supervised` or `dpo`. # @see OpenAI::Models::FineTuning::FineTuningJob::Method#dpo class Dpo < OpenAI::Internal::Type::BaseModel @@ -326,7 +373,7 @@ class Dpo < OpenAI::Internal::Type::BaseModel # @!method initialize(hyperparameters: nil) # Configuration for the DPO fine-tuning method. # - # @param hyperparameters [OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters] + # @param hyperparameters [OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters] The hyperparameters used for the fine-tuning job. # @see OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo#hyperparameters class Hyperparameters < OpenAI::Internal::Type::BaseModel @@ -363,12 +410,23 @@ class Hyperparameters < OpenAI::Internal::Type::BaseModel union: -> { OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters::NEpochs } # @!method initialize(batch_size: nil, beta: nil, learning_rate_multiplier: nil, n_epochs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters} for + # more details. + # # The hyperparameters used for the fine-tuning job. # - # @param batch_size [Symbol, :auto, Integer] - # @param beta [Symbol, :auto, Float] - # @param learning_rate_multiplier [Symbol, :auto, Float] - # @param n_epochs [Symbol, :auto, Integer] + # @param batch_size [Symbol, :auto, Integer] Number of examples in each batch. A larger batch size means that model parameter + # ... + # + # @param beta [Symbol, :auto, Float] The beta value for the DPO method. A higher beta value will increase the weight + # ... + # + # @param learning_rate_multiplier [Symbol, :auto, Float] Scaling factor for the learning rate. A smaller learning rate may be useful to a + # ... + # + # @param n_epochs [Symbol, :auto, Integer] The number of epochs to train the model for. An epoch refers to one full cycle t + # ... # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. @@ -444,7 +502,7 @@ class Supervised < OpenAI::Internal::Type::BaseModel # @!method initialize(hyperparameters: nil) # Configuration for the supervised fine-tuning method. # - # @param hyperparameters [OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters] + # @param hyperparameters [OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters] The hyperparameters used for the fine-tuning job. # @see OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised#hyperparameters class Hyperparameters < OpenAI::Internal::Type::BaseModel @@ -473,11 +531,20 @@ class Hyperparameters < OpenAI::Internal::Type::BaseModel union: -> { OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters::NEpochs } # @!method initialize(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters} + # for more details. + # # The hyperparameters used for the fine-tuning job. # - # @param batch_size [Symbol, :auto, Integer] - # @param learning_rate_multiplier [Symbol, :auto, Float] - # @param n_epochs [Symbol, :auto, Integer] + # @param batch_size [Symbol, :auto, Integer] Number of examples in each batch. A larger batch size means that model parameter + # ... + # + # @param learning_rate_multiplier [Symbol, :auto, Float] Scaling factor for the learning rate. A smaller learning rate may be useful to a + # ... + # + # @param n_epochs [Symbol, :auto, Integer] The number of epochs to train the model for. An epoch refers to one full cycle t + # ... # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. diff --git a/lib/openai/models/fine_tuning/fine_tuning_job_event.rb b/lib/openai/models/fine_tuning/fine_tuning_job_event.rb index b5fb144c..5d1a7f6b 100644 --- a/lib/openai/models/fine_tuning/fine_tuning_job_event.rb +++ b/lib/openai/models/fine_tuning/fine_tuning_job_event.rb @@ -50,13 +50,19 @@ class FineTuningJobEvent < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, created_at:, level:, message:, data: nil, type: nil, object: :"fine_tuning.job.event") # Fine-tuning job event object # - # @param id [String] - # @param created_at [Integer] - # @param level [Symbol, OpenAI::Models::FineTuning::FineTuningJobEvent::Level] - # @param message [String] - # @param data [Object] - # @param type [Symbol, OpenAI::Models::FineTuning::FineTuningJobEvent::Type] - # @param object [Symbol, :"fine_tuning.job.event"] + # @param id [String] The object identifier. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the fine-tuning job was created. + # + # @param level [Symbol, OpenAI::Models::FineTuning::FineTuningJobEvent::Level] The log level of the event. + # + # @param message [String] The message of the event. + # + # @param data [Object] The data associated with the event. + # + # @param type [Symbol, OpenAI::Models::FineTuning::FineTuningJobEvent::Type] The type of event. + # + # @param object [Symbol, :"fine_tuning.job.event"] The object type, which is always "fine_tuning.job.event". # The log level of the event. # diff --git a/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rb b/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rb index 98c9eaca..c32fef0e 100644 --- a/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rb +++ b/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rb @@ -34,15 +34,24 @@ class FineTuningJobWandbIntegration < OpenAI::Internal::Type::BaseModel optional :tags, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(project:, entity: nil, name: nil, tags: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::FineTuningJobWandbIntegration} for more details. + # # The settings for your integration with Weights and Biases. This payload # specifies the project that metrics will be sent to. Optionally, you can set an # explicit display name for your run, add tags to your run, and set a default # entity (team, username, etc) to be associated with your run. # - # @param project [String] - # @param entity [String, nil] - # @param name [String, nil] - # @param tags [Array] + # @param project [String] The name of the project that the new run will be created under. ... + # + # @param entity [String, nil] The entity to use for the run. This allows you to set the team or username of th + # ... + # + # @param name [String, nil] A display name to set for the run. If not set, we will use the Job ID as the nam + # ... + # + # @param tags [Array] A list of tags to be attached to the newly created run. These tags are passed th + # ... end end diff --git a/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rb b/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rb index 8d9da11d..147302a1 100644 --- a/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rb +++ b/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rb @@ -20,8 +20,14 @@ class FineTuningJobWandbIntegrationObject < OpenAI::Internal::Type::BaseModel required :wandb, -> { OpenAI::Models::FineTuning::FineTuningJobWandbIntegration } # @!method initialize(wandb:, type: :wandb) - # @param wandb [OpenAI::Models::FineTuning::FineTuningJobWandbIntegration] - # @param type [Symbol, :wandb] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::FineTuningJobWandbIntegrationObject} for more + # details. + # + # @param wandb [OpenAI::Models::FineTuning::FineTuningJobWandbIntegration] The settings for your integration with Weights and Biases. This payload specifie + # ... + # + # @param type [Symbol, :wandb] The type of the integration being enabled for the fine-tuning job end end diff --git a/lib/openai/models/fine_tuning/job_create_params.rb b/lib/openai/models/fine_tuning/job_create_params.rb index 2078e4bd..4d99beea 100644 --- a/lib/openai/models/fine_tuning/job_create_params.rb +++ b/lib/openai/models/fine_tuning/job_create_params.rb @@ -107,15 +107,29 @@ class JobCreateParams < OpenAI::Internal::Type::BaseModel optional :validation_file, String, nil?: true # @!method initialize(model:, training_file:, hyperparameters: nil, integrations: nil, metadata: nil, method_: nil, seed: nil, suffix: nil, validation_file: nil, request_options: {}) - # @param model [String, Symbol, OpenAI::Models::FineTuning::JobCreateParams::Model] - # @param training_file [String] - # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters] - # @param integrations [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param method_ [OpenAI::Models::FineTuning::JobCreateParams::Method] - # @param seed [Integer, nil] - # @param suffix [String, nil] - # @param validation_file [String, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCreateParams} for more details. + # + # @param model [String, Symbol, OpenAI::Models::FineTuning::JobCreateParams::Model] The name of the model to fine-tune. You can select one of the ... + # + # @param training_file [String] The ID of an uploaded file that contains training data. ... + # + # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters] The hyperparameters used for the fine-tuning job. ... + # + # @param integrations [Array, nil] A list of integrations to enable for your fine-tuning job. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param method_ [OpenAI::Models::FineTuning::JobCreateParams::Method] The method used for fine-tuning. + # + # @param seed [Integer, nil] The seed controls the reproducibility of the job. Passing in the same seed and j + # ... + # + # @param suffix [String, nil] A string of up to 64 characters that will be added to your fine-tuned model name + # ... + # + # @param validation_file [String, nil] The ID of an uploaded file that contains validation data. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The name of the model to fine-tune. You can select one of the @@ -172,12 +186,20 @@ class Hyperparameters < OpenAI::Internal::Type::BaseModel optional :n_epochs, union: -> { OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters::NEpochs } # @!method initialize(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters} for more details. + # # The hyperparameters used for the fine-tuning job. This value is now deprecated # in favor of `method`, and should be passed in under the `method` parameter. # - # @param batch_size [Symbol, :auto, Integer] - # @param learning_rate_multiplier [Symbol, :auto, Float] - # @param n_epochs [Symbol, :auto, Integer] + # @param batch_size [Symbol, :auto, Integer] Number of examples in each batch. A larger batch size means that model parameter + # ... + # + # @param learning_rate_multiplier [Symbol, :auto, Float] Scaling factor for the learning rate. A smaller learning rate may be useful to a + # ... + # + # @param n_epochs [Symbol, :auto, Integer] The number of epochs to train the model for. An epoch refers to one full cycle + # ... # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. @@ -243,8 +265,14 @@ class Integration < OpenAI::Internal::Type::BaseModel required :wandb, -> { OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb } # @!method initialize(wandb:, type: :wandb) - # @param wandb [OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb] - # @param type [Symbol, :wandb] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCreateParams::Integration} for more details. + # + # @param wandb [OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb] The settings for your integration with Weights and Biases. This payload specifie + # ... + # + # @param type [Symbol, :wandb] The type of integration to enable. Currently, only "wandb" (Weights and Biases) + # ... # @see OpenAI::Models::FineTuning::JobCreateParams::Integration#wandb class Wandb < OpenAI::Internal::Type::BaseModel @@ -278,15 +306,25 @@ class Wandb < OpenAI::Internal::Type::BaseModel optional :tags, OpenAI::Internal::Type::ArrayOf[String] # @!method initialize(project:, entity: nil, name: nil, tags: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb} for more + # details. + # # The settings for your integration with Weights and Biases. This payload # specifies the project that metrics will be sent to. Optionally, you can set an # explicit display name for your run, add tags to your run, and set a default # entity (team, username, etc) to be associated with your run. # - # @param project [String] - # @param entity [String, nil] - # @param name [String, nil] - # @param tags [Array] + # @param project [String] The name of the project that the new run will be created under. ... + # + # @param entity [String, nil] The entity to use for the run. This allows you to set the team or username of th + # ... + # + # @param name [String, nil] A display name to set for the run. If not set, we will use the Job ID as the nam + # ... + # + # @param tags [Array] A list of tags to be attached to the newly created run. These tags are passed th + # ... end end @@ -312,9 +350,11 @@ class Method < OpenAI::Internal::Type::BaseModel # @!method initialize(dpo: nil, supervised: nil, type: nil) # The method used for fine-tuning. # - # @param dpo [OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo] - # @param supervised [OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised] - # @param type [Symbol, OpenAI::Models::FineTuning::JobCreateParams::Method::Type] + # @param dpo [OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo] Configuration for the DPO fine-tuning method. + # + # @param supervised [OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised] Configuration for the supervised fine-tuning method. + # + # @param type [Symbol, OpenAI::Models::FineTuning::JobCreateParams::Method::Type] The type of method. Is either `supervised` or `dpo`. # @see OpenAI::Models::FineTuning::JobCreateParams::Method#dpo class Dpo < OpenAI::Internal::Type::BaseModel @@ -328,7 +368,7 @@ class Dpo < OpenAI::Internal::Type::BaseModel # @!method initialize(hyperparameters: nil) # Configuration for the DPO fine-tuning method. # - # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters] + # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters] The hyperparameters used for the fine-tuning job. # @see OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo#hyperparameters class Hyperparameters < OpenAI::Internal::Type::BaseModel @@ -365,12 +405,23 @@ class Hyperparameters < OpenAI::Internal::Type::BaseModel union: -> { OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters::NEpochs } # @!method initialize(batch_size: nil, beta: nil, learning_rate_multiplier: nil, n_epochs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters} for + # more details. + # # The hyperparameters used for the fine-tuning job. # - # @param batch_size [Symbol, :auto, Integer] - # @param beta [Symbol, :auto, Float] - # @param learning_rate_multiplier [Symbol, :auto, Float] - # @param n_epochs [Symbol, :auto, Integer] + # @param batch_size [Symbol, :auto, Integer] Number of examples in each batch. A larger batch size means that model parameter + # ... + # + # @param beta [Symbol, :auto, Float] The beta value for the DPO method. A higher beta value will increase the weight + # ... + # + # @param learning_rate_multiplier [Symbol, :auto, Float] Scaling factor for the learning rate. A smaller learning rate may be useful to a + # ... + # + # @param n_epochs [Symbol, :auto, Integer] The number of epochs to train the model for. An epoch refers to one full cycle t + # ... # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. @@ -446,7 +497,7 @@ class Supervised < OpenAI::Internal::Type::BaseModel # @!method initialize(hyperparameters: nil) # Configuration for the supervised fine-tuning method. # - # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised::Hyperparameters] + # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised::Hyperparameters] The hyperparameters used for the fine-tuning job. # @see OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised#hyperparameters class Hyperparameters < OpenAI::Internal::Type::BaseModel @@ -475,11 +526,20 @@ class Hyperparameters < OpenAI::Internal::Type::BaseModel union: -> { OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised::Hyperparameters::NEpochs } # @!method initialize(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised::Hyperparameters} + # for more details. + # # The hyperparameters used for the fine-tuning job. # - # @param batch_size [Symbol, :auto, Integer] - # @param learning_rate_multiplier [Symbol, :auto, Float] - # @param n_epochs [Symbol, :auto, Integer] + # @param batch_size [Symbol, :auto, Integer] Number of examples in each batch. A larger batch size means that model parameter + # ... + # + # @param learning_rate_multiplier [Symbol, :auto, Float] Scaling factor for the learning rate. A smaller learning rate may be useful to a + # ... + # + # @param n_epochs [Symbol, :auto, Integer] The number of epochs to train the model for. An epoch refers to one full cycle t + # ... # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. diff --git a/lib/openai/models/fine_tuning/job_list_events_params.rb b/lib/openai/models/fine_tuning/job_list_events_params.rb index b745c87b..1e911e0f 100644 --- a/lib/openai/models/fine_tuning/job_list_events_params.rb +++ b/lib/openai/models/fine_tuning/job_list_events_params.rb @@ -21,8 +21,10 @@ class JobListEventsParams < OpenAI::Internal::Type::BaseModel optional :limit, Integer # @!method initialize(after: nil, limit: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] + # @param after [String] Identifier for the last event from the previous pagination request. + # + # @param limit [Integer] Number of events to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/fine_tuning/job_list_params.rb b/lib/openai/models/fine_tuning/job_list_params.rb index ddd836ef..da7349d7 100644 --- a/lib/openai/models/fine_tuning/job_list_params.rb +++ b/lib/openai/models/fine_tuning/job_list_params.rb @@ -28,9 +28,16 @@ class JobListParams < OpenAI::Internal::Type::BaseModel optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(after: nil, limit: nil, metadata: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] - # @param metadata [Hash{Symbol=>String}, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobListParams} for more details. + # + # @param after [String] Identifier for the last job from the previous pagination request. + # + # @param limit [Integer] Number of fine-tuning jobs to retrieve. + # + # @param metadata [Hash{Symbol=>String}, nil] Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternative + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rb b/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rb index afa0afa4..024df578 100644 --- a/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rb +++ b/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rb @@ -22,8 +22,10 @@ class CheckpointListParams < OpenAI::Internal::Type::BaseModel optional :limit, Integer # @!method initialize(after: nil, limit: nil, request_options: {}) - # @param after [String] - # @param limit [Integer] + # @param after [String] Identifier for the last checkpoint ID from the previous pagination request. + # + # @param limit [Integer] Number of checkpoints to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rb b/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rb index 05325975..230c5e4d 100644 --- a/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rb +++ b/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rb @@ -52,13 +52,19 @@ class FineTuningJobCheckpoint < OpenAI::Internal::Type::BaseModel # The `fine_tuning.job.checkpoint` object represents a model checkpoint for a # fine-tuning job that is ready to use. # - # @param id [String] - # @param created_at [Integer] - # @param fine_tuned_model_checkpoint [String] - # @param fine_tuning_job_id [String] - # @param metrics [OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint::Metrics] - # @param step_number [Integer] - # @param object [Symbol, :"fine_tuning.job.checkpoint"] + # @param id [String] The checkpoint identifier, which can be referenced in the API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the checkpoint was created. + # + # @param fine_tuned_model_checkpoint [String] The name of the fine-tuned checkpoint model that is created. + # + # @param fine_tuning_job_id [String] The name of the fine-tuning job that this checkpoint was created from. + # + # @param metrics [OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint::Metrics] Metrics at the step number during the fine-tuning job. + # + # @param step_number [Integer] The step number that the checkpoint was created at. + # + # @param object [Symbol, :"fine_tuning.job.checkpoint"] The object type, which is always "fine_tuning.job.checkpoint". # @see OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint#metrics class Metrics < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/function_definition.rb b/lib/openai/models/function_definition.rb index ac6820db..26ca81c0 100644 --- a/lib/openai/models/function_definition.rb +++ b/lib/openai/models/function_definition.rb @@ -40,10 +40,20 @@ class FunctionDefinition < OpenAI::Internal::Type::BaseModel optional :strict, OpenAI::Internal::Type::Boolean, nil?: true # @!method initialize(name:, description: nil, parameters: nil, strict: nil) - # @param name [String] - # @param description [String] - # @param parameters [Hash{Symbol=>Object}] - # @param strict [Boolean, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FunctionDefinition} for more details. + # + # @param name [String] The name of the function to be called. Must be a-z, A-Z, 0-9, or contain undersc + # ... + # + # @param description [String] A description of what the function does, used by the model to choose when and ho + # ... + # + # @param parameters [Hash{Symbol=>Object}] The parameters the functions accepts, described as a JSON Schema object. See the + # ... + # + # @param strict [Boolean, nil] Whether to enable strict schema adherence when generating the function call. If + # ... end end end diff --git a/lib/openai/models/image.rb b/lib/openai/models/image.rb index 52ace3e6..b392c0c4 100644 --- a/lib/openai/models/image.rb +++ b/lib/openai/models/image.rb @@ -26,11 +26,18 @@ class Image < OpenAI::Internal::Type::BaseModel optional :url, String # @!method initialize(b64_json: nil, revised_prompt: nil, url: nil) + # Some parameter documentations has been truncated, see {OpenAI::Models::Image} + # for more details. + # # Represents the content or the URL of an image generated by the OpenAI API. # - # @param b64_json [String] - # @param revised_prompt [String] - # @param url [String] + # @param b64_json [String] The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, + # ... + # + # @param revised_prompt [String] For `dall-e-3` only, the revised prompt that was used to generate the image. + # + # @param url [String] When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response + # ... end end end diff --git a/lib/openai/models/image_create_variation_params.rb b/lib/openai/models/image_create_variation_params.rb index 4a665cb8..d3b45a32 100644 --- a/lib/openai/models/image_create_variation_params.rb +++ b/lib/openai/models/image_create_variation_params.rb @@ -53,12 +53,26 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel optional :user, String # @!method initialize(image:, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) - # @param image [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] - # @param n [Integer, nil] - # @param response_format [Symbol, OpenAI::Models::ImageCreateVariationParams::ResponseFormat, nil] - # @param size [Symbol, OpenAI::Models::ImageCreateVariationParams::Size, nil] - # @param user [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ImageCreateVariationParams} for more details. + # + # @param image [Pathname, StringIO] The image to use as the basis for the variation(s). Must be a valid PNG file, le + # ... + # + # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` is supported at this time + # ... + # + # @param n [Integer, nil] The number of images to generate. Must be between 1 and 10. + # + # @param response_format [Symbol, OpenAI::Models::ImageCreateVariationParams::ResponseFormat, nil] The format in which the generated images are returned. Must be one of `url` or ` + # ... + # + # @param size [Symbol, OpenAI::Models::ImageCreateVariationParams::Size, nil] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The model to use for image generation. Only `dall-e-2` is supported at this diff --git a/lib/openai/models/image_edit_params.rb b/lib/openai/models/image_edit_params.rb index 7abf3372..45591d12 100644 --- a/lib/openai/models/image_edit_params.rb +++ b/lib/openai/models/image_edit_params.rb @@ -80,15 +80,35 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel optional :user, String # @!method initialize(image:, prompt:, mask: nil, model: nil, n: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {}) - # @param image [Pathname, StringIO, Array] - # @param prompt [String] - # @param mask [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] - # @param n [Integer, nil] - # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] - # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] - # @param size [Symbol, OpenAI::Models::ImageEditParams::Size, nil] - # @param user [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ImageEditParams} for more details. + # + # @param image [Pathname, StringIO, Array] The image(s) to edit. Must be a supported image file or an array of images. For + # ... + # + # @param prompt [String] A text description of the desired image(s). The maximum length is 1000 character + # ... + # + # @param mask [Pathname, StringIO] An additional image whose fully transparent areas (e.g. where alpha is zero) ind + # ... + # + # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are sup + # ... + # + # @param n [Integer, nil] The number of images to generate. Must be between 1 and 10. + # + # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated. `high`, `medium` and `low` are + # ... + # + # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] The format in which the generated images are returned. Must be one of `url` or ` + # ... + # + # @param size [Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. Must be one of `1024x1024`, `1536x1024` (lands + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The image(s) to edit. Must be a supported image file or an array of images. For diff --git a/lib/openai/models/image_generate_params.rb b/lib/openai/models/image_generate_params.rb index 56986585..0c7fd7f8 100644 --- a/lib/openai/models/image_generate_params.rb +++ b/lib/openai/models/image_generate_params.rb @@ -112,18 +112,43 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel optional :user, String # @!method initialize(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {}) - # @param prompt [String] - # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] - # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] - # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil] - # @param n [Integer, nil] - # @param output_compression [Integer, nil] - # @param output_format [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil] - # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil] - # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] - # @param size [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] - # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] - # @param user [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ImageGenerateParams} for more details. + # + # @param prompt [String] A text description of the desired image(s). The maximum length is 32000 characte + # ... + # + # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). ... + # + # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or `gpt-im + # ... + # + # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil] Control the content-moderation level for images generated by `gpt-image-1`. Must + # ... + # + # @param n [Integer, nil] The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only + # ... + # + # @param output_compression [Integer, nil] The compression level (0-100%) for the generated images. This parameter is only + # ... + # + # @param output_format [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil] The format in which the generated images are returned. This parameter is only su + # ... + # + # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil] The quality of the image that will be generated. ... + # + # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] The format in which generated images with `dall-e-2` and `dall-e-3` are returned + # ... + # + # @param size [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. Must be one of `1024x1024`, `1536x1024` (lands + # ... + # + # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] The style of the generated images. This parameter is only supported for `dall-e- + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Allows to set transparency for the background of the generated image(s). This diff --git a/lib/openai/models/images_response.rb b/lib/openai/models/images_response.rb index 90c77f01..aa3ede9f 100644 --- a/lib/openai/models/images_response.rb +++ b/lib/openai/models/images_response.rb @@ -23,11 +23,17 @@ class ImagesResponse < OpenAI::Internal::Type::BaseModel optional :usage, -> { OpenAI::Models::ImagesResponse::Usage } # @!method initialize(created:, data: nil, usage: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ImagesResponse} for more details. + # # The response from the image generation endpoint. # - # @param created [Integer] - # @param data [Array] - # @param usage [OpenAI::Models::ImagesResponse::Usage] + # @param created [Integer] The Unix timestamp (in seconds) of when the image was created. + # + # @param data [Array] The list of generated images. + # + # @param usage [OpenAI::Models::ImagesResponse::Usage] For `gpt-image-1` only, the token usage information for the image generation. + # ... # @see OpenAI::Models::ImagesResponse#usage class Usage < OpenAI::Internal::Type::BaseModel @@ -58,10 +64,13 @@ class Usage < OpenAI::Internal::Type::BaseModel # @!method initialize(input_tokens:, input_tokens_details:, output_tokens:, total_tokens:) # For `gpt-image-1` only, the token usage information for the image generation. # - # @param input_tokens [Integer] - # @param input_tokens_details [OpenAI::Models::ImagesResponse::Usage::InputTokensDetails] - # @param output_tokens [Integer] - # @param total_tokens [Integer] + # @param input_tokens [Integer] The number of tokens (images and text) in the input prompt. + # + # @param input_tokens_details [OpenAI::Models::ImagesResponse::Usage::InputTokensDetails] The input tokens detailed information for the image generation. + # + # @param output_tokens [Integer] The number of image tokens in the output image. + # + # @param total_tokens [Integer] The total number of tokens (images and text) used for the image generation. # @see OpenAI::Models::ImagesResponse::Usage#input_tokens_details class InputTokensDetails < OpenAI::Internal::Type::BaseModel @@ -80,8 +89,9 @@ class InputTokensDetails < OpenAI::Internal::Type::BaseModel # @!method initialize(image_tokens:, text_tokens:) # The input tokens detailed information for the image generation. # - # @param image_tokens [Integer] - # @param text_tokens [Integer] + # @param image_tokens [Integer] The number of image tokens in the input prompt. + # + # @param text_tokens [Integer] The number of text tokens in the input prompt. end end end diff --git a/lib/openai/models/model.rb b/lib/openai/models/model.rb index e5893b7c..06721bf5 100644 --- a/lib/openai/models/model.rb +++ b/lib/openai/models/model.rb @@ -31,10 +31,13 @@ class Model < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, created:, owned_by:, object: :model) # Describes an OpenAI model offering that can be used with the API. # - # @param id [String] - # @param created [Integer] - # @param owned_by [String] - # @param object [Symbol, :model] + # @param id [String] The model identifier, which can be referenced in the API endpoints. + # + # @param created [Integer] The Unix timestamp (in seconds) when the model was created. + # + # @param owned_by [String] The organization that owns the model. + # + # @param object [Symbol, :model] The object type, which is always "model". end end end diff --git a/lib/openai/models/moderation.rb b/lib/openai/models/moderation.rb index 834ced17..e53c66fe 100644 --- a/lib/openai/models/moderation.rb +++ b/lib/openai/models/moderation.rb @@ -28,10 +28,17 @@ class Moderation < OpenAI::Internal::Type::BaseModel required :flagged, OpenAI::Internal::Type::Boolean # @!method initialize(categories:, category_applied_input_types:, category_scores:, flagged:) - # @param categories [OpenAI::Models::Moderation::Categories] - # @param category_applied_input_types [OpenAI::Models::Moderation::CategoryAppliedInputTypes] - # @param category_scores [OpenAI::Models::Moderation::CategoryScores] - # @param flagged [Boolean] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Moderation} for more details. + # + # @param categories [OpenAI::Models::Moderation::Categories] A list of the categories, and whether they are flagged or not. + # + # @param category_applied_input_types [OpenAI::Models::Moderation::CategoryAppliedInputTypes] A list of the categories along with the input type(s) that the score applies to. + # ... + # + # @param category_scores [OpenAI::Models::Moderation::CategoryScores] A list of the categories along with their scores as predicted by model. + # + # @param flagged [Boolean] Whether any of the below categories are flagged. # @see OpenAI::Models::Moderation#categories class Categories < OpenAI::Internal::Type::BaseModel @@ -131,21 +138,46 @@ class Categories < OpenAI::Internal::Type::BaseModel required :violence_graphic, OpenAI::Internal::Type::Boolean, api_name: :"violence/graphic" # @!method initialize(harassment:, harassment_threatening:, hate:, hate_threatening:, illicit:, illicit_violent:, self_harm:, self_harm_instructions:, self_harm_intent:, sexual:, sexual_minors:, violence:, violence_graphic:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Moderation::Categories} for more details. + # # A list of the categories, and whether they are flagged or not. # - # @param harassment [Boolean] - # @param harassment_threatening [Boolean] - # @param hate [Boolean] - # @param hate_threatening [Boolean] - # @param illicit [Boolean, nil] - # @param illicit_violent [Boolean, nil] - # @param self_harm [Boolean] - # @param self_harm_instructions [Boolean] - # @param self_harm_intent [Boolean] - # @param sexual [Boolean] - # @param sexual_minors [Boolean] - # @param violence [Boolean] - # @param violence_graphic [Boolean] + # @param harassment [Boolean] Content that expresses, incites, or promotes harassing language towards any targ + # ... + # + # @param harassment_threatening [Boolean] Harassment content that also includes violence or serious harm towards any targe + # ... + # + # @param hate [Boolean] Content that expresses, incites, or promotes hate based on race, gender, ethnici + # ... + # + # @param hate_threatening [Boolean] Hateful content that also includes violence or serious harm towards the targeted + # ... + # + # @param illicit [Boolean, nil] Content that includes instructions or advice that facilitate the planning or exe + # ... + # + # @param illicit_violent [Boolean, nil] Content that includes instructions or advice that facilitate the planning or exe + # ... + # + # @param self_harm [Boolean] Content that promotes, encourages, or depicts acts of self-harm, such as suicide + # ... + # + # @param self_harm_instructions [Boolean] Content that encourages performing acts of self-harm, such as suicide, cutting, + # ... + # + # @param self_harm_intent [Boolean] Content where the speaker expresses that they are engaging or intend to engage i + # ... + # + # @param sexual [Boolean] Content meant to arouse sexual excitement, such as the description of sexual act + # ... + # + # @param sexual_minors [Boolean] Sexual content that includes an individual who is under 18 years old. + # + # @param violence [Boolean] Content that depicts death, violence, or physical injury. + # + # @param violence_graphic [Boolean] Content that depicts death, violence, or physical injury in graphic detail. end # @see OpenAI::Models::Moderation#category_applied_input_types @@ -252,19 +284,31 @@ class CategoryAppliedInputTypes < OpenAI::Internal::Type::BaseModel # @!method initialize(harassment:, harassment_threatening:, hate:, hate_threatening:, illicit:, illicit_violent:, self_harm:, self_harm_instructions:, self_harm_intent:, sexual:, sexual_minors:, violence:, violence_graphic:) # A list of the categories along with the input type(s) that the score applies to. # - # @param harassment [Array] - # @param harassment_threatening [Array] - # @param hate [Array] - # @param hate_threatening [Array] - # @param illicit [Array] - # @param illicit_violent [Array] - # @param self_harm [Array] - # @param self_harm_instructions [Array] - # @param self_harm_intent [Array] - # @param sexual [Array] - # @param sexual_minors [Array] - # @param violence [Array] - # @param violence_graphic [Array] + # @param harassment [Array] The applied input type(s) for the category 'harassment'. + # + # @param harassment_threatening [Array] The applied input type(s) for the category 'harassment/threatening'. + # + # @param hate [Array] The applied input type(s) for the category 'hate'. + # + # @param hate_threatening [Array] The applied input type(s) for the category 'hate/threatening'. + # + # @param illicit [Array] The applied input type(s) for the category 'illicit'. + # + # @param illicit_violent [Array] The applied input type(s) for the category 'illicit/violent'. + # + # @param self_harm [Array] The applied input type(s) for the category 'self-harm'. + # + # @param self_harm_instructions [Array] The applied input type(s) for the category 'self-harm/instructions'. + # + # @param self_harm_intent [Array] The applied input type(s) for the category 'self-harm/intent'. + # + # @param sexual [Array] The applied input type(s) for the category 'sexual'. + # + # @param sexual_minors [Array] The applied input type(s) for the category 'sexual/minors'. + # + # @param violence [Array] The applied input type(s) for the category 'violence'. + # + # @param violence_graphic [Array] The applied input type(s) for the category 'violence/graphic'. module Harassment extend OpenAI::Internal::Type::Enum @@ -473,19 +517,31 @@ class CategoryScores < OpenAI::Internal::Type::BaseModel # @!method initialize(harassment:, harassment_threatening:, hate:, hate_threatening:, illicit:, illicit_violent:, self_harm:, self_harm_instructions:, self_harm_intent:, sexual:, sexual_minors:, violence:, violence_graphic:) # A list of the categories along with their scores as predicted by model. # - # @param harassment [Float] - # @param harassment_threatening [Float] - # @param hate [Float] - # @param hate_threatening [Float] - # @param illicit [Float] - # @param illicit_violent [Float] - # @param self_harm [Float] - # @param self_harm_instructions [Float] - # @param self_harm_intent [Float] - # @param sexual [Float] - # @param sexual_minors [Float] - # @param violence [Float] - # @param violence_graphic [Float] + # @param harassment [Float] The score for the category 'harassment'. + # + # @param harassment_threatening [Float] The score for the category 'harassment/threatening'. + # + # @param hate [Float] The score for the category 'hate'. + # + # @param hate_threatening [Float] The score for the category 'hate/threatening'. + # + # @param illicit [Float] The score for the category 'illicit'. + # + # @param illicit_violent [Float] The score for the category 'illicit/violent'. + # + # @param self_harm [Float] The score for the category 'self-harm'. + # + # @param self_harm_instructions [Float] The score for the category 'self-harm/instructions'. + # + # @param self_harm_intent [Float] The score for the category 'self-harm/intent'. + # + # @param sexual [Float] The score for the category 'sexual'. + # + # @param sexual_minors [Float] The score for the category 'sexual/minors'. + # + # @param violence [Float] The score for the category 'violence'. + # + # @param violence_graphic [Float] The score for the category 'violence/graphic'. end end end diff --git a/lib/openai/models/moderation_create_params.rb b/lib/openai/models/moderation_create_params.rb index 85c8aa74..b6231c78 100644 --- a/lib/openai/models/moderation_create_params.rb +++ b/lib/openai/models/moderation_create_params.rb @@ -24,8 +24,14 @@ class ModerationCreateParams < OpenAI::Internal::Type::BaseModel optional :model, union: -> { OpenAI::Models::ModerationCreateParams::Model } # @!method initialize(input:, model: nil, request_options: {}) - # @param input [String, Array, Array] - # @param model [String, Symbol, OpenAI::Models::ModerationModel] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ModerationCreateParams} for more details. + # + # @param input [String, Array, Array] Input (or inputs) to classify. Can be a single string, an array of strings, or + # ... + # + # @param model [String, Symbol, OpenAI::Models::ModerationModel] The content moderation model you would like to use. Learn more in ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Input (or inputs) to classify. Can be a single string, an array of strings, or diff --git a/lib/openai/models/moderation_create_response.rb b/lib/openai/models/moderation_create_response.rb index 45575319..18ff1405 100644 --- a/lib/openai/models/moderation_create_response.rb +++ b/lib/openai/models/moderation_create_response.rb @@ -25,9 +25,11 @@ class ModerationCreateResponse < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, model:, results:) # Represents if a given text input is potentially harmful. # - # @param id [String] - # @param model [String] - # @param results [Array] + # @param id [String] The unique identifier for the moderation request. + # + # @param model [String] The model used to generate the moderation results. + # + # @param results [Array] A list of moderation objects. end end end diff --git a/lib/openai/models/moderation_image_url_input.rb b/lib/openai/models/moderation_image_url_input.rb index f9fbd274..ac2342f8 100644 --- a/lib/openai/models/moderation_image_url_input.rb +++ b/lib/openai/models/moderation_image_url_input.rb @@ -18,8 +18,9 @@ class ModerationImageURLInput < OpenAI::Internal::Type::BaseModel # @!method initialize(image_url:, type: :image_url) # An object describing an image to classify. # - # @param image_url [OpenAI::Models::ModerationImageURLInput::ImageURL] - # @param type [Symbol, :image_url] + # @param image_url [OpenAI::Models::ModerationImageURLInput::ImageURL] Contains either an image URL or a data URL for a base64 encoded image. + # + # @param type [Symbol, :image_url] Always `image_url`. # @see OpenAI::Models::ModerationImageURLInput#image_url class ImageURL < OpenAI::Internal::Type::BaseModel @@ -32,7 +33,7 @@ class ImageURL < OpenAI::Internal::Type::BaseModel # @!method initialize(url:) # Contains either an image URL or a data URL for a base64 encoded image. # - # @param url [String] + # @param url [String] Either a URL of the image or the base64 encoded image data. end end end diff --git a/lib/openai/models/moderation_text_input.rb b/lib/openai/models/moderation_text_input.rb index 2feaf23d..087178f8 100644 --- a/lib/openai/models/moderation_text_input.rb +++ b/lib/openai/models/moderation_text_input.rb @@ -18,8 +18,9 @@ class ModerationTextInput < OpenAI::Internal::Type::BaseModel # @!method initialize(text:, type: :text) # An object describing text to classify. # - # @param text [String] - # @param type [Symbol, :text] + # @param text [String] A string of text to classify. + # + # @param type [Symbol, :text] Always `text`. end end end diff --git a/lib/openai/models/other_file_chunking_strategy_object.rb b/lib/openai/models/other_file_chunking_strategy_object.rb index 862ae35e..72fc9de8 100644 --- a/lib/openai/models/other_file_chunking_strategy_object.rb +++ b/lib/openai/models/other_file_chunking_strategy_object.rb @@ -14,7 +14,7 @@ class OtherFileChunkingStrategyObject < OpenAI::Internal::Type::BaseModel # because the file was indexed before the `chunking_strategy` concept was # introduced in the API. # - # @param type [Symbol, :other] + # @param type [Symbol, :other] Always `other`. end end end diff --git a/lib/openai/models/reasoning.rb b/lib/openai/models/reasoning.rb index 3457ccea..09690970 100644 --- a/lib/openai/models/reasoning.rb +++ b/lib/openai/models/reasoning.rb @@ -35,14 +35,19 @@ class Reasoning < OpenAI::Internal::Type::BaseModel optional :summary, enum: -> { OpenAI::Models::Reasoning::Summary }, nil?: true # @!method initialize(effort: nil, generate_summary: nil, summary: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Reasoning} for more details. + # # **o-series models only** # # Configuration options for # [reasoning models](https://platform.openai.com/docs/guides/reasoning). # - # @param effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param generate_summary [Symbol, OpenAI::Models::Reasoning::GenerateSummary, nil] - # @param summary [Symbol, OpenAI::Models::Reasoning::Summary, nil] + # @param effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param generate_summary [Symbol, OpenAI::Models::Reasoning::GenerateSummary, nil] **Deprecated:** use `summary` instead. ... + # + # @param summary [Symbol, OpenAI::Models::Reasoning::Summary, nil] A summary of the reasoning performed by the model. This can be ... # @deprecated # diff --git a/lib/openai/models/response_format_json_object.rb b/lib/openai/models/response_format_json_object.rb index 52fc23ae..13a620f2 100644 --- a/lib/openai/models/response_format_json_object.rb +++ b/lib/openai/models/response_format_json_object.rb @@ -14,7 +14,7 @@ class ResponseFormatJSONObject < OpenAI::Internal::Type::BaseModel # `json_schema` is recommended for models that support it. Note that the model # will not generate JSON without a system or user message instructing it to do so. # - # @param type [Symbol, :json_object] + # @param type [Symbol, :json_object] The type of response format being defined. Always `json_object`. end end end diff --git a/lib/openai/models/response_format_json_schema.rb b/lib/openai/models/response_format_json_schema.rb index c6b0fdf9..3e78c9ff 100644 --- a/lib/openai/models/response_format_json_schema.rb +++ b/lib/openai/models/response_format_json_schema.rb @@ -16,12 +16,16 @@ class ResponseFormatJSONSchema < OpenAI::Internal::Type::BaseModel required :type, const: :json_schema # @!method initialize(json_schema:, type: :json_schema) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ResponseFormatJSONSchema} for more details. + # # JSON Schema response format. Used to generate structured JSON responses. Learn # more about # [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). # - # @param json_schema [OpenAI::Models::ResponseFormatJSONSchema::JSONSchema] - # @param type [Symbol, :json_schema] + # @param json_schema [OpenAI::Models::ResponseFormatJSONSchema::JSONSchema] Structured Outputs configuration options, including a JSON Schema. ... + # + # @param type [Symbol, :json_schema] The type of response format being defined. Always `json_schema`. # @see OpenAI::Models::ResponseFormatJSONSchema#json_schema class JSONSchema < OpenAI::Internal::Type::BaseModel @@ -57,12 +61,18 @@ class JSONSchema < OpenAI::Internal::Type::BaseModel optional :strict, OpenAI::Internal::Type::Boolean, nil?: true # @!method initialize(name:, description: nil, schema: nil, strict: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ResponseFormatJSONSchema::JSONSchema} for more details. + # # Structured Outputs configuration options, including a JSON Schema. # - # @param name [String] - # @param description [String] - # @param schema [Hash{Symbol=>Object}] - # @param strict [Boolean, nil] + # @param name [String] The name of the response format. Must be a-z, A-Z, 0-9, or contain ... + # + # @param description [String] A description of what the response format is for, used by the model to ... + # + # @param schema [Hash{Symbol=>Object}] The schema for the response format, described as a JSON Schema object. ... + # + # @param strict [Boolean, nil] Whether to enable strict schema adherence when generating the output. ... end end end diff --git a/lib/openai/models/response_format_text.rb b/lib/openai/models/response_format_text.rb index 8101bcca..a7ac56b0 100644 --- a/lib/openai/models/response_format_text.rb +++ b/lib/openai/models/response_format_text.rb @@ -12,7 +12,7 @@ class ResponseFormatText < OpenAI::Internal::Type::BaseModel # @!method initialize(type: :text) # Default response format. Used to generate text responses. # - # @param type [Symbol, :text] + # @param type [Symbol, :text] The type of response format being defined. Always `text`. end end end diff --git a/lib/openai/models/responses/computer_tool.rb b/lib/openai/models/responses/computer_tool.rb index 41a7499d..29644748 100644 --- a/lib/openai/models/responses/computer_tool.rb +++ b/lib/openai/models/responses/computer_tool.rb @@ -29,13 +29,19 @@ class ComputerTool < OpenAI::Internal::Type::BaseModel required :type, const: :computer_use_preview # @!method initialize(display_height:, display_width:, environment:, type: :computer_use_preview) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ComputerTool} for more details. + # # A tool that controls a virtual computer. Learn more about the # [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). # - # @param display_height [Float] - # @param display_width [Float] - # @param environment [Symbol, OpenAI::Models::Responses::ComputerTool::Environment] - # @param type [Symbol, :computer_use_preview] + # @param display_height [Float] The height of the computer display. ... + # + # @param display_width [Float] The width of the computer display. ... + # + # @param environment [Symbol, OpenAI::Models::Responses::ComputerTool::Environment] The type of computer environment to control. ... + # + # @param type [Symbol, :computer_use_preview] The type of the computer use tool. Always `computer_use_preview`. ... # The type of computer environment to control. # diff --git a/lib/openai/models/responses/easy_input_message.rb b/lib/openai/models/responses/easy_input_message.rb index 3dc4202e..172802bc 100644 --- a/lib/openai/models/responses/easy_input_message.rb +++ b/lib/openai/models/responses/easy_input_message.rb @@ -25,15 +25,20 @@ class EasyInputMessage < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::Responses::EasyInputMessage::Type } # @!method initialize(content:, role:, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::EasyInputMessage} for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. Messages with the # `assistant` role are presumed to have been generated by the model in previous # interactions. # - # @param content [String, Array] - # @param role [Symbol, OpenAI::Models::Responses::EasyInputMessage::Role] - # @param type [Symbol, OpenAI::Models::Responses::EasyInputMessage::Type] + # @param content [String, Array] Text, image, or audio input to the model, used to generate a response. ... + # + # @param role [Symbol, OpenAI::Models::Responses::EasyInputMessage::Role] The role of the message input. One of `user`, `assistant`, `system`, or ... + # + # @param type [Symbol, OpenAI::Models::Responses::EasyInputMessage::Type] The type of the message input. Always `message`. ... # Text, image, or audio input to the model, used to generate a response. Can also # contain previous assistant responses. diff --git a/lib/openai/models/responses/file_search_tool.rb b/lib/openai/models/responses/file_search_tool.rb index 85d13196..bdd10f5f 100644 --- a/lib/openai/models/responses/file_search_tool.rb +++ b/lib/openai/models/responses/file_search_tool.rb @@ -36,15 +36,22 @@ class FileSearchTool < OpenAI::Internal::Type::BaseModel optional :ranking_options, -> { OpenAI::Models::Responses::FileSearchTool::RankingOptions } # @!method initialize(vector_store_ids:, filters: nil, max_num_results: nil, ranking_options: nil, type: :file_search) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::FileSearchTool} for more details. + # # A tool that searches for relevant content from uploaded files. Learn more about # the # [file search tool](https://platform.openai.com/docs/guides/tools-file-search). # - # @param vector_store_ids [Array] - # @param filters [OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter] - # @param max_num_results [Integer] - # @param ranking_options [OpenAI::Models::Responses::FileSearchTool::RankingOptions] - # @param type [Symbol, :file_search] + # @param vector_store_ids [Array] The IDs of the vector stores to search. ... + # + # @param filters [OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter] A filter to apply based on file attributes. + # + # @param max_num_results [Integer] The maximum number of results to return. This number should be between 1 ... + # + # @param ranking_options [OpenAI::Models::Responses::FileSearchTool::RankingOptions] Ranking options for search. + # + # @param type [Symbol, :file_search] The type of the file search tool. Always `file_search`. ... # A filter to apply based on file attributes. # @@ -79,10 +86,14 @@ class RankingOptions < OpenAI::Internal::Type::BaseModel optional :score_threshold, Float # @!method initialize(ranker: nil, score_threshold: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::FileSearchTool::RankingOptions} for more details. + # # Ranking options for search. # - # @param ranker [Symbol, OpenAI::Models::Responses::FileSearchTool::RankingOptions::Ranker] - # @param score_threshold [Float] + # @param ranker [Symbol, OpenAI::Models::Responses::FileSearchTool::RankingOptions::Ranker] The ranker to use for the file search. + # + # @param score_threshold [Float] The score threshold for the file search, a number between 0 and 1. ... # The ranker to use for the file search. # diff --git a/lib/openai/models/responses/function_tool.rb b/lib/openai/models/responses/function_tool.rb index d0cf09ab..e74ed4b6 100644 --- a/lib/openai/models/responses/function_tool.rb +++ b/lib/openai/models/responses/function_tool.rb @@ -36,15 +36,22 @@ class FunctionTool < OpenAI::Internal::Type::BaseModel optional :description, String, nil?: true # @!method initialize(name:, parameters:, strict:, description: nil, type: :function) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::FunctionTool} for more details. + # # Defines a function in your own code the model can choose to call. Learn more # about # [function calling](https://platform.openai.com/docs/guides/function-calling). # - # @param name [String] - # @param parameters [Hash{Symbol=>Object}] - # @param strict [Boolean] - # @param description [String, nil] - # @param type [Symbol, :function] + # @param name [String] The name of the function to call. ... + # + # @param parameters [Hash{Symbol=>Object}] A JSON schema object describing the parameters of the function. ... + # + # @param strict [Boolean] Whether to enforce strict parameter validation. Default `true`. ... + # + # @param description [String, nil] A description of the function. Used by the model to determine whether ... + # + # @param type [Symbol, :function] The type of the function tool. Always `function`. ... end end end diff --git a/lib/openai/models/responses/input_item_list_params.rb b/lib/openai/models/responses/input_item_list_params.rb index d34e8dd7..795ddb04 100644 --- a/lib/openai/models/responses/input_item_list_params.rb +++ b/lib/openai/models/responses/input_item_list_params.rb @@ -45,11 +45,19 @@ class InputItemListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::Responses::InputItemListParams::Order } # @!method initialize(after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}) - # @param after [String] - # @param before [String] - # @param include [Array] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Responses::InputItemListParams::Order] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::InputItemListParams} for more details. + # + # @param after [String] An item ID to list items after, used in pagination. ... + # + # @param before [String] An item ID to list items before, used in pagination. ... + # + # @param include [Array] Additional fields to include in the response. See the `include` ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between ... + # + # @param order [Symbol, OpenAI::Models::Responses::InputItemListParams::Order] The order to return the input items in. Default is `asc`. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # The order to return the input items in. Default is `asc`. diff --git a/lib/openai/models/responses/response.rb b/lib/openai/models/responses/response.rb index a51b6317..6adb6175 100644 --- a/lib/openai/models/responses/response.rb +++ b/lib/openai/models/responses/response.rb @@ -226,29 +226,59 @@ class Response < OpenAI::Internal::Type::BaseModel optional :user, String # @!method initialize(id:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, max_output_tokens: nil, previous_response_id: nil, reasoning: nil, service_tier: nil, status: nil, text: nil, truncation: nil, usage: nil, user: nil, object: :response) - # @param id [String] - # @param created_at [Float] - # @param error [OpenAI::Models::Responses::ResponseError, nil] - # @param incomplete_details [OpenAI::Models::Responses::Response::IncompleteDetails, nil] - # @param instructions [String, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] - # @param output [Array] - # @param parallel_tool_calls [Boolean] - # @param temperature [Float, nil] - # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] - # @param tools [Array] - # @param top_p [Float, nil] - # @param max_output_tokens [Integer, nil] - # @param previous_response_id [String, nil] - # @param reasoning [OpenAI::Models::Reasoning, nil] - # @param service_tier [Symbol, OpenAI::Models::Responses::Response::ServiceTier, nil] - # @param status [Symbol, OpenAI::Models::Responses::ResponseStatus] - # @param text [OpenAI::Models::Responses::ResponseTextConfig] - # @param truncation [Symbol, OpenAI::Models::Responses::Response::Truncation, nil] - # @param usage [OpenAI::Models::Responses::ResponseUsage] - # @param user [String] - # @param object [Symbol, :response] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::Response} for more details. + # + # @param id [String] Unique identifier for this Response. ... + # + # @param created_at [Float] Unix timestamp (in seconds) of when this Response was created. ... + # + # @param error [OpenAI::Models::Responses::ResponseError, nil] An error object returned when the model fails to generate a Response. ... + # + # @param incomplete_details [OpenAI::Models::Responses::Response::IncompleteDetails, nil] Details about why the response is incomplete. ... + # + # @param instructions [String, nil] Inserts a system (or developer) message as the first item in the model's context + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI ... + # + # @param output [Array] An array of content items generated by the model. ... + # + # @param parallel_tool_calls [Boolean] Whether to allow the model to run tool calls in parallel. ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] How the model should select which tool (or tools) to use when generating ... + # + # @param tools [Array] An array of tools the model may call while generating a response. You ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, ... + # + # @param max_output_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a response, in + # ... + # + # @param previous_response_id [String, nil] The unique ID of the previous response to the model. Use this to ... + # + # @param reasoning [OpenAI::Models::Reasoning, nil] **o-series models only** ... + # + # @param service_tier [Symbol, OpenAI::Models::Responses::Response::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseStatus] The status of the response generation. One of `completed`, `failed`, ... + # + # @param text [OpenAI::Models::Responses::ResponseTextConfig] Configuration options for a text response from the model. Can be plain ... + # + # @param truncation [Symbol, OpenAI::Models::Responses::Response::Truncation, nil] The truncation strategy to use for the model response. ... + # + # @param usage [OpenAI::Models::Responses::ResponseUsage] Represents token usage details including input tokens, output tokens, ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # + # @param object [Symbol, :response] The object type of this resource - always set to `response`. ... # @see OpenAI::Models::Responses::Response#incomplete_details class IncompleteDetails < OpenAI::Internal::Type::BaseModel @@ -261,7 +291,7 @@ class IncompleteDetails < OpenAI::Internal::Type::BaseModel # @!method initialize(reason: nil) # Details about why the response is incomplete. # - # @param reason [Symbol, OpenAI::Models::Responses::Response::IncompleteDetails::Reason] + # @param reason [Symbol, OpenAI::Models::Responses::Response::IncompleteDetails::Reason] The reason why the response is incomplete. # The reason why the response is incomplete. # diff --git a/lib/openai/models/responses/response_audio_delta_event.rb b/lib/openai/models/responses/response_audio_delta_event.rb index 45ede8ad..2a0394f8 100644 --- a/lib/openai/models/responses/response_audio_delta_event.rb +++ b/lib/openai/models/responses/response_audio_delta_event.rb @@ -17,10 +17,14 @@ class ResponseAudioDeltaEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.audio.delta" # @!method initialize(delta:, type: :"response.audio.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseAudioDeltaEvent} for more details. + # # Emitted when there is a partial audio response. # - # @param delta [String] - # @param type [Symbol, :"response.audio.delta"] + # @param delta [String] A chunk of Base64 encoded response audio bytes. ... + # + # @param type [Symbol, :"response.audio.delta"] The type of the event. Always `response.audio.delta`. ... end end end diff --git a/lib/openai/models/responses/response_audio_done_event.rb b/lib/openai/models/responses/response_audio_done_event.rb index 359f11b3..218e6146 100644 --- a/lib/openai/models/responses/response_audio_done_event.rb +++ b/lib/openai/models/responses/response_audio_done_event.rb @@ -11,9 +11,12 @@ class ResponseAudioDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.audio.done" # @!method initialize(type: :"response.audio.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseAudioDoneEvent} for more details. + # # Emitted when the audio response is complete. # - # @param type [Symbol, :"response.audio.done"] + # @param type [Symbol, :"response.audio.done"] The type of the event. Always `response.audio.done`. ... end end end diff --git a/lib/openai/models/responses/response_audio_transcript_delta_event.rb b/lib/openai/models/responses/response_audio_transcript_delta_event.rb index 48f70a9d..31a92552 100644 --- a/lib/openai/models/responses/response_audio_transcript_delta_event.rb +++ b/lib/openai/models/responses/response_audio_transcript_delta_event.rb @@ -17,10 +17,14 @@ class ResponseAudioTranscriptDeltaEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.audio.transcript.delta" # @!method initialize(delta:, type: :"response.audio.transcript.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseAudioTranscriptDeltaEvent} for more details. + # # Emitted when there is a partial transcript of audio. # - # @param delta [String] - # @param type [Symbol, :"response.audio.transcript.delta"] + # @param delta [String] The partial transcript of the audio response. ... + # + # @param type [Symbol, :"response.audio.transcript.delta"] The type of the event. Always `response.audio.transcript.delta`. ... end end end diff --git a/lib/openai/models/responses/response_audio_transcript_done_event.rb b/lib/openai/models/responses/response_audio_transcript_done_event.rb index 5abf997b..806bed6e 100644 --- a/lib/openai/models/responses/response_audio_transcript_done_event.rb +++ b/lib/openai/models/responses/response_audio_transcript_done_event.rb @@ -11,9 +11,12 @@ class ResponseAudioTranscriptDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.audio.transcript.done" # @!method initialize(type: :"response.audio.transcript.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseAudioTranscriptDoneEvent} for more details. + # # Emitted when the full audio transcript is completed. # - # @param type [Symbol, :"response.audio.transcript.done"] + # @param type [Symbol, :"response.audio.transcript.done"] The type of the event. Always `response.audio.transcript.done`. ... end end end diff --git a/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rb b/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rb index 934cb5f9..0f337be3 100644 --- a/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rb +++ b/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rb @@ -23,11 +23,17 @@ class ResponseCodeInterpreterCallCodeDeltaEvent < OpenAI::Internal::Type::BaseMo required :type, const: :"response.code_interpreter_call.code.delta" # @!method initialize(delta:, output_index:, type: :"response.code_interpreter_call.code.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent} for more + # details. + # # Emitted when a partial code snippet is added by the code interpreter. # - # @param delta [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.code_interpreter_call.code.delta"] + # @param delta [String] The partial code snippet added by the code interpreter. ... + # + # @param output_index [Integer] The index of the output item that the code interpreter call is in progress. ... + # + # @param type [Symbol, :"response.code_interpreter_call.code.delta"] The type of the event. Always `response.code_interpreter_call.code.delta`. ... end end end diff --git a/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rb b/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rb index 8b10fde8..4d7ad38d 100644 --- a/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rb +++ b/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rb @@ -23,11 +23,17 @@ class ResponseCodeInterpreterCallCodeDoneEvent < OpenAI::Internal::Type::BaseMod required :type, const: :"response.code_interpreter_call.code.done" # @!method initialize(code:, output_index:, type: :"response.code_interpreter_call.code.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent} for more + # details. + # # Emitted when code snippet output is finalized by the code interpreter. # - # @param code [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.code_interpreter_call.code.done"] + # @param code [String] The final code snippet output by the code interpreter. ... + # + # @param output_index [Integer] The index of the output item that the code interpreter call is in progress. ... + # + # @param type [Symbol, :"response.code_interpreter_call.code.done"] The type of the event. Always `response.code_interpreter_call.code.done`. ... end end end diff --git a/lib/openai/models/responses/response_code_interpreter_call_completed_event.rb b/lib/openai/models/responses/response_code_interpreter_call_completed_event.rb index c0e507cd..f5cd8062 100644 --- a/lib/openai/models/responses/response_code_interpreter_call_completed_event.rb +++ b/lib/openai/models/responses/response_code_interpreter_call_completed_event.rb @@ -23,11 +23,17 @@ class ResponseCodeInterpreterCallCompletedEvent < OpenAI::Internal::Type::BaseMo required :type, const: :"response.code_interpreter_call.completed" # @!method initialize(code_interpreter_call:, output_index:, type: :"response.code_interpreter_call.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent} for more + # details. + # # Emitted when the code interpreter call is completed. # - # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] - # @param output_index [Integer] - # @param type [Symbol, :"response.code_interpreter_call.completed"] + # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] A tool call to run code. ... + # + # @param output_index [Integer] The index of the output item that the code interpreter call is in progress. ... + # + # @param type [Symbol, :"response.code_interpreter_call.completed"] The type of the event. Always `response.code_interpreter_call.completed`. ... end end end diff --git a/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rb b/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rb index 3277ceef..2d6c8c32 100644 --- a/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rb +++ b/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rb @@ -23,11 +23,17 @@ class ResponseCodeInterpreterCallInProgressEvent < OpenAI::Internal::Type::BaseM required :type, const: :"response.code_interpreter_call.in_progress" # @!method initialize(code_interpreter_call:, output_index:, type: :"response.code_interpreter_call.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent} for more + # details. + # # Emitted when a code interpreter call is in progress. # - # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] - # @param output_index [Integer] - # @param type [Symbol, :"response.code_interpreter_call.in_progress"] + # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] A tool call to run code. ... + # + # @param output_index [Integer] The index of the output item that the code interpreter call is in progress. ... + # + # @param type [Symbol, :"response.code_interpreter_call.in_progress"] The type of the event. Always `response.code_interpreter_call.in_progress`. ... end end end diff --git a/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rb b/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rb index 3a361629..63e41324 100644 --- a/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rb +++ b/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rb @@ -23,11 +23,17 @@ class ResponseCodeInterpreterCallInterpretingEvent < OpenAI::Internal::Type::Bas required :type, const: :"response.code_interpreter_call.interpreting" # @!method initialize(code_interpreter_call:, output_index:, type: :"response.code_interpreter_call.interpreting") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent} for + # more details. + # # Emitted when the code interpreter is actively interpreting the code snippet. # - # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] - # @param output_index [Integer] - # @param type [Symbol, :"response.code_interpreter_call.interpreting"] + # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] A tool call to run code. ... + # + # @param output_index [Integer] The index of the output item that the code interpreter call is in progress. ... + # + # @param type [Symbol, :"response.code_interpreter_call.interpreting"] The type of the event. Always `response.code_interpreter_call.interpreting`. ... end end end diff --git a/lib/openai/models/responses/response_code_interpreter_tool_call.rb b/lib/openai/models/responses/response_code_interpreter_tool_call.rb index cbab454f..3ab4f34f 100644 --- a/lib/openai/models/responses/response_code_interpreter_tool_call.rb +++ b/lib/openai/models/responses/response_code_interpreter_tool_call.rb @@ -36,13 +36,20 @@ class ResponseCodeInterpreterToolCall < OpenAI::Internal::Type::BaseModel required :type, const: :code_interpreter_call # @!method initialize(id:, code:, results:, status:, type: :code_interpreter_call) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterToolCall} for more details. + # # A tool call to run code. # - # @param id [String] - # @param code [String] - # @param results [Array] - # @param status [Symbol, OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Status] - # @param type [Symbol, :code_interpreter_call] + # @param id [String] The unique ID of the code interpreter tool call. ... + # + # @param code [String] The code to run. ... + # + # @param results [Array] The results of the code interpreter tool call. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Status] The status of the code interpreter tool call. ... + # + # @param type [Symbol, :code_interpreter_call] The type of the code interpreter tool call. Always `code_interpreter_call`. ... # The output of a code interpreter tool call that is text. module Result @@ -70,10 +77,15 @@ class Logs < OpenAI::Internal::Type::BaseModel required :type, const: :logs # @!method initialize(logs:, type: :logs) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Logs} for + # more details. + # # The output of a code interpreter tool call that is text. # - # @param logs [String] - # @param type [Symbol, :logs] + # @param logs [String] The logs of the code interpreter tool call. ... + # + # @param type [Symbol, :logs] The type of the code interpreter text output. Always `logs`. ... end class Files < OpenAI::Internal::Type::BaseModel @@ -90,10 +102,15 @@ class Files < OpenAI::Internal::Type::BaseModel required :type, const: :files # @!method initialize(files:, type: :files) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Files} for + # more details. + # # The output of a code interpreter tool call that is a file. # # @param files [Array] - # @param type [Symbol, :files] + # + # @param type [Symbol, :files] The type of the code interpreter file output. Always `files`. ... class File < OpenAI::Internal::Type::BaseModel # @!attribute file_id @@ -109,8 +126,13 @@ class File < OpenAI::Internal::Type::BaseModel required :mime_type, String # @!method initialize(file_id:, mime_type:) - # @param file_id [String] - # @param mime_type [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Files::File} + # for more details. + # + # @param file_id [String] The ID of the file. ... + # + # @param mime_type [String] The MIME type of the file. ... end end diff --git a/lib/openai/models/responses/response_completed_event.rb b/lib/openai/models/responses/response_completed_event.rb index 509663df..e4995227 100644 --- a/lib/openai/models/responses/response_completed_event.rb +++ b/lib/openai/models/responses/response_completed_event.rb @@ -17,10 +17,14 @@ class ResponseCompletedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.completed" # @!method initialize(response:, type: :"response.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCompletedEvent} for more details. + # # Emitted when the model response is complete. # - # @param response [OpenAI::Models::Responses::Response] - # @param type [Symbol, :"response.completed"] + # @param response [OpenAI::Models::Responses::Response] Properties of the completed response. ... + # + # @param type [Symbol, :"response.completed"] The type of the event. Always `response.completed`. ... end end end diff --git a/lib/openai/models/responses/response_computer_tool_call.rb b/lib/openai/models/responses/response_computer_tool_call.rb index b84db1e5..5f2dedd1 100644 --- a/lib/openai/models/responses/response_computer_tool_call.rb +++ b/lib/openai/models/responses/response_computer_tool_call.rb @@ -43,16 +43,24 @@ class ResponseComputerToolCall < OpenAI::Internal::Type::BaseModel required :type, enum: -> { OpenAI::Models::Responses::ResponseComputerToolCall::Type } # @!method initialize(id:, action:, call_id:, pending_safety_checks:, status:, type:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall} for more details. + # # A tool call to a computer use tool. See the # [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) # for more information. # - # @param id [String] - # @param action [OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click, OpenAI::Models::Responses::ResponseComputerToolCall::Action::DoubleClick, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Keypress, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Move, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Screenshot, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Scroll, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Type, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Wait] - # @param call_id [String] - # @param pending_safety_checks [Array] - # @param status [Symbol, OpenAI::Models::Responses::ResponseComputerToolCall::Status] - # @param type [Symbol, OpenAI::Models::Responses::ResponseComputerToolCall::Type] + # @param id [String] The unique ID of the computer call. + # + # @param action [OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click, OpenAI::Models::Responses::ResponseComputerToolCall::Action::DoubleClick, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Keypress, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Move, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Screenshot, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Scroll, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Type, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Wait] A click action. ... + # + # @param call_id [String] An identifier used when responding to the tool call with output. ... + # + # @param pending_safety_checks [Array] The pending safety checks for the computer call. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseComputerToolCall::Status] The status of the item. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, OpenAI::Models::Responses::ResponseComputerToolCall::Type] The type of the computer call. Always `computer_call`. # A click action. # @@ -117,12 +125,20 @@ class Click < OpenAI::Internal::Type::BaseModel required :y_, Integer, api_name: :y # @!method initialize(button:, x:, y_:, type: :click) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click} for more + # details. + # # A click action. # - # @param button [Symbol, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click::Button] - # @param x [Integer] - # @param y_ [Integer] - # @param type [Symbol, :click] + # @param button [Symbol, OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click::Button] Indicates which mouse button was pressed during the click. One of `left`, `right + # ... + # + # @param x [Integer] The x-coordinate where the click occurred. ... + # + # @param y_ [Integer] The y-coordinate where the click occurred. ... + # + # @param type [Symbol, :click] Specifies the event type. For a click action, this property is ... # Indicates which mouse button was pressed during the click. One of `left`, # `right`, `wheel`, `back`, or `forward`. @@ -163,11 +179,17 @@ class DoubleClick < OpenAI::Internal::Type::BaseModel required :y_, Integer, api_name: :y # @!method initialize(x:, y_:, type: :double_click) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::DoubleClick} for + # more details. + # # A double click action. # - # @param x [Integer] - # @param y_ [Integer] - # @param type [Symbol, :double_click] + # @param x [Integer] The x-coordinate where the double click occurred. ... + # + # @param y_ [Integer] The y-coordinate where the double click occurred. ... + # + # @param type [Symbol, :double_click] Specifies the event type. For a double click action, this property is ... end class Drag < OpenAI::Internal::Type::BaseModel @@ -194,10 +216,16 @@ class Drag < OpenAI::Internal::Type::BaseModel required :type, const: :drag # @!method initialize(path:, type: :drag) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag} for more + # details. + # # A drag action. # - # @param path [Array] - # @param type [Symbol, :drag] + # @param path [Array] An array of coordinates representing the path of the drag action. Coordinates wi + # ... + # + # @param type [Symbol, :drag] Specifies the event type. For a drag action, this property is ... class Path < OpenAI::Internal::Type::BaseModel # @!attribute x @@ -213,10 +241,15 @@ class Path < OpenAI::Internal::Type::BaseModel required :y_, Integer, api_name: :y # @!method initialize(x:, y_:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag::Path} for + # more details. + # # A series of x/y coordinate pairs in the drag path. # - # @param x [Integer] - # @param y_ [Integer] + # @param x [Integer] The x-coordinate. ... + # + # @param y_ [Integer] The y-coordinate. ... end end @@ -236,10 +269,15 @@ class Keypress < OpenAI::Internal::Type::BaseModel required :type, const: :keypress # @!method initialize(keys:, type: :keypress) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Keypress} for more + # details. + # # A collection of keypresses the model would like to perform. # - # @param keys [Array] - # @param type [Symbol, :keypress] + # @param keys [Array] The combination of keys the model is requesting to be pressed. This is an ... + # + # @param type [Symbol, :keypress] Specifies the event type. For a keypress action, this property is ... end class Move < OpenAI::Internal::Type::BaseModel @@ -263,11 +301,17 @@ class Move < OpenAI::Internal::Type::BaseModel required :y_, Integer, api_name: :y # @!method initialize(x:, y_:, type: :move) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Move} for more + # details. + # # A mouse move action. # - # @param x [Integer] - # @param y_ [Integer] - # @param type [Symbol, :move] + # @param x [Integer] The x-coordinate to move to. ... + # + # @param y_ [Integer] The y-coordinate to move to. ... + # + # @param type [Symbol, :move] Specifies the event type. For a move action, this property is ... end class Screenshot < OpenAI::Internal::Type::BaseModel @@ -279,9 +323,13 @@ class Screenshot < OpenAI::Internal::Type::BaseModel required :type, const: :screenshot # @!method initialize(type: :screenshot) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Screenshot} for + # more details. + # # A screenshot action. # - # @param type [Symbol, :screenshot] + # @param type [Symbol, :screenshot] Specifies the event type. For a screenshot action, this property is ... end class Scroll < OpenAI::Internal::Type::BaseModel @@ -317,13 +365,21 @@ class Scroll < OpenAI::Internal::Type::BaseModel required :y_, Integer, api_name: :y # @!method initialize(scroll_x:, scroll_y:, x:, y_:, type: :scroll) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Scroll} for more + # details. + # # A scroll action. # - # @param scroll_x [Integer] - # @param scroll_y [Integer] - # @param x [Integer] - # @param y_ [Integer] - # @param type [Symbol, :scroll] + # @param scroll_x [Integer] The horizontal scroll distance. ... + # + # @param scroll_y [Integer] The vertical scroll distance. ... + # + # @param x [Integer] The x-coordinate where the scroll occurred. ... + # + # @param y_ [Integer] The y-coordinate where the scroll occurred. ... + # + # @param type [Symbol, :scroll] Specifies the event type. For a scroll action, this property is ... end class Type < OpenAI::Internal::Type::BaseModel @@ -341,10 +397,15 @@ class Type < OpenAI::Internal::Type::BaseModel required :type, const: :type # @!method initialize(text:, type: :type) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Type} for more + # details. + # # An action to type in text. # - # @param text [String] - # @param type [Symbol, :type] + # @param text [String] The text to type. ... + # + # @param type [Symbol, :type] Specifies the event type. For a type action, this property is ... end class Wait < OpenAI::Internal::Type::BaseModel @@ -356,9 +417,13 @@ class Wait < OpenAI::Internal::Type::BaseModel required :type, const: :wait # @!method initialize(type: :wait) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCall::Action::Wait} for more + # details. + # # A wait action. # - # @param type [Symbol, :wait] + # @param type [Symbol, :wait] Specifies the event type. For a wait action, this property is ... end # @!method self.variants @@ -387,9 +452,11 @@ class PendingSafetyCheck < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, code:, message:) # A pending safety check for the computer call. # - # @param id [String] - # @param code [String] - # @param message [String] + # @param id [String] The ID of the pending safety check. + # + # @param code [String] The type of the pending safety check. + # + # @param message [String] Details about the pending safety check. end # The status of the item. One of `in_progress`, `completed`, or `incomplete`. diff --git a/lib/openai/models/responses/response_computer_tool_call_output_item.rb b/lib/openai/models/responses/response_computer_tool_call_output_item.rb index 9bfc14e2..1b404766 100644 --- a/lib/openai/models/responses/response_computer_tool_call_output_item.rb +++ b/lib/openai/models/responses/response_computer_tool_call_output_item.rb @@ -44,12 +44,21 @@ class ResponseComputerToolCallOutputItem < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::Status } # @!method initialize(id:, call_id:, output:, acknowledged_safety_checks: nil, status: nil, type: :computer_call_output) - # @param id [String] - # @param call_id [String] - # @param output [OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot] - # @param acknowledged_safety_checks [Array] - # @param status [Symbol, OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::Status] - # @param type [Symbol, :computer_call_output] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCallOutputItem} for more + # details. + # + # @param id [String] The unique ID of the computer call tool output. ... + # + # @param call_id [String] The ID of the computer tool call that produced the output. ... + # + # @param output [OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot] A computer screenshot image used with the computer use tool. ... + # + # @param acknowledged_safety_checks [Array] The safety checks reported by the API that have been acknowledged by the ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::Status] The status of the message input. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, :computer_call_output] The type of the computer tool call output. Always `computer_call_output`. ... class AcknowledgedSafetyCheck < OpenAI::Internal::Type::BaseModel # @!attribute id @@ -73,9 +82,11 @@ class AcknowledgedSafetyCheck < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, code:, message:) # A pending safety check for the computer call. # - # @param id [String] - # @param code [String] - # @param message [String] + # @param id [String] The ID of the pending safety check. + # + # @param code [String] The type of the pending safety check. + # + # @param message [String] Details about the pending safety check. end # The status of the message input. One of `in_progress`, `completed`, or diff --git a/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rb b/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rb index 9dc1550c..e42b2d78 100644 --- a/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rb +++ b/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rb @@ -24,11 +24,17 @@ class ResponseComputerToolCallOutputScreenshot < OpenAI::Internal::Type::BaseMod optional :image_url, String # @!method initialize(file_id: nil, image_url: nil, type: :computer_screenshot) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot} for more + # details. + # # A computer screenshot image used with the computer use tool. # - # @param file_id [String] - # @param image_url [String] - # @param type [Symbol, :computer_screenshot] + # @param file_id [String] The identifier of an uploaded file that contains the screenshot. + # + # @param image_url [String] The URL of the screenshot image. + # + # @param type [Symbol, :computer_screenshot] Specifies the event type. For a computer screenshot, this property is ... end end end diff --git a/lib/openai/models/responses/response_content_part_added_event.rb b/lib/openai/models/responses/response_content_part_added_event.rb index 8399e487..86328573 100644 --- a/lib/openai/models/responses/response_content_part_added_event.rb +++ b/lib/openai/models/responses/response_content_part_added_event.rb @@ -35,13 +35,20 @@ class ResponseContentPartAddedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.content_part.added" # @!method initialize(content_index:, item_id:, output_index:, part:, type: :"response.content_part.added") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseContentPartAddedEvent} for more details. + # # Emitted when a new content part is added. # - # @param content_index [Integer] - # @param item_id [String] - # @param output_index [Integer] - # @param part [OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal] - # @param type [Symbol, :"response.content_part.added"] + # @param content_index [Integer] The index of the content part that was added. ... + # + # @param item_id [String] The ID of the output item that the content part was added to. ... + # + # @param output_index [Integer] The index of the output item that the content part was added to. ... + # + # @param part [OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal] The content part that was added. ... + # + # @param type [Symbol, :"response.content_part.added"] The type of the event. Always `response.content_part.added`. ... # The content part that was added. # diff --git a/lib/openai/models/responses/response_content_part_done_event.rb b/lib/openai/models/responses/response_content_part_done_event.rb index 945ef949..2858e020 100644 --- a/lib/openai/models/responses/response_content_part_done_event.rb +++ b/lib/openai/models/responses/response_content_part_done_event.rb @@ -35,13 +35,20 @@ class ResponseContentPartDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.content_part.done" # @!method initialize(content_index:, item_id:, output_index:, part:, type: :"response.content_part.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseContentPartDoneEvent} for more details. + # # Emitted when a content part is done. # - # @param content_index [Integer] - # @param item_id [String] - # @param output_index [Integer] - # @param part [OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal] - # @param type [Symbol, :"response.content_part.done"] + # @param content_index [Integer] The index of the content part that is done. ... + # + # @param item_id [String] The ID of the output item that the content part was added to. ... + # + # @param output_index [Integer] The index of the output item that the content part was added to. ... + # + # @param part [OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal] The content part that is done. ... + # + # @param type [Symbol, :"response.content_part.done"] The type of the event. Always `response.content_part.done`. ... # The content part that is done. # diff --git a/lib/openai/models/responses/response_create_params.rb b/lib/openai/models/responses/response_create_params.rb index f20f9cc0..6e51faa1 100644 --- a/lib/openai/models/responses/response_create_params.rb +++ b/lib/openai/models/responses/response_create_params.rb @@ -209,24 +209,50 @@ class ResponseCreateParams < OpenAI::Internal::Type::BaseModel optional :user, String # @!method initialize(input:, model:, include: nil, instructions: nil, max_output_tokens: nil, metadata: nil, parallel_tool_calls: nil, previous_response_id: nil, reasoning: nil, service_tier: nil, store: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_p: nil, truncation: nil, user: nil, request_options: {}) - # @param input [String, Array] - # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] - # @param include [Array, nil] - # @param instructions [String, nil] - # @param max_output_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param parallel_tool_calls [Boolean, nil] - # @param previous_response_id [String, nil] - # @param reasoning [OpenAI::Models::Reasoning, nil] - # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] - # @param store [Boolean, nil] - # @param temperature [Float, nil] - # @param text [OpenAI::Models::Responses::ResponseTextConfig] - # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] - # @param tools [Array] - # @param top_p [Float, nil] - # @param truncation [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Truncation, nil] - # @param user [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCreateParams} for more details. + # + # @param input [String, Array] Text, image, or file inputs to the model, used to generate a response. ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI ... + # + # @param include [Array, nil] Specify additional output data to include in the model response. Currently ... + # + # @param instructions [String, nil] Inserts a system (or developer) message as the first item in the model's context + # ... + # + # @param max_output_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a response, in + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param parallel_tool_calls [Boolean, nil] Whether to allow the model to run tool calls in parallel. ... + # + # @param previous_response_id [String, nil] The unique ID of the previous response to the model. Use this to ... + # + # @param reasoning [OpenAI::Models::Reasoning, nil] **o-series models only** ... + # + # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param store [Boolean, nil] Whether to store the generated model response for later retrieval via ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param text [OpenAI::Models::Responses::ResponseTextConfig] Configuration options for a text response from the model. Can be plain ... + # + # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] How the model should select which tool (or tools) to use when generating ... + # + # @param tools [Array] An array of tools the model may call while generating a response. You ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, ... + # + # @param truncation [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Truncation, nil] The truncation strategy to use for the model response. ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Text, image, or file inputs to the model, used to generate a response. diff --git a/lib/openai/models/responses/response_created_event.rb b/lib/openai/models/responses/response_created_event.rb index ad5cf6d0..0c8408d0 100644 --- a/lib/openai/models/responses/response_created_event.rb +++ b/lib/openai/models/responses/response_created_event.rb @@ -17,10 +17,14 @@ class ResponseCreatedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.created" # @!method initialize(response:, type: :"response.created") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCreatedEvent} for more details. + # # An event that is emitted when a response is created. # - # @param response [OpenAI::Models::Responses::Response] - # @param type [Symbol, :"response.created"] + # @param response [OpenAI::Models::Responses::Response] The response that was created. ... + # + # @param type [Symbol, :"response.created"] The type of the event. Always `response.created`. ... end end end diff --git a/lib/openai/models/responses/response_error.rb b/lib/openai/models/responses/response_error.rb index 3727a834..3e4e38bc 100644 --- a/lib/openai/models/responses/response_error.rb +++ b/lib/openai/models/responses/response_error.rb @@ -17,10 +17,14 @@ class ResponseError < OpenAI::Internal::Type::BaseModel required :message, String # @!method initialize(code:, message:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseError} for more details. + # # An error object returned when the model fails to generate a Response. # - # @param code [Symbol, OpenAI::Models::Responses::ResponseError::Code] - # @param message [String] + # @param code [Symbol, OpenAI::Models::Responses::ResponseError::Code] The error code for the response. ... + # + # @param message [String] A human-readable description of the error. ... # The error code for the response. # diff --git a/lib/openai/models/responses/response_error_event.rb b/lib/openai/models/responses/response_error_event.rb index d3bfa55e..c8ad2c34 100644 --- a/lib/openai/models/responses/response_error_event.rb +++ b/lib/openai/models/responses/response_error_event.rb @@ -29,12 +29,18 @@ class ResponseErrorEvent < OpenAI::Internal::Type::BaseModel required :type, const: :error # @!method initialize(code:, message:, param:, type: :error) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseErrorEvent} for more details. + # # Emitted when an error occurs. # - # @param code [String, nil] - # @param message [String] - # @param param [String, nil] - # @param type [Symbol, :error] + # @param code [String, nil] The error code. ... + # + # @param message [String] The error message. ... + # + # @param param [String, nil] The error parameter. ... + # + # @param type [Symbol, :error] The type of the event. Always `error`. ... end end end diff --git a/lib/openai/models/responses/response_failed_event.rb b/lib/openai/models/responses/response_failed_event.rb index cbed3cb7..54ee8e5c 100644 --- a/lib/openai/models/responses/response_failed_event.rb +++ b/lib/openai/models/responses/response_failed_event.rb @@ -17,10 +17,14 @@ class ResponseFailedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.failed" # @!method initialize(response:, type: :"response.failed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFailedEvent} for more details. + # # An event that is emitted when a response fails. # - # @param response [OpenAI::Models::Responses::Response] - # @param type [Symbol, :"response.failed"] + # @param response [OpenAI::Models::Responses::Response] The response that failed. ... + # + # @param type [Symbol, :"response.failed"] The type of the event. Always `response.failed`. ... end end end diff --git a/lib/openai/models/responses/response_file_search_call_completed_event.rb b/lib/openai/models/responses/response_file_search_call_completed_event.rb index ffb7c68d..1afd9153 100644 --- a/lib/openai/models/responses/response_file_search_call_completed_event.rb +++ b/lib/openai/models/responses/response_file_search_call_completed_event.rb @@ -23,11 +23,17 @@ class ResponseFileSearchCallCompletedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.file_search_call.completed" # @!method initialize(item_id:, output_index:, type: :"response.file_search_call.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFileSearchCallCompletedEvent} for more + # details. + # # Emitted when a file search call is completed (results found). # - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.file_search_call.completed"] + # @param item_id [String] The ID of the output item that the file search call is initiated. ... + # + # @param output_index [Integer] The index of the output item that the file search call is initiated. ... + # + # @param type [Symbol, :"response.file_search_call.completed"] The type of the event. Always `response.file_search_call.completed`. ... end end end diff --git a/lib/openai/models/responses/response_file_search_call_in_progress_event.rb b/lib/openai/models/responses/response_file_search_call_in_progress_event.rb index 72fafbc7..74e08290 100644 --- a/lib/openai/models/responses/response_file_search_call_in_progress_event.rb +++ b/lib/openai/models/responses/response_file_search_call_in_progress_event.rb @@ -23,11 +23,17 @@ class ResponseFileSearchCallInProgressEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.file_search_call.in_progress" # @!method initialize(item_id:, output_index:, type: :"response.file_search_call.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFileSearchCallInProgressEvent} for more + # details. + # # Emitted when a file search call is initiated. # - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.file_search_call.in_progress"] + # @param item_id [String] The ID of the output item that the file search call is initiated. ... + # + # @param output_index [Integer] The index of the output item that the file search call is initiated. ... + # + # @param type [Symbol, :"response.file_search_call.in_progress"] The type of the event. Always `response.file_search_call.in_progress`. ... end end end diff --git a/lib/openai/models/responses/response_file_search_call_searching_event.rb b/lib/openai/models/responses/response_file_search_call_searching_event.rb index 07c1186a..118b323f 100644 --- a/lib/openai/models/responses/response_file_search_call_searching_event.rb +++ b/lib/openai/models/responses/response_file_search_call_searching_event.rb @@ -23,11 +23,17 @@ class ResponseFileSearchCallSearchingEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.file_search_call.searching" # @!method initialize(item_id:, output_index:, type: :"response.file_search_call.searching") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFileSearchCallSearchingEvent} for more + # details. + # # Emitted when a file search is currently searching. # - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.file_search_call.searching"] + # @param item_id [String] The ID of the output item that the file search call is initiated. ... + # + # @param output_index [Integer] The index of the output item that the file search call is searching. ... + # + # @param type [Symbol, :"response.file_search_call.searching"] The type of the event. Always `response.file_search_call.searching`. ... end end end diff --git a/lib/openai/models/responses/response_file_search_tool_call.rb b/lib/openai/models/responses/response_file_search_tool_call.rb index 9fc12343..71462ed2 100644 --- a/lib/openai/models/responses/response_file_search_tool_call.rb +++ b/lib/openai/models/responses/response_file_search_tool_call.rb @@ -38,15 +38,22 @@ class ResponseFileSearchToolCall < OpenAI::Internal::Type::BaseModel nil?: true # @!method initialize(id:, queries:, status:, results: nil, type: :file_search_call) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFileSearchToolCall} for more details. + # # The results of a file search tool call. See the # [file search guide](https://platform.openai.com/docs/guides/tools-file-search) # for more information. # - # @param id [String] - # @param queries [Array] - # @param status [Symbol, OpenAI::Models::Responses::ResponseFileSearchToolCall::Status] - # @param results [Array, nil] - # @param type [Symbol, :file_search_call] + # @param id [String] The unique ID of the file search tool call. ... + # + # @param queries [Array] The queries used to search for files. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseFileSearchToolCall::Status] The status of the file search tool call. One of `in_progress`, ... + # + # @param results [Array, nil] The results of the file search tool call. ... + # + # @param type [Symbol, :file_search_call] The type of the file search tool call. Always `file_search_call`. ... # The status of the file search tool call. One of `in_progress`, `searching`, # `incomplete` or `failed`, @@ -103,11 +110,19 @@ class Result < OpenAI::Internal::Type::BaseModel optional :text, String # @!method initialize(attributes: nil, file_id: nil, filename: nil, score: nil, text: nil) - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] - # @param file_id [String] - # @param filename [String] - # @param score [Float] - # @param text [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFileSearchToolCall::Result} for more + # details. + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param file_id [String] The unique ID of the file. ... + # + # @param filename [String] The name of the file. ... + # + # @param score [Float] The relevance score of the file - a value between 0 and 1. ... + # + # @param text [String] The text that was retrieved from the file. ... module Attribute extend OpenAI::Internal::Type::Union diff --git a/lib/openai/models/responses/response_format_text_json_schema_config.rb b/lib/openai/models/responses/response_format_text_json_schema_config.rb index 106627ff..d2ac2772 100644 --- a/lib/openai/models/responses/response_format_text_json_schema_config.rb +++ b/lib/openai/models/responses/response_format_text_json_schema_config.rb @@ -42,15 +42,23 @@ class ResponseFormatTextJSONSchemaConfig < OpenAI::Internal::Type::BaseModel optional :strict, OpenAI::Internal::Type::Boolean, nil?: true # @!method initialize(name:, schema:, description: nil, strict: nil, type: :json_schema) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig} for more + # details. + # # JSON Schema response format. Used to generate structured JSON responses. Learn # more about # [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). # - # @param name [String] - # @param schema [Hash{Symbol=>Object}] - # @param description [String] - # @param strict [Boolean, nil] - # @param type [Symbol, :json_schema] + # @param name [String] The name of the response format. Must be a-z, A-Z, 0-9, or contain ... + # + # @param schema [Hash{Symbol=>Object}] The schema for the response format, described as a JSON Schema object. ... + # + # @param description [String] A description of what the response format is for, used by the model to ... + # + # @param strict [Boolean, nil] Whether to enable strict schema adherence when generating the output. ... + # + # @param type [Symbol, :json_schema] The type of response format being defined. Always `json_schema`. end end end diff --git a/lib/openai/models/responses/response_function_call_arguments_delta_event.rb b/lib/openai/models/responses/response_function_call_arguments_delta_event.rb index abd84e9c..57e63c2b 100644 --- a/lib/openai/models/responses/response_function_call_arguments_delta_event.rb +++ b/lib/openai/models/responses/response_function_call_arguments_delta_event.rb @@ -29,12 +29,21 @@ class ResponseFunctionCallArgumentsDeltaEvent < OpenAI::Internal::Type::BaseMode required :type, const: :"response.function_call_arguments.delta" # @!method initialize(delta:, item_id:, output_index:, type: :"response.function_call_arguments.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent} for more + # details. + # # Emitted when there is a partial function-call arguments delta. # - # @param delta [String] - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.function_call_arguments.delta"] + # @param delta [String] The function-call arguments delta that is added. ... + # + # @param item_id [String] The ID of the output item that the function-call arguments delta is added to. + # ... + # + # @param output_index [Integer] The index of the output item that the function-call arguments delta is added to. + # ... + # + # @param type [Symbol, :"response.function_call_arguments.delta"] The type of the event. Always `response.function_call_arguments.delta`. ... end end end diff --git a/lib/openai/models/responses/response_function_call_arguments_done_event.rb b/lib/openai/models/responses/response_function_call_arguments_done_event.rb index ba402026..ded7ece3 100644 --- a/lib/openai/models/responses/response_function_call_arguments_done_event.rb +++ b/lib/openai/models/responses/response_function_call_arguments_done_event.rb @@ -30,9 +30,12 @@ class ResponseFunctionCallArgumentsDoneEvent < OpenAI::Internal::Type::BaseModel # @!method initialize(arguments:, item_id:, output_index:, type: :"response.function_call_arguments.done") # Emitted when function-call arguments are finalized. # - # @param arguments [String] - # @param item_id [String] - # @param output_index [Integer] + # @param arguments [String] The function-call arguments. + # + # @param item_id [String] The ID of the item. + # + # @param output_index [Integer] The index of the output item. + # # @param type [Symbol, :"response.function_call_arguments.done"] end end diff --git a/lib/openai/models/responses/response_function_tool_call.rb b/lib/openai/models/responses/response_function_tool_call.rb index 7db552df..1aa5d417 100644 --- a/lib/openai/models/responses/response_function_tool_call.rb +++ b/lib/openai/models/responses/response_function_tool_call.rb @@ -42,16 +42,24 @@ class ResponseFunctionToolCall < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Responses::ResponseFunctionToolCall::Status } # @!method initialize(arguments:, call_id:, name:, id: nil, status: nil, type: :function_call) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFunctionToolCall} for more details. + # # A tool call to run a function. See the # [function calling guide](https://platform.openai.com/docs/guides/function-calling) # for more information. # - # @param arguments [String] - # @param call_id [String] - # @param name [String] - # @param id [String] - # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionToolCall::Status] - # @param type [Symbol, :function_call] + # @param arguments [String] A JSON string of the arguments to pass to the function. ... + # + # @param call_id [String] The unique ID of the function tool call generated by the model. ... + # + # @param name [String] The name of the function to run. ... + # + # @param id [String] The unique ID of the function tool call. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionToolCall::Status] The status of the item. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, :function_call] The type of the function tool call. Always `function_call`. ... # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. diff --git a/lib/openai/models/responses/response_function_tool_call_item.rb b/lib/openai/models/responses/response_function_tool_call_item.rb index 2244965f..e304dda3 100644 --- a/lib/openai/models/responses/response_function_tool_call_item.rb +++ b/lib/openai/models/responses/response_function_tool_call_item.rb @@ -11,11 +11,14 @@ class ResponseFunctionToolCallItem < OpenAI::Models::Responses::ResponseFunction required :id, String # @!method initialize(id:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFunctionToolCallItem} for more details. + # # A tool call to run a function. See the # [function calling guide](https://platform.openai.com/docs/guides/function-calling) # for more information. # - # @param id [String] + # @param id [String] The unique ID of the function tool call. ... end end end diff --git a/lib/openai/models/responses/response_function_tool_call_output_item.rb b/lib/openai/models/responses/response_function_tool_call_output_item.rb index 6623a73c..8cc6084a 100644 --- a/lib/openai/models/responses/response_function_tool_call_output_item.rb +++ b/lib/openai/models/responses/response_function_tool_call_output_item.rb @@ -36,11 +36,19 @@ class ResponseFunctionToolCallOutputItem < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Status } # @!method initialize(id:, call_id:, output:, status: nil, type: :function_call_output) - # @param id [String] - # @param call_id [String] - # @param output [String] - # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Status] - # @param type [Symbol, :function_call_output] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem} for more + # details. + # + # @param id [String] The unique ID of the function call tool output. ... + # + # @param call_id [String] The unique ID of the function tool call generated by the model. ... + # + # @param output [String] A JSON string of the output of the function tool call. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Status] The status of the item. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, :function_call_output] The type of the function tool call output. Always `function_call_output`. ... # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. diff --git a/lib/openai/models/responses/response_function_web_search.rb b/lib/openai/models/responses/response_function_web_search.rb index 3529a019..c08e4e32 100644 --- a/lib/openai/models/responses/response_function_web_search.rb +++ b/lib/openai/models/responses/response_function_web_search.rb @@ -23,13 +23,18 @@ class ResponseFunctionWebSearch < OpenAI::Internal::Type::BaseModel required :type, const: :web_search_call # @!method initialize(id:, status:, type: :web_search_call) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseFunctionWebSearch} for more details. + # # The results of a web search tool call. See the # [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for # more information. # - # @param id [String] - # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionWebSearch::Status] - # @param type [Symbol, :web_search_call] + # @param id [String] The unique ID of the web search tool call. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionWebSearch::Status] The status of the web search tool call. ... + # + # @param type [Symbol, :web_search_call] The type of the web search tool call. Always `web_search_call`. ... # The status of the web search tool call. # diff --git a/lib/openai/models/responses/response_in_progress_event.rb b/lib/openai/models/responses/response_in_progress_event.rb index 0259d443..f095d74d 100644 --- a/lib/openai/models/responses/response_in_progress_event.rb +++ b/lib/openai/models/responses/response_in_progress_event.rb @@ -17,10 +17,14 @@ class ResponseInProgressEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.in_progress" # @!method initialize(response:, type: :"response.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInProgressEvent} for more details. + # # Emitted when the response is in progress. # - # @param response [OpenAI::Models::Responses::Response] - # @param type [Symbol, :"response.in_progress"] + # @param response [OpenAI::Models::Responses::Response] The response that is in progress. ... + # + # @param type [Symbol, :"response.in_progress"] The type of the event. Always `response.in_progress`. ... end end end diff --git a/lib/openai/models/responses/response_incomplete_event.rb b/lib/openai/models/responses/response_incomplete_event.rb index 5536418d..e23ef3a8 100644 --- a/lib/openai/models/responses/response_incomplete_event.rb +++ b/lib/openai/models/responses/response_incomplete_event.rb @@ -17,10 +17,14 @@ class ResponseIncompleteEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.incomplete" # @!method initialize(response:, type: :"response.incomplete") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseIncompleteEvent} for more details. + # # An event that is emitted when a response finishes as incomplete. # - # @param response [OpenAI::Models::Responses::Response] - # @param type [Symbol, :"response.incomplete"] + # @param response [OpenAI::Models::Responses::Response] The response that was incomplete. ... + # + # @param type [Symbol, :"response.incomplete"] The type of the event. Always `response.incomplete`. ... end end end diff --git a/lib/openai/models/responses/response_input_audio.rb b/lib/openai/models/responses/response_input_audio.rb index f03f775a..ea23bdcd 100644 --- a/lib/openai/models/responses/response_input_audio.rb +++ b/lib/openai/models/responses/response_input_audio.rb @@ -23,11 +23,16 @@ class ResponseInputAudio < OpenAI::Internal::Type::BaseModel required :type, const: :input_audio # @!method initialize(data:, format_:, type: :input_audio) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputAudio} for more details. + # # An audio input to the model. # - # @param data [String] - # @param format_ [Symbol, OpenAI::Models::Responses::ResponseInputAudio::Format] - # @param type [Symbol, :input_audio] + # @param data [String] Base64-encoded audio data. ... + # + # @param format_ [Symbol, OpenAI::Models::Responses::ResponseInputAudio::Format] The format of the audio data. Currently supported formats are `mp3` and ... + # + # @param type [Symbol, :input_audio] The type of the input item. Always `input_audio`. ... # The format of the audio data. Currently supported formats are `mp3` and `wav`. # diff --git a/lib/openai/models/responses/response_input_file.rb b/lib/openai/models/responses/response_input_file.rb index 13aeefd9..06938134 100644 --- a/lib/openai/models/responses/response_input_file.rb +++ b/lib/openai/models/responses/response_input_file.rb @@ -29,12 +29,18 @@ class ResponseInputFile < OpenAI::Internal::Type::BaseModel optional :filename, String # @!method initialize(file_data: nil, file_id: nil, filename: nil, type: :input_file) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputFile} for more details. + # # A file input to the model. # - # @param file_data [String] - # @param file_id [String] - # @param filename [String] - # @param type [Symbol, :input_file] + # @param file_data [String] The content of the file to be sent to the model. ... + # + # @param file_id [String] The ID of the file to be sent to the model. ... + # + # @param filename [String] The name of the file to be sent to the model. ... + # + # @param type [Symbol, :input_file] The type of the input item. Always `input_file`. ... end end end diff --git a/lib/openai/models/responses/response_input_image.rb b/lib/openai/models/responses/response_input_image.rb index 6a07ce69..997851c2 100644 --- a/lib/openai/models/responses/response_input_image.rb +++ b/lib/openai/models/responses/response_input_image.rb @@ -31,13 +31,19 @@ class ResponseInputImage < OpenAI::Internal::Type::BaseModel optional :image_url, String, nil?: true # @!method initialize(detail:, file_id: nil, image_url: nil, type: :input_image) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputImage} for more details. + # # An image input to the model. Learn about # [image inputs](https://platform.openai.com/docs/guides/vision). # - # @param detail [Symbol, OpenAI::Models::Responses::ResponseInputImage::Detail] - # @param file_id [String, nil] - # @param image_url [String, nil] - # @param type [Symbol, :input_image] + # @param detail [Symbol, OpenAI::Models::Responses::ResponseInputImage::Detail] The detail level of the image to be sent to the model. One of `high`, ... + # + # @param file_id [String, nil] The ID of the file to be sent to the model. ... + # + # @param image_url [String, nil] The URL of the image to be sent to the model. A fully qualified URL or ... + # + # @param type [Symbol, :input_image] The type of the input item. Always `input_image`. ... # The detail level of the image to be sent to the model. One of `high`, `low`, or # `auto`. Defaults to `auto`. diff --git a/lib/openai/models/responses/response_input_item.rb b/lib/openai/models/responses/response_input_item.rb index 72801ab7..29e533f3 100644 --- a/lib/openai/models/responses/response_input_item.rb +++ b/lib/openai/models/responses/response_input_item.rb @@ -86,14 +86,20 @@ class Message < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::Responses::ResponseInputItem::Message::Type } # @!method initialize(content:, role:, status: nil, type: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputItem::Message} for more details. + # # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take # precedence over instructions given with the `user` role. # - # @param content [Array] - # @param role [Symbol, OpenAI::Models::Responses::ResponseInputItem::Message::Role] - # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::Message::Status] - # @param type [Symbol, OpenAI::Models::Responses::ResponseInputItem::Message::Type] + # @param content [Array] A list of one or many input items to the model, containing different content ... + # + # @param role [Symbol, OpenAI::Models::Responses::ResponseInputItem::Message::Role] The role of the message input. One of `user`, `system`, or `developer`. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::Message::Status] The status of item. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, OpenAI::Models::Responses::ResponseInputItem::Message::Type] The type of the message input. Always set to `message`. ... # The role of the message input. One of `user`, `system`, or `developer`. # @@ -178,14 +184,23 @@ class ComputerCallOutput < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::Status } # @!method initialize(call_id:, output:, id: nil, acknowledged_safety_checks: nil, status: nil, type: :computer_call_output) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput} for more + # details. + # # The output of a computer tool call. # - # @param call_id [String] - # @param output [OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot] - # @param id [String] - # @param acknowledged_safety_checks [Array] - # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::Status] - # @param type [Symbol, :computer_call_output] + # @param call_id [String] The ID of the computer tool call that produced the output. ... + # + # @param output [OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot] A computer screenshot image used with the computer use tool. ... + # + # @param id [String] The ID of the computer tool call output. ... + # + # @param acknowledged_safety_checks [Array] The safety checks reported by the API that have been acknowledged by the ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::Status] The status of the message input. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, :computer_call_output] The type of the computer tool call output. Always `computer_call_output`. ... class AcknowledgedSafetyCheck < OpenAI::Internal::Type::BaseModel # @!attribute id @@ -209,9 +224,11 @@ class AcknowledgedSafetyCheck < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, code:, message:) # A pending safety check for the computer call. # - # @param id [String] - # @param code [String] - # @param message [String] + # @param id [String] The ID of the pending safety check. + # + # @param code [String] The type of the pending safety check. + # + # @param message [String] Details about the pending safety check. end # The status of the message input. One of `in_progress`, `completed`, or @@ -264,13 +281,21 @@ class FunctionCallOutput < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput::Status } # @!method initialize(call_id:, output:, id: nil, status: nil, type: :function_call_output) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput} for more + # details. + # # The output of a function tool call. # - # @param call_id [String] - # @param output [String] - # @param id [String] - # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput::Status] - # @param type [Symbol, :function_call_output] + # @param call_id [String] The unique ID of the function tool call generated by the model. ... + # + # @param output [String] A JSON string of the output of the function tool call. ... + # + # @param id [String] The unique ID of the function tool call output. Populated when this item ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput::Status] The status of the item. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, :function_call_output] The type of the function tool call output. Always `function_call_output`. ... # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. @@ -302,10 +327,14 @@ class ItemReference < OpenAI::Internal::Type::BaseModel required :type, const: :item_reference # @!method initialize(id:, type: :item_reference) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputItem::ItemReference} for more details. + # # An internal identifier for an item to reference. # - # @param id [String] - # @param type [Symbol, :item_reference] + # @param id [String] The ID of the item to reference. ... + # + # @param type [Symbol, :item_reference] The type of item to reference. Always `item_reference`. ... end # @!method self.variants diff --git a/lib/openai/models/responses/response_input_message_item.rb b/lib/openai/models/responses/response_input_message_item.rb index 2b7b1ab1..f188d81c 100644 --- a/lib/openai/models/responses/response_input_message_item.rb +++ b/lib/openai/models/responses/response_input_message_item.rb @@ -38,11 +38,18 @@ class ResponseInputMessageItem < OpenAI::Internal::Type::BaseModel optional :type, enum: -> { OpenAI::Models::Responses::ResponseInputMessageItem::Type } # @!method initialize(id:, content:, role:, status: nil, type: nil) - # @param id [String] - # @param content [Array] - # @param role [Symbol, OpenAI::Models::Responses::ResponseInputMessageItem::Role] - # @param status [Symbol, OpenAI::Models::Responses::ResponseInputMessageItem::Status] - # @param type [Symbol, OpenAI::Models::Responses::ResponseInputMessageItem::Type] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputMessageItem} for more details. + # + # @param id [String] The unique ID of the message input. ... + # + # @param content [Array] A list of one or many input items to the model, containing different content ... + # + # @param role [Symbol, OpenAI::Models::Responses::ResponseInputMessageItem::Role] The role of the message input. One of `user`, `system`, or `developer`. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseInputMessageItem::Status] The status of item. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, OpenAI::Models::Responses::ResponseInputMessageItem::Type] The type of the message input. Always set to `message`. ... # The role of the message input. One of `user`, `system`, or `developer`. # diff --git a/lib/openai/models/responses/response_input_text.rb b/lib/openai/models/responses/response_input_text.rb index ad65b3f2..c05e5a54 100644 --- a/lib/openai/models/responses/response_input_text.rb +++ b/lib/openai/models/responses/response_input_text.rb @@ -17,10 +17,14 @@ class ResponseInputText < OpenAI::Internal::Type::BaseModel required :type, const: :input_text # @!method initialize(text:, type: :input_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseInputText} for more details. + # # A text input to the model. # - # @param text [String] - # @param type [Symbol, :input_text] + # @param text [String] The text input to the model. ... + # + # @param type [Symbol, :input_text] The type of the input item. Always `input_text`. ... end end end diff --git a/lib/openai/models/responses/response_item_list.rb b/lib/openai/models/responses/response_item_list.rb index 2b6c1e85..06e55c53 100644 --- a/lib/openai/models/responses/response_item_list.rb +++ b/lib/openai/models/responses/response_item_list.rb @@ -37,11 +37,15 @@ class ResponseItemList < OpenAI::Internal::Type::BaseModel # @!method initialize(data:, first_id:, has_more:, last_id:, object: :list) # A list of Response items. # - # @param data [Array] - # @param first_id [String] - # @param has_more [Boolean] - # @param last_id [String] - # @param object [Symbol, :list] + # @param data [Array] A list of items used to generate this response. + # + # @param first_id [String] The ID of the first item in the list. + # + # @param has_more [Boolean] Whether there are more items available. + # + # @param last_id [String] The ID of the last item in the list. + # + # @param object [Symbol, :list] The type of object returned, must be `list`. end end diff --git a/lib/openai/models/responses/response_output_audio.rb b/lib/openai/models/responses/response_output_audio.rb index 55675501..f66f4024 100644 --- a/lib/openai/models/responses/response_output_audio.rb +++ b/lib/openai/models/responses/response_output_audio.rb @@ -23,11 +23,16 @@ class ResponseOutputAudio < OpenAI::Internal::Type::BaseModel required :type, const: :output_audio # @!method initialize(data:, transcript:, type: :output_audio) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputAudio} for more details. + # # An audio output from the model. # - # @param data [String] - # @param transcript [String] - # @param type [Symbol, :output_audio] + # @param data [String] Base64-encoded audio data from the model. ... + # + # @param transcript [String] The transcript of the audio data from the model. ... + # + # @param type [Symbol, :output_audio] The type of the output audio. Always `output_audio`. ... end end end diff --git a/lib/openai/models/responses/response_output_item_added_event.rb b/lib/openai/models/responses/response_output_item_added_event.rb index 2893bec8..3a42485d 100644 --- a/lib/openai/models/responses/response_output_item_added_event.rb +++ b/lib/openai/models/responses/response_output_item_added_event.rb @@ -23,11 +23,16 @@ class ResponseOutputItemAddedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.output_item.added" # @!method initialize(item:, output_index:, type: :"response.output_item.added") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputItemAddedEvent} for more details. + # # Emitted when a new output item is added. # - # @param item [OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseReasoningItem] - # @param output_index [Integer] - # @param type [Symbol, :"response.output_item.added"] + # @param item [OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseReasoningItem] The output item that was added. ... + # + # @param output_index [Integer] The index of the output item that was added. ... + # + # @param type [Symbol, :"response.output_item.added"] The type of the event. Always `response.output_item.added`. ... end end end diff --git a/lib/openai/models/responses/response_output_item_done_event.rb b/lib/openai/models/responses/response_output_item_done_event.rb index a8ff9471..d3bfbfc3 100644 --- a/lib/openai/models/responses/response_output_item_done_event.rb +++ b/lib/openai/models/responses/response_output_item_done_event.rb @@ -23,11 +23,16 @@ class ResponseOutputItemDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.output_item.done" # @!method initialize(item:, output_index:, type: :"response.output_item.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputItemDoneEvent} for more details. + # # Emitted when an output item is marked done. # - # @param item [OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseReasoningItem] - # @param output_index [Integer] - # @param type [Symbol, :"response.output_item.done"] + # @param item [OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseReasoningItem] The output item that was marked done. ... + # + # @param output_index [Integer] The index of the output item that was marked done. ... + # + # @param type [Symbol, :"response.output_item.done"] The type of the event. Always `response.output_item.done`. ... end end end diff --git a/lib/openai/models/responses/response_output_message.rb b/lib/openai/models/responses/response_output_message.rb index 107a4798..2406dc01 100644 --- a/lib/openai/models/responses/response_output_message.rb +++ b/lib/openai/models/responses/response_output_message.rb @@ -37,13 +37,20 @@ class ResponseOutputMessage < OpenAI::Internal::Type::BaseModel required :type, const: :message # @!method initialize(id:, content:, status:, role: :assistant, type: :message) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputMessage} for more details. + # # An output message from the model. # - # @param id [String] - # @param content [Array] - # @param status [Symbol, OpenAI::Models::Responses::ResponseOutputMessage::Status] - # @param role [Symbol, :assistant] - # @param type [Symbol, :message] + # @param id [String] The unique ID of the output message. ... + # + # @param content [Array] The content of the output message. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseOutputMessage::Status] The status of the message input. One of `in_progress`, `completed`, or ... + # + # @param role [Symbol, :assistant] The role of the output message. Always `assistant`. ... + # + # @param type [Symbol, :message] The type of the output message. Always `message`. ... # A text output from the model. module Content diff --git a/lib/openai/models/responses/response_output_refusal.rb b/lib/openai/models/responses/response_output_refusal.rb index 0c2ccce2..82729b85 100644 --- a/lib/openai/models/responses/response_output_refusal.rb +++ b/lib/openai/models/responses/response_output_refusal.rb @@ -17,10 +17,14 @@ class ResponseOutputRefusal < OpenAI::Internal::Type::BaseModel required :type, const: :refusal # @!method initialize(refusal:, type: :refusal) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputRefusal} for more details. + # # A refusal from the model. # - # @param refusal [String] - # @param type [Symbol, :refusal] + # @param refusal [String] The refusal explanationfrom the model. ... + # + # @param type [Symbol, :refusal] The type of the refusal. Always `refusal`. ... end end end diff --git a/lib/openai/models/responses/response_output_text.rb b/lib/openai/models/responses/response_output_text.rb index a857410f..32465ac6 100644 --- a/lib/openai/models/responses/response_output_text.rb +++ b/lib/openai/models/responses/response_output_text.rb @@ -24,11 +24,16 @@ class ResponseOutputText < OpenAI::Internal::Type::BaseModel required :type, const: :output_text # @!method initialize(annotations:, text:, type: :output_text) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputText} for more details. + # # A text output from the model. # - # @param annotations [Array] - # @param text [String] - # @param type [Symbol, :output_text] + # @param annotations [Array] The annotations of the text output. ... + # + # @param text [String] The text output from the model. ... + # + # @param type [Symbol, :output_text] The type of the output text. Always `output_text`. ... # A citation to a file. module Annotation @@ -65,11 +70,17 @@ class FileCitation < OpenAI::Internal::Type::BaseModel required :type, const: :file_citation # @!method initialize(file_id:, index:, type: :file_citation) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputText::Annotation::FileCitation} for + # more details. + # # A citation to a file. # - # @param file_id [String] - # @param index [Integer] - # @param type [Symbol, :file_citation] + # @param file_id [String] The ID of the file. ... + # + # @param index [Integer] The index of the file in the list of files. ... + # + # @param type [Symbol, :file_citation] The type of the file citation. Always `file_citation`. ... end class URLCitation < OpenAI::Internal::Type::BaseModel @@ -104,13 +115,21 @@ class URLCitation < OpenAI::Internal::Type::BaseModel required :url, String # @!method initialize(end_index:, start_index:, title:, url:, type: :url_citation) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputText::Annotation::URLCitation} for + # more details. + # # A citation for a web resource used to generate a model response. # - # @param end_index [Integer] - # @param start_index [Integer] - # @param title [String] - # @param url [String] - # @param type [Symbol, :url_citation] + # @param end_index [Integer] The index of the last character of the URL citation in the message. ... + # + # @param start_index [Integer] The index of the first character of the URL citation in the message. ... + # + # @param title [String] The title of the web resource. ... + # + # @param url [String] The URL of the web resource. ... + # + # @param type [Symbol, :url_citation] The type of the URL citation. Always `url_citation`. ... end class FilePath < OpenAI::Internal::Type::BaseModel @@ -133,11 +152,17 @@ class FilePath < OpenAI::Internal::Type::BaseModel required :type, const: :file_path # @!method initialize(file_id:, index:, type: :file_path) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseOutputText::Annotation::FilePath} for more + # details. + # # A path to a file. # - # @param file_id [String] - # @param index [Integer] - # @param type [Symbol, :file_path] + # @param file_id [String] The ID of the file. ... + # + # @param index [Integer] The index of the file in the list of files. ... + # + # @param type [Symbol, :file_path] The type of the file path. Always `file_path`. ... end # @!method self.variants diff --git a/lib/openai/models/responses/response_reasoning_item.rb b/lib/openai/models/responses/response_reasoning_item.rb index bec6c280..a09ba35b 100644 --- a/lib/openai/models/responses/response_reasoning_item.rb +++ b/lib/openai/models/responses/response_reasoning_item.rb @@ -31,13 +31,19 @@ class ResponseReasoningItem < OpenAI::Internal::Type::BaseModel optional :status, enum: -> { OpenAI::Models::Responses::ResponseReasoningItem::Status } # @!method initialize(id:, summary:, status: nil, type: :reasoning) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseReasoningItem} for more details. + # # A description of the chain of thought used by a reasoning model while generating # a response. # - # @param id [String] - # @param summary [Array] - # @param status [Symbol, OpenAI::Models::Responses::ResponseReasoningItem::Status] - # @param type [Symbol, :reasoning] + # @param id [String] The unique identifier of the reasoning content. ... + # + # @param summary [Array] Reasoning text contents. ... + # + # @param status [Symbol, OpenAI::Models::Responses::ResponseReasoningItem::Status] The status of the item. One of `in_progress`, `completed`, or ... + # + # @param type [Symbol, :reasoning] The type of the object. Always `reasoning`. ... class Summary < OpenAI::Internal::Type::BaseModel # @!attribute text @@ -53,8 +59,12 @@ class Summary < OpenAI::Internal::Type::BaseModel required :type, const: :summary_text # @!method initialize(text:, type: :summary_text) - # @param text [String] - # @param type [Symbol, :summary_text] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseReasoningItem::Summary} for more details. + # + # @param text [String] A short summary of the reasoning used by the model when generating ... + # + # @param type [Symbol, :summary_text] The type of the object. Always `summary_text`. ... end # The status of the item. One of `in_progress`, `completed`, or `incomplete`. diff --git a/lib/openai/models/responses/response_reasoning_summary_part_added_event.rb b/lib/openai/models/responses/response_reasoning_summary_part_added_event.rb index a7f42ec3..74d66131 100644 --- a/lib/openai/models/responses/response_reasoning_summary_part_added_event.rb +++ b/lib/openai/models/responses/response_reasoning_summary_part_added_event.rb @@ -35,13 +35,21 @@ class ResponseReasoningSummaryPartAddedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.reasoning_summary_part.added" # @!method initialize(item_id:, output_index:, part:, summary_index:, type: :"response.reasoning_summary_part.added") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent} for more + # details. + # # Emitted when a new reasoning summary part is added. # - # @param item_id [String] - # @param output_index [Integer] - # @param part [OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part] - # @param summary_index [Integer] - # @param type [Symbol, :"response.reasoning_summary_part.added"] + # @param item_id [String] The ID of the item this summary part is associated with. ... + # + # @param output_index [Integer] The index of the output item this summary part is associated with. ... + # + # @param part [OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent::Part] The summary part that was added. ... + # + # @param summary_index [Integer] The index of the summary part within the reasoning summary. ... + # + # @param type [Symbol, :"response.reasoning_summary_part.added"] The type of the event. Always `response.reasoning_summary_part.added`. ... # @see OpenAI::Models::Responses::ResponseReasoningSummaryPartAddedEvent#part class Part < OpenAI::Internal::Type::BaseModel @@ -60,8 +68,9 @@ class Part < OpenAI::Internal::Type::BaseModel # @!method initialize(text:, type: :summary_text) # The summary part that was added. # - # @param text [String] - # @param type [Symbol, :summary_text] + # @param text [String] The text of the summary part. + # + # @param type [Symbol, :summary_text] The type of the summary part. Always `summary_text`. end end end diff --git a/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb b/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb index c868638f..10926c74 100644 --- a/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb +++ b/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb @@ -35,13 +35,21 @@ class ResponseReasoningSummaryPartDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.reasoning_summary_part.done" # @!method initialize(item_id:, output_index:, part:, summary_index:, type: :"response.reasoning_summary_part.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent} for more + # details. + # # Emitted when a reasoning summary part is completed. # - # @param item_id [String] - # @param output_index [Integer] - # @param part [OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part] - # @param summary_index [Integer] - # @param type [Symbol, :"response.reasoning_summary_part.done"] + # @param item_id [String] The ID of the item this summary part is associated with. ... + # + # @param output_index [Integer] The index of the output item this summary part is associated with. ... + # + # @param part [OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent::Part] The completed summary part. ... + # + # @param summary_index [Integer] The index of the summary part within the reasoning summary. ... + # + # @param type [Symbol, :"response.reasoning_summary_part.done"] The type of the event. Always `response.reasoning_summary_part.done`. ... # @see OpenAI::Models::Responses::ResponseReasoningSummaryPartDoneEvent#part class Part < OpenAI::Internal::Type::BaseModel @@ -60,8 +68,9 @@ class Part < OpenAI::Internal::Type::BaseModel # @!method initialize(text:, type: :summary_text) # The completed summary part. # - # @param text [String] - # @param type [Symbol, :summary_text] + # @param text [String] The text of the summary part. + # + # @param type [Symbol, :summary_text] The type of the summary part. Always `summary_text`. end end end diff --git a/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb b/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb index d816e961..b56b3b80 100644 --- a/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb +++ b/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rb @@ -35,13 +35,21 @@ class ResponseReasoningSummaryTextDeltaEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.reasoning_summary_text.delta" # @!method initialize(delta:, item_id:, output_index:, summary_index:, type: :"response.reasoning_summary_text.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseReasoningSummaryTextDeltaEvent} for more + # details. + # # Emitted when a delta is added to a reasoning summary text. # - # @param delta [String] - # @param item_id [String] - # @param output_index [Integer] - # @param summary_index [Integer] - # @param type [Symbol, :"response.reasoning_summary_text.delta"] + # @param delta [String] The text delta that was added to the summary. ... + # + # @param item_id [String] The ID of the item this summary text delta is associated with. ... + # + # @param output_index [Integer] The index of the output item this summary text delta is associated with. ... + # + # @param summary_index [Integer] The index of the summary part within the reasoning summary. ... + # + # @param type [Symbol, :"response.reasoning_summary_text.delta"] The type of the event. Always `response.reasoning_summary_text.delta`. ... end end end diff --git a/lib/openai/models/responses/response_reasoning_summary_text_done_event.rb b/lib/openai/models/responses/response_reasoning_summary_text_done_event.rb index 93e8cadc..cd78cdba 100644 --- a/lib/openai/models/responses/response_reasoning_summary_text_done_event.rb +++ b/lib/openai/models/responses/response_reasoning_summary_text_done_event.rb @@ -35,13 +35,21 @@ class ResponseReasoningSummaryTextDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.reasoning_summary_text.done" # @!method initialize(item_id:, output_index:, summary_index:, text:, type: :"response.reasoning_summary_text.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseReasoningSummaryTextDoneEvent} for more + # details. + # # Emitted when a reasoning summary text is completed. # - # @param item_id [String] - # @param output_index [Integer] - # @param summary_index [Integer] - # @param text [String] - # @param type [Symbol, :"response.reasoning_summary_text.done"] + # @param item_id [String] The ID of the item this summary text is associated with. ... + # + # @param output_index [Integer] The index of the output item this summary text is associated with. ... + # + # @param summary_index [Integer] The index of the summary part within the reasoning summary. ... + # + # @param text [String] The full text of the completed reasoning summary. ... + # + # @param type [Symbol, :"response.reasoning_summary_text.done"] The type of the event. Always `response.reasoning_summary_text.done`. ... end end end diff --git a/lib/openai/models/responses/response_refusal_delta_event.rb b/lib/openai/models/responses/response_refusal_delta_event.rb index ea97e622..fb8d6770 100644 --- a/lib/openai/models/responses/response_refusal_delta_event.rb +++ b/lib/openai/models/responses/response_refusal_delta_event.rb @@ -35,13 +35,20 @@ class ResponseRefusalDeltaEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.refusal.delta" # @!method initialize(content_index:, delta:, item_id:, output_index:, type: :"response.refusal.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseRefusalDeltaEvent} for more details. + # # Emitted when there is a partial refusal text. # - # @param content_index [Integer] - # @param delta [String] - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.refusal.delta"] + # @param content_index [Integer] The index of the content part that the refusal text is added to. ... + # + # @param delta [String] The refusal text that is added. ... + # + # @param item_id [String] The ID of the output item that the refusal text is added to. ... + # + # @param output_index [Integer] The index of the output item that the refusal text is added to. ... + # + # @param type [Symbol, :"response.refusal.delta"] The type of the event. Always `response.refusal.delta`. ... end end end diff --git a/lib/openai/models/responses/response_refusal_done_event.rb b/lib/openai/models/responses/response_refusal_done_event.rb index ee7b4b55..a361e8b3 100644 --- a/lib/openai/models/responses/response_refusal_done_event.rb +++ b/lib/openai/models/responses/response_refusal_done_event.rb @@ -35,13 +35,20 @@ class ResponseRefusalDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.refusal.done" # @!method initialize(content_index:, item_id:, output_index:, refusal:, type: :"response.refusal.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseRefusalDoneEvent} for more details. + # # Emitted when refusal text is finalized. # - # @param content_index [Integer] - # @param item_id [String] - # @param output_index [Integer] - # @param refusal [String] - # @param type [Symbol, :"response.refusal.done"] + # @param content_index [Integer] The index of the content part that the refusal text is finalized. ... + # + # @param item_id [String] The ID of the output item that the refusal text is finalized. ... + # + # @param output_index [Integer] The index of the output item that the refusal text is finalized. ... + # + # @param refusal [String] The refusal text that is finalized. ... + # + # @param type [Symbol, :"response.refusal.done"] The type of the event. Always `response.refusal.done`. ... end end end diff --git a/lib/openai/models/responses/response_retrieve_params.rb b/lib/openai/models/responses/response_retrieve_params.rb index bb881916..e4b242f8 100644 --- a/lib/openai/models/responses/response_retrieve_params.rb +++ b/lib/openai/models/responses/response_retrieve_params.rb @@ -17,7 +17,11 @@ class ResponseRetrieveParams < OpenAI::Internal::Type::BaseModel -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Models::Responses::ResponseIncludable] } # @!method initialize(include: nil, request_options: {}) - # @param include [Array] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseRetrieveParams} for more details. + # + # @param include [Array] Additional fields to include in the response. See the `include` ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/responses/response_text_annotation_delta_event.rb b/lib/openai/models/responses/response_text_annotation_delta_event.rb index 28c8abee..063252da 100644 --- a/lib/openai/models/responses/response_text_annotation_delta_event.rb +++ b/lib/openai/models/responses/response_text_annotation_delta_event.rb @@ -42,14 +42,22 @@ class ResponseTextAnnotationDeltaEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.output_text.annotation.added" # @!method initialize(annotation:, annotation_index:, content_index:, item_id:, output_index:, type: :"response.output_text.annotation.added") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent} for more details. + # # Emitted when a text annotation is added. # - # @param annotation [OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FileCitation, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::URLCitation, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FilePath] - # @param annotation_index [Integer] - # @param content_index [Integer] - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.output_text.annotation.added"] + # @param annotation [OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FileCitation, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::URLCitation, OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FilePath] A citation to a file. ... + # + # @param annotation_index [Integer] The index of the annotation that was added. ... + # + # @param content_index [Integer] The index of the content part that the text annotation was added to. ... + # + # @param item_id [String] The ID of the output item that the text annotation was added to. ... + # + # @param output_index [Integer] The index of the output item that the text annotation was added to. ... + # + # @param type [Symbol, :"response.output_text.annotation.added"] The type of the event. Always `response.output_text.annotation.added`. ... # A citation to a file. # @@ -91,11 +99,17 @@ class FileCitation < OpenAI::Internal::Type::BaseModel required :type, const: :file_citation # @!method initialize(file_id:, index:, type: :file_citation) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FileCitation} + # for more details. + # # A citation to a file. # - # @param file_id [String] - # @param index [Integer] - # @param type [Symbol, :file_citation] + # @param file_id [String] The ID of the file. ... + # + # @param index [Integer] The index of the file in the list of files. ... + # + # @param type [Symbol, :file_citation] The type of the file citation. Always `file_citation`. ... end class URLCitation < OpenAI::Internal::Type::BaseModel @@ -130,13 +144,21 @@ class URLCitation < OpenAI::Internal::Type::BaseModel required :url, String # @!method initialize(end_index:, start_index:, title:, url:, type: :url_citation) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::URLCitation} + # for more details. + # # A citation for a web resource used to generate a model response. # - # @param end_index [Integer] - # @param start_index [Integer] - # @param title [String] - # @param url [String] - # @param type [Symbol, :url_citation] + # @param end_index [Integer] The index of the last character of the URL citation in the message. ... + # + # @param start_index [Integer] The index of the first character of the URL citation in the message. ... + # + # @param title [String] The title of the web resource. ... + # + # @param url [String] The URL of the web resource. ... + # + # @param type [Symbol, :url_citation] The type of the URL citation. Always `url_citation`. ... end class FilePath < OpenAI::Internal::Type::BaseModel @@ -159,11 +181,17 @@ class FilePath < OpenAI::Internal::Type::BaseModel required :type, const: :file_path # @!method initialize(file_id:, index:, type: :file_path) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FilePath} + # for more details. + # # A path to a file. # - # @param file_id [String] - # @param index [Integer] - # @param type [Symbol, :file_path] + # @param file_id [String] The ID of the file. ... + # + # @param index [Integer] The index of the file in the list of files. ... + # + # @param type [Symbol, :file_path] The type of the file path. Always `file_path`. ... end # @!method self.variants diff --git a/lib/openai/models/responses/response_text_config.rb b/lib/openai/models/responses/response_text_config.rb index 05e2d3db..a67c6449 100644 --- a/lib/openai/models/responses/response_text_config.rb +++ b/lib/openai/models/responses/response_text_config.rb @@ -23,13 +23,16 @@ class ResponseTextConfig < OpenAI::Internal::Type::BaseModel optional :format_, union: -> { OpenAI::Models::Responses::ResponseFormatTextConfig }, api_name: :format # @!method initialize(format_: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseTextConfig} for more details. + # # Configuration options for a text response from the model. Can be plain text or # structured JSON data. Learn more: # # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) # - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) # - # @param format_ [OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig, OpenAI::Models::ResponseFormatJSONObject] + # @param format_ [OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig, OpenAI::Models::ResponseFormatJSONObject] An object specifying the format that the model must output. ... end end end diff --git a/lib/openai/models/responses/response_text_delta_event.rb b/lib/openai/models/responses/response_text_delta_event.rb index 9f7744b8..fce5e269 100644 --- a/lib/openai/models/responses/response_text_delta_event.rb +++ b/lib/openai/models/responses/response_text_delta_event.rb @@ -35,13 +35,20 @@ class ResponseTextDeltaEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.output_text.delta" # @!method initialize(content_index:, delta:, item_id:, output_index:, type: :"response.output_text.delta") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseTextDeltaEvent} for more details. + # # Emitted when there is an additional text delta. # - # @param content_index [Integer] - # @param delta [String] - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.output_text.delta"] + # @param content_index [Integer] The index of the content part that the text delta was added to. ... + # + # @param delta [String] The text delta that was added. ... + # + # @param item_id [String] The ID of the output item that the text delta was added to. ... + # + # @param output_index [Integer] The index of the output item that the text delta was added to. ... + # + # @param type [Symbol, :"response.output_text.delta"] The type of the event. Always `response.output_text.delta`. ... end end end diff --git a/lib/openai/models/responses/response_text_done_event.rb b/lib/openai/models/responses/response_text_done_event.rb index cea42efc..15bd9abc 100644 --- a/lib/openai/models/responses/response_text_done_event.rb +++ b/lib/openai/models/responses/response_text_done_event.rb @@ -35,13 +35,20 @@ class ResponseTextDoneEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.output_text.done" # @!method initialize(content_index:, item_id:, output_index:, text:, type: :"response.output_text.done") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseTextDoneEvent} for more details. + # # Emitted when text content is finalized. # - # @param content_index [Integer] - # @param item_id [String] - # @param output_index [Integer] - # @param text [String] - # @param type [Symbol, :"response.output_text.done"] + # @param content_index [Integer] The index of the content part that the text content is finalized. ... + # + # @param item_id [String] The ID of the output item that the text content is finalized. ... + # + # @param output_index [Integer] The index of the output item that the text content is finalized. ... + # + # @param text [String] The text content that is finalized. ... + # + # @param type [Symbol, :"response.output_text.done"] The type of the event. Always `response.output_text.done`. ... end end end diff --git a/lib/openai/models/responses/response_usage.rb b/lib/openai/models/responses/response_usage.rb index f8a7799f..93b1917a 100644 --- a/lib/openai/models/responses/response_usage.rb +++ b/lib/openai/models/responses/response_usage.rb @@ -38,11 +38,15 @@ class ResponseUsage < OpenAI::Internal::Type::BaseModel # Represents token usage details including input tokens, output tokens, a # breakdown of output tokens, and the total tokens used. # - # @param input_tokens [Integer] - # @param input_tokens_details [OpenAI::Models::Responses::ResponseUsage::InputTokensDetails] - # @param output_tokens [Integer] - # @param output_tokens_details [OpenAI::Models::Responses::ResponseUsage::OutputTokensDetails] - # @param total_tokens [Integer] + # @param input_tokens [Integer] The number of input tokens. + # + # @param input_tokens_details [OpenAI::Models::Responses::ResponseUsage::InputTokensDetails] A detailed breakdown of the input tokens. + # + # @param output_tokens [Integer] The number of output tokens. + # + # @param output_tokens_details [OpenAI::Models::Responses::ResponseUsage::OutputTokensDetails] A detailed breakdown of the output tokens. + # + # @param total_tokens [Integer] The total number of tokens used. # @see OpenAI::Models::Responses::ResponseUsage#input_tokens_details class InputTokensDetails < OpenAI::Internal::Type::BaseModel @@ -54,9 +58,12 @@ class InputTokensDetails < OpenAI::Internal::Type::BaseModel required :cached_tokens, Integer # @!method initialize(cached_tokens:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseUsage::InputTokensDetails} for more details. + # # A detailed breakdown of the input tokens. # - # @param cached_tokens [Integer] + # @param cached_tokens [Integer] The number of tokens that were retrieved from the cache. ... end # @see OpenAI::Models::Responses::ResponseUsage#output_tokens_details @@ -70,7 +77,7 @@ class OutputTokensDetails < OpenAI::Internal::Type::BaseModel # @!method initialize(reasoning_tokens:) # A detailed breakdown of the output tokens. # - # @param reasoning_tokens [Integer] + # @param reasoning_tokens [Integer] The number of reasoning tokens. end end end diff --git a/lib/openai/models/responses/response_web_search_call_completed_event.rb b/lib/openai/models/responses/response_web_search_call_completed_event.rb index 59cdab36..5a94a581 100644 --- a/lib/openai/models/responses/response_web_search_call_completed_event.rb +++ b/lib/openai/models/responses/response_web_search_call_completed_event.rb @@ -23,11 +23,17 @@ class ResponseWebSearchCallCompletedEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.web_search_call.completed" # @!method initialize(item_id:, output_index:, type: :"response.web_search_call.completed") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseWebSearchCallCompletedEvent} for more + # details. + # # Emitted when a web search call is completed. # - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.web_search_call.completed"] + # @param item_id [String] Unique ID for the output item associated with the web search call. ... + # + # @param output_index [Integer] The index of the output item that the web search call is associated with. ... + # + # @param type [Symbol, :"response.web_search_call.completed"] The type of the event. Always `response.web_search_call.completed`. ... end end end diff --git a/lib/openai/models/responses/response_web_search_call_in_progress_event.rb b/lib/openai/models/responses/response_web_search_call_in_progress_event.rb index 6820c819..2c2c18c0 100644 --- a/lib/openai/models/responses/response_web_search_call_in_progress_event.rb +++ b/lib/openai/models/responses/response_web_search_call_in_progress_event.rb @@ -23,11 +23,17 @@ class ResponseWebSearchCallInProgressEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.web_search_call.in_progress" # @!method initialize(item_id:, output_index:, type: :"response.web_search_call.in_progress") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseWebSearchCallInProgressEvent} for more + # details. + # # Emitted when a web search call is initiated. # - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.web_search_call.in_progress"] + # @param item_id [String] Unique ID for the output item associated with the web search call. ... + # + # @param output_index [Integer] The index of the output item that the web search call is associated with. ... + # + # @param type [Symbol, :"response.web_search_call.in_progress"] The type of the event. Always `response.web_search_call.in_progress`. ... end end end diff --git a/lib/openai/models/responses/response_web_search_call_searching_event.rb b/lib/openai/models/responses/response_web_search_call_searching_event.rb index efa04758..c23044cb 100644 --- a/lib/openai/models/responses/response_web_search_call_searching_event.rb +++ b/lib/openai/models/responses/response_web_search_call_searching_event.rb @@ -23,11 +23,17 @@ class ResponseWebSearchCallSearchingEvent < OpenAI::Internal::Type::BaseModel required :type, const: :"response.web_search_call.searching" # @!method initialize(item_id:, output_index:, type: :"response.web_search_call.searching") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseWebSearchCallSearchingEvent} for more + # details. + # # Emitted when a web search call is executing. # - # @param item_id [String] - # @param output_index [Integer] - # @param type [Symbol, :"response.web_search_call.searching"] + # @param item_id [String] Unique ID for the output item associated with the web search call. ... + # + # @param output_index [Integer] The index of the output item that the web search call is associated with. ... + # + # @param type [Symbol, :"response.web_search_call.searching"] The type of the event. Always `response.web_search_call.searching`. ... end end end diff --git a/lib/openai/models/responses/tool_choice_function.rb b/lib/openai/models/responses/tool_choice_function.rb index 47c1d3ef..67f00750 100644 --- a/lib/openai/models/responses/tool_choice_function.rb +++ b/lib/openai/models/responses/tool_choice_function.rb @@ -19,8 +19,9 @@ class ToolChoiceFunction < OpenAI::Internal::Type::BaseModel # @!method initialize(name:, type: :function) # Use this option to force the model to call a specific function. # - # @param name [String] - # @param type [Symbol, :function] + # @param name [String] The name of the function to call. + # + # @param type [Symbol, :function] For function calling, the type is always `function`. end end end diff --git a/lib/openai/models/responses/tool_choice_types.rb b/lib/openai/models/responses/tool_choice_types.rb index e51b376e..6ecec732 100644 --- a/lib/openai/models/responses/tool_choice_types.rb +++ b/lib/openai/models/responses/tool_choice_types.rb @@ -18,10 +18,13 @@ class ToolChoiceTypes < OpenAI::Internal::Type::BaseModel required :type, enum: -> { OpenAI::Models::Responses::ToolChoiceTypes::Type } # @!method initialize(type:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ToolChoiceTypes} for more details. + # # Indicates that the model should use a built-in tool to generate a response. # [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). # - # @param type [Symbol, OpenAI::Models::Responses::ToolChoiceTypes::Type] + # @param type [Symbol, OpenAI::Models::Responses::ToolChoiceTypes::Type] The type of hosted tool the model should to use. Learn more about ... # The type of hosted tool the model should to use. Learn more about # [built-in tools](https://platform.openai.com/docs/guides/tools). diff --git a/lib/openai/models/responses/web_search_tool.rb b/lib/openai/models/responses/web_search_tool.rb index 09522f82..0885c4db 100644 --- a/lib/openai/models/responses/web_search_tool.rb +++ b/lib/openai/models/responses/web_search_tool.rb @@ -26,12 +26,17 @@ class WebSearchTool < OpenAI::Internal::Type::BaseModel optional :user_location, -> { OpenAI::Models::Responses::WebSearchTool::UserLocation }, nil?: true # @!method initialize(type:, search_context_size: nil, user_location: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::WebSearchTool} for more details. + # # This tool searches the web for relevant results to use in a response. Learn more # about the # [web search tool](https://platform.openai.com/docs/guides/tools-web-search). # - # @param type [Symbol, OpenAI::Models::Responses::WebSearchTool::Type] - # @param search_context_size [Symbol, OpenAI::Models::Responses::WebSearchTool::SearchContextSize] + # @param type [Symbol, OpenAI::Models::Responses::WebSearchTool::Type] The type of the web search tool. One of: ... + # + # @param search_context_size [Symbol, OpenAI::Models::Responses::WebSearchTool::SearchContextSize] High level guidance for the amount of context window space to use for the ... + # # @param user_location [OpenAI::Models::Responses::WebSearchTool::UserLocation, nil] # The type of the web search tool. One of: @@ -100,11 +105,18 @@ class UserLocation < OpenAI::Internal::Type::BaseModel optional :timezone, String # @!method initialize(city: nil, country: nil, region: nil, timezone: nil, type: :approximate) - # @param city [String] - # @param country [String] - # @param region [String] - # @param timezone [String] - # @param type [Symbol, :approximate] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::WebSearchTool::UserLocation} for more details. + # + # @param city [String] Free text input for the city of the user, e.g. `San Francisco`. ... + # + # @param country [String] The two-letter ... + # + # @param region [String] Free text input for the region of the user, e.g. `California`. ... + # + # @param timezone [String] The [IANA timezone](https://timeapi.io/documentation/iana-timezones) ... + # + # @param type [Symbol, :approximate] The type of location approximation. Always `approximate`. ... end end end diff --git a/lib/openai/models/static_file_chunking_strategy.rb b/lib/openai/models/static_file_chunking_strategy.rb index c8dc5106..46682393 100644 --- a/lib/openai/models/static_file_chunking_strategy.rb +++ b/lib/openai/models/static_file_chunking_strategy.rb @@ -19,8 +19,14 @@ class StaticFileChunkingStrategy < OpenAI::Internal::Type::BaseModel required :max_chunk_size_tokens, Integer # @!method initialize(chunk_overlap_tokens:, max_chunk_size_tokens:) - # @param chunk_overlap_tokens [Integer] - # @param max_chunk_size_tokens [Integer] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::StaticFileChunkingStrategy} for more details. + # + # @param chunk_overlap_tokens [Integer] The number of tokens that overlap between chunks. The default value is `400`. + # ... + # + # @param max_chunk_size_tokens [Integer] The maximum number of tokens in each chunk. The default value is `800`. The mini + # ... end end end diff --git a/lib/openai/models/static_file_chunking_strategy_object.rb b/lib/openai/models/static_file_chunking_strategy_object.rb index 7da9cb50..68d0d88e 100644 --- a/lib/openai/models/static_file_chunking_strategy_object.rb +++ b/lib/openai/models/static_file_chunking_strategy_object.rb @@ -16,7 +16,8 @@ class StaticFileChunkingStrategyObject < OpenAI::Internal::Type::BaseModel # @!method initialize(static:, type: :static) # @param static [OpenAI::Models::StaticFileChunkingStrategy] - # @param type [Symbol, :static] + # + # @param type [Symbol, :static] Always `static`. end end end diff --git a/lib/openai/models/static_file_chunking_strategy_object_param.rb b/lib/openai/models/static_file_chunking_strategy_object_param.rb index b0d5a5b6..f37c6aa6 100644 --- a/lib/openai/models/static_file_chunking_strategy_object_param.rb +++ b/lib/openai/models/static_file_chunking_strategy_object_param.rb @@ -18,7 +18,8 @@ class StaticFileChunkingStrategyObjectParam < OpenAI::Internal::Type::BaseModel # Customize your own chunking strategy by setting chunk size and chunk overlap. # # @param static [OpenAI::Models::StaticFileChunkingStrategy] - # @param type [Symbol, :static] + # + # @param type [Symbol, :static] Always `static`. end end end diff --git a/lib/openai/models/upload.rb b/lib/openai/models/upload.rb index 53ae0a23..39d5043e 100644 --- a/lib/openai/models/upload.rb +++ b/lib/openai/models/upload.rb @@ -61,17 +61,29 @@ class Upload < OpenAI::Internal::Type::BaseModel optional :file, -> { OpenAI::Models::FileObject }, nil?: true # @!method initialize(id:, bytes:, created_at:, expires_at:, filename:, purpose:, status:, file: nil, object: :upload) + # Some parameter documentations has been truncated, see {OpenAI::Models::Upload} + # for more details. + # # The Upload object can accept byte chunks in the form of Parts. # - # @param id [String] - # @param bytes [Integer] - # @param created_at [Integer] - # @param expires_at [Integer] - # @param filename [String] - # @param purpose [String] - # @param status [Symbol, OpenAI::Models::Upload::Status] - # @param file [OpenAI::Models::FileObject, nil] - # @param object [Symbol, :upload] + # @param id [String] The Upload unique identifier, which can be referenced in API endpoints. + # + # @param bytes [Integer] The intended number of bytes to be uploaded. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the Upload was created. + # + # @param expires_at [Integer] The Unix timestamp (in seconds) for when the Upload will expire. + # + # @param filename [String] The name of the file to be uploaded. + # + # @param purpose [String] The intended purpose of the file. [Please refer here](https://platform.openai.co + # ... + # + # @param status [Symbol, OpenAI::Models::Upload::Status] The status of the Upload. + # + # @param file [OpenAI::Models::FileObject, nil] The `File` object represents a document that has been uploaded to OpenAI. + # + # @param object [Symbol, :upload] The object type, which is always "upload". # The status of the Upload. # diff --git a/lib/openai/models/upload_complete_params.rb b/lib/openai/models/upload_complete_params.rb index b978c7a2..3c898f46 100644 --- a/lib/openai/models/upload_complete_params.rb +++ b/lib/openai/models/upload_complete_params.rb @@ -21,8 +21,14 @@ class UploadCompleteParams < OpenAI::Internal::Type::BaseModel optional :md5, String # @!method initialize(part_ids:, md5: nil, request_options: {}) - # @param part_ids [Array] - # @param md5 [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::UploadCompleteParams} for more details. + # + # @param part_ids [Array] The ordered list of Part IDs. ... + # + # @param md5 [String] The optional md5 checksum for the file contents to verify if the bytes uploaded + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/upload_create_params.rb b/lib/openai/models/upload_create_params.rb index afa6ec61..cafa9448 100644 --- a/lib/openai/models/upload_create_params.rb +++ b/lib/openai/models/upload_create_params.rb @@ -38,10 +38,17 @@ class UploadCreateParams < OpenAI::Internal::Type::BaseModel required :purpose, enum: -> { OpenAI::Models::FilePurpose } # @!method initialize(bytes:, filename:, mime_type:, purpose:, request_options: {}) - # @param bytes [Integer] - # @param filename [String] - # @param mime_type [String] - # @param purpose [Symbol, OpenAI::Models::FilePurpose] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::UploadCreateParams} for more details. + # + # @param bytes [Integer] The number of bytes in the file you are uploading. ... + # + # @param filename [String] The name of the file to upload. ... + # + # @param mime_type [String] The MIME type of the file. ... + # + # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/uploads/part_create_params.rb b/lib/openai/models/uploads/part_create_params.rb index 9294e4c0..d4e1d7bf 100644 --- a/lib/openai/models/uploads/part_create_params.rb +++ b/lib/openai/models/uploads/part_create_params.rb @@ -15,7 +15,11 @@ class PartCreateParams < OpenAI::Internal::Type::BaseModel required :data, OpenAI::Internal::Type::IOLike # @!method initialize(data:, request_options: {}) - # @param data [Pathname, StringIO] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Uploads::PartCreateParams} for more details. + # + # @param data [Pathname, StringIO] The chunk of bytes for this Part. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/openai/models/uploads/upload_part.rb b/lib/openai/models/uploads/upload_part.rb index fa189119..f0b61875 100644 --- a/lib/openai/models/uploads/upload_part.rb +++ b/lib/openai/models/uploads/upload_part.rb @@ -32,10 +32,13 @@ class UploadPart < OpenAI::Internal::Type::BaseModel # @!method initialize(id:, created_at:, upload_id:, object: :"upload.part") # The upload Part represents a chunk of bytes we can add to an Upload object. # - # @param id [String] - # @param created_at [Integer] - # @param upload_id [String] - # @param object [Symbol, :"upload.part"] + # @param id [String] The upload Part unique identifier, which can be referenced in API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the Part was created. + # + # @param upload_id [String] The ID of the Upload object that this Part was added to. + # + # @param object [Symbol, :"upload.part"] The object type, which is always `upload.part`. end end diff --git a/lib/openai/models/vector_store.rb b/lib/openai/models/vector_store.rb index 3db76e67..285ac28c 100644 --- a/lib/openai/models/vector_store.rb +++ b/lib/openai/models/vector_store.rb @@ -77,20 +77,34 @@ class VectorStore < OpenAI::Internal::Type::BaseModel optional :expires_at, Integer, nil?: true # @!method initialize(id:, created_at:, file_counts:, last_active_at:, metadata:, name:, status:, usage_bytes:, expires_after: nil, expires_at: nil, object: :vector_store) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStore} for more details. + # # A vector store is a collection of processed files can be used by the # `file_search` tool. # - # @param id [String] - # @param created_at [Integer] + # @param id [String] The identifier, which can be referenced in API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the vector store was created. + # # @param file_counts [OpenAI::Models::VectorStore::FileCounts] - # @param last_active_at [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] - # @param status [Symbol, OpenAI::Models::VectorStore::Status] - # @param usage_bytes [Integer] - # @param expires_after [OpenAI::Models::VectorStore::ExpiresAfter] - # @param expires_at [Integer, nil] - # @param object [Symbol, :vector_store] + # + # @param last_active_at [Integer, nil] The Unix timestamp (in seconds) for when the vector store was last active. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the vector store. + # + # @param status [Symbol, OpenAI::Models::VectorStore::Status] The status of the vector store, which can be either `expired`, `in_progress`, or + # ... + # + # @param usage_bytes [Integer] The total number of bytes used by the files in the vector store. + # + # @param expires_after [OpenAI::Models::VectorStore::ExpiresAfter] The expiration policy for a vector store. + # + # @param expires_at [Integer, nil] The Unix timestamp (in seconds) for when the vector store will expire. + # + # @param object [Symbol, :vector_store] The object type, which is always `vector_store`. # @see OpenAI::Models::VectorStore#file_counts class FileCounts < OpenAI::Internal::Type::BaseModel @@ -125,11 +139,15 @@ class FileCounts < OpenAI::Internal::Type::BaseModel required :total, Integer # @!method initialize(cancelled:, completed:, failed:, in_progress:, total:) - # @param cancelled [Integer] - # @param completed [Integer] - # @param failed [Integer] - # @param in_progress [Integer] - # @param total [Integer] + # @param cancelled [Integer] The number of files that were cancelled. + # + # @param completed [Integer] The number of files that have been successfully processed. + # + # @param failed [Integer] The number of files that have failed to process. + # + # @param in_progress [Integer] The number of files that are currently being processed. + # + # @param total [Integer] The total number of files. end # The status of the vector store, which can be either `expired`, `in_progress`, or @@ -164,10 +182,15 @@ class ExpiresAfter < OpenAI::Internal::Type::BaseModel required :days, Integer # @!method initialize(days:, anchor: :last_active_at) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStore::ExpiresAfter} for more details. + # # The expiration policy for a vector store. # - # @param days [Integer] - # @param anchor [Symbol, :last_active_at] + # @param days [Integer] The number of days after the anchor time that the vector store will expire. + # + # @param anchor [Symbol, :last_active_at] Anchor timestamp after which the expiration policy applies. Supported anchors: ` + # ... end end end diff --git a/lib/openai/models/vector_store_create_params.rb b/lib/openai/models/vector_store_create_params.rb index 30eb84d9..acbd89a2 100644 --- a/lib/openai/models/vector_store_create_params.rb +++ b/lib/openai/models/vector_store_create_params.rb @@ -46,11 +46,21 @@ class VectorStoreCreateParams < OpenAI::Internal::Type::BaseModel optional :name, String # @!method initialize(chunking_strategy: nil, expires_after: nil, file_ids: nil, metadata: nil, name: nil, request_options: {}) - # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] - # @param expires_after [OpenAI::Models::VectorStoreCreateParams::ExpiresAfter] - # @param file_ids [Array] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreCreateParams} for more details. + # + # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # + # @param expires_after [OpenAI::Models::VectorStoreCreateParams::ExpiresAfter] The expiration policy for a vector store. + # + # @param file_ids [Array] A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the vector store. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] class ExpiresAfter < OpenAI::Internal::Type::BaseModel @@ -68,10 +78,15 @@ class ExpiresAfter < OpenAI::Internal::Type::BaseModel required :days, Integer # @!method initialize(days:, anchor: :last_active_at) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreCreateParams::ExpiresAfter} for more details. + # # The expiration policy for a vector store. # - # @param days [Integer] - # @param anchor [Symbol, :last_active_at] + # @param days [Integer] The number of days after the anchor time that the vector store will expire. + # + # @param anchor [Symbol, :last_active_at] Anchor timestamp after which the expiration policy applies. Supported anchors: ` + # ... end end end diff --git a/lib/openai/models/vector_store_list_params.rb b/lib/openai/models/vector_store_list_params.rb index caa16c07..9a7d787d 100644 --- a/lib/openai/models/vector_store_list_params.rb +++ b/lib/openai/models/vector_store_list_params.rb @@ -40,10 +40,21 @@ class VectorStoreListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::VectorStoreListParams::Order } # @!method initialize(after: nil, before: nil, limit: nil, order: nil, request_options: {}) - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::VectorStoreListParams::Order] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreListParams} for more details. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::VectorStoreListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Sort order by the `created_at` timestamp of the objects. `asc` for ascending diff --git a/lib/openai/models/vector_store_search_params.rb b/lib/openai/models/vector_store_search_params.rb index 808daadb..5eaa270d 100644 --- a/lib/openai/models/vector_store_search_params.rb +++ b/lib/openai/models/vector_store_search_params.rb @@ -39,11 +39,20 @@ class VectorStoreSearchParams < OpenAI::Internal::Type::BaseModel optional :rewrite_query, OpenAI::Internal::Type::Boolean # @!method initialize(query:, filters: nil, max_num_results: nil, ranking_options: nil, rewrite_query: nil, request_options: {}) - # @param query [String, Array] - # @param filters [OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter] - # @param max_num_results [Integer] - # @param ranking_options [OpenAI::Models::VectorStoreSearchParams::RankingOptions] - # @param rewrite_query [Boolean] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreSearchParams} for more details. + # + # @param query [String, Array] A query string for a search + # + # @param filters [OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter] A filter to apply based on file attributes. + # + # @param max_num_results [Integer] The maximum number of results to return. This number should be between 1 and 50 + # ... + # + # @param ranking_options [OpenAI::Models::VectorStoreSearchParams::RankingOptions] Ranking options for search. + # + # @param rewrite_query [Boolean] Whether to rewrite the natural language query for vector search. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # A query string for a search diff --git a/lib/openai/models/vector_store_search_response.rb b/lib/openai/models/vector_store_search_response.rb index d06a0c95..75e2fdb5 100644 --- a/lib/openai/models/vector_store_search_response.rb +++ b/lib/openai/models/vector_store_search_response.rb @@ -42,11 +42,18 @@ class VectorStoreSearchResponse < OpenAI::Internal::Type::BaseModel required :score, Float # @!method initialize(attributes:, content:, file_id:, filename:, score:) - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] - # @param content [Array] - # @param file_id [String] - # @param filename [String] - # @param score [Float] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreSearchResponse} for more details. + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param content [Array] Content chunks from the file. + # + # @param file_id [String] The ID of the vector store file. + # + # @param filename [String] The name of the vector store file. + # + # @param score [Float] The similarity score for the result. module Attribute extend OpenAI::Internal::Type::Union @@ -75,8 +82,9 @@ class Content < OpenAI::Internal::Type::BaseModel required :type, enum: -> { OpenAI::Models::VectorStoreSearchResponse::Content::Type } # @!method initialize(text:, type:) - # @param text [String] - # @param type [Symbol, OpenAI::Models::VectorStoreSearchResponse::Content::Type] + # @param text [String] The text content returned from search. + # + # @param type [Symbol, OpenAI::Models::VectorStoreSearchResponse::Content::Type] The type of content. # The type of content. # diff --git a/lib/openai/models/vector_store_update_params.rb b/lib/openai/models/vector_store_update_params.rb index 91eafa78..b7d6bd13 100644 --- a/lib/openai/models/vector_store_update_params.rb +++ b/lib/openai/models/vector_store_update_params.rb @@ -31,9 +31,15 @@ class VectorStoreUpdateParams < OpenAI::Internal::Type::BaseModel optional :name, String, nil?: true # @!method initialize(expires_after: nil, metadata: nil, name: nil, request_options: {}) - # @param expires_after [OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String, nil] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreUpdateParams} for more details. + # + # @param expires_after [OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, nil] The expiration policy for a vector store. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String, nil] The name of the vector store. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] class ExpiresAfter < OpenAI::Internal::Type::BaseModel @@ -51,10 +57,15 @@ class ExpiresAfter < OpenAI::Internal::Type::BaseModel required :days, Integer # @!method initialize(days:, anchor: :last_active_at) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter} for more details. + # # The expiration policy for a vector store. # - # @param days [Integer] - # @param anchor [Symbol, :last_active_at] + # @param days [Integer] The number of days after the anchor time that the vector store will expire. + # + # @param anchor [Symbol, :last_active_at] Anchor timestamp after which the expiration policy applies. Supported anchors: ` + # ... end end end diff --git a/lib/openai/models/vector_stores/file_batch_create_params.rb b/lib/openai/models/vector_stores/file_batch_create_params.rb index 9a873239..fba3d18a 100644 --- a/lib/openai/models/vector_stores/file_batch_create_params.rb +++ b/lib/openai/models/vector_stores/file_batch_create_params.rb @@ -36,9 +36,17 @@ class FileBatchCreateParams < OpenAI::Internal::Type::BaseModel optional :chunking_strategy, union: -> { OpenAI::Models::FileChunkingStrategyParam } # @!method initialize(file_ids:, attributes: nil, chunking_strategy: nil, request_options: {}) - # @param file_ids [Array] - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] - # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileBatchCreateParams} for more details. + # + # @param file_ids [Array] A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that + # ... + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] module Attribute diff --git a/lib/openai/models/vector_stores/file_batch_list_files_params.rb b/lib/openai/models/vector_stores/file_batch_list_files_params.rb index 543b49c7..fc97c2c0 100644 --- a/lib/openai/models/vector_stores/file_batch_list_files_params.rb +++ b/lib/openai/models/vector_stores/file_batch_list_files_params.rb @@ -52,12 +52,26 @@ class FileBatchListFilesParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::VectorStores::FileBatchListFilesParams::Order } # @!method initialize(vector_store_id:, after: nil, before: nil, filter: nil, limit: nil, order: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileBatchListFilesParams} for more details. + # # @param vector_store_id [String] - # @param after [String] - # @param before [String] - # @param filter [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Order] + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param filter [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter] Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. diff --git a/lib/openai/models/vector_stores/file_content_response.rb b/lib/openai/models/vector_stores/file_content_response.rb index 094dcbfb..8c9f595a 100644 --- a/lib/openai/models/vector_stores/file_content_response.rb +++ b/lib/openai/models/vector_stores/file_content_response.rb @@ -18,8 +18,9 @@ class FileContentResponse < OpenAI::Internal::Type::BaseModel optional :type, String # @!method initialize(text: nil, type: nil) - # @param text [String] - # @param type [String] + # @param text [String] The text content + # + # @param type [String] The content type (currently only `"text"`) end end end diff --git a/lib/openai/models/vector_stores/file_create_params.rb b/lib/openai/models/vector_stores/file_create_params.rb index 2d0fc3ea..d5e71148 100644 --- a/lib/openai/models/vector_stores/file_create_params.rb +++ b/lib/openai/models/vector_stores/file_create_params.rb @@ -36,9 +36,17 @@ class FileCreateParams < OpenAI::Internal::Type::BaseModel optional :chunking_strategy, union: -> { OpenAI::Models::FileChunkingStrategyParam } # @!method initialize(file_id:, attributes: nil, chunking_strategy: nil, request_options: {}) - # @param file_id [String] - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] - # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileCreateParams} for more details. + # + # @param file_id [String] A [File](https://platform.openai.com/docs/api-reference/files) ID that the vecto + # ... + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] module Attribute diff --git a/lib/openai/models/vector_stores/file_list_params.rb b/lib/openai/models/vector_stores/file_list_params.rb index 551d5a17..55dd58ce 100644 --- a/lib/openai/models/vector_stores/file_list_params.rb +++ b/lib/openai/models/vector_stores/file_list_params.rb @@ -47,11 +47,24 @@ class FileListParams < OpenAI::Internal::Type::BaseModel optional :order, enum: -> { OpenAI::Models::VectorStores::FileListParams::Order } # @!method initialize(after: nil, before: nil, filter: nil, limit: nil, order: nil, request_options: {}) - # @param after [String] - # @param before [String] - # @param filter [Symbol, OpenAI::Models::VectorStores::FileListParams::Filter] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::VectorStores::FileListParams::Order] + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileListParams} for more details. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param filter [Symbol, OpenAI::Models::VectorStores::FileListParams::Filter] Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::VectorStores::FileListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. diff --git a/lib/openai/models/vector_stores/file_update_params.rb b/lib/openai/models/vector_stores/file_update_params.rb index f054fa7a..cb4600bd 100644 --- a/lib/openai/models/vector_stores/file_update_params.rb +++ b/lib/openai/models/vector_stores/file_update_params.rb @@ -26,8 +26,13 @@ class FileUpdateParams < OpenAI::Internal::Type::BaseModel nil?: true # @!method initialize(vector_store_id:, attributes:, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileUpdateParams} for more details. + # # @param vector_store_id [String] - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] module Attribute diff --git a/lib/openai/models/vector_stores/vector_store_file.rb b/lib/openai/models/vector_stores/vector_store_file.rb index 4891ed5a..66754ed9 100644 --- a/lib/openai/models/vector_stores/vector_store_file.rb +++ b/lib/openai/models/vector_stores/vector_store_file.rb @@ -73,17 +73,32 @@ class VectorStoreFile < OpenAI::Internal::Type::BaseModel optional :chunking_strategy, union: -> { OpenAI::Models::FileChunkingStrategy } # @!method initialize(id:, created_at:, last_error:, status:, usage_bytes:, vector_store_id:, attributes: nil, chunking_strategy: nil, object: :"vector_store.file") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::VectorStoreFile} for more details. + # # A list of files attached to a vector store. # - # @param id [String] - # @param created_at [Integer] - # @param last_error [OpenAI::Models::VectorStores::VectorStoreFile::LastError, nil] - # @param status [Symbol, OpenAI::Models::VectorStores::VectorStoreFile::Status] - # @param usage_bytes [Integer] - # @param vector_store_id [String] - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] - # @param chunking_strategy [OpenAI::Models::StaticFileChunkingStrategyObject, OpenAI::Models::OtherFileChunkingStrategyObject] - # @param object [Symbol, :"vector_store.file"] + # @param id [String] The identifier, which can be referenced in API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the vector store file was created. + # + # @param last_error [OpenAI::Models::VectorStores::VectorStoreFile::LastError, nil] The last error associated with this vector store file. Will be `null` if there a + # ... + # + # @param status [Symbol, OpenAI::Models::VectorStores::VectorStoreFile::Status] The status of the vector store file, which can be either `in_progress`, `complet + # ... + # + # @param usage_bytes [Integer] The total vector store usage in bytes. Note that this may be different from the + # ... + # + # @param vector_store_id [String] The ID of the [vector store](https://platform.openai.com/docs/api-reference/vect + # ... + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param chunking_strategy [OpenAI::Models::StaticFileChunkingStrategyObject, OpenAI::Models::OtherFileChunkingStrategyObject] The strategy used to chunk the file. + # + # @param object [Symbol, :"vector_store.file"] The object type, which is always `vector_store.file`. # @see OpenAI::Models::VectorStores::VectorStoreFile#last_error class LastError < OpenAI::Internal::Type::BaseModel @@ -103,8 +118,9 @@ class LastError < OpenAI::Internal::Type::BaseModel # The last error associated with this vector store file. Will be `null` if there # are no errors. # - # @param code [Symbol, OpenAI::Models::VectorStores::VectorStoreFile::LastError::Code] - # @param message [String] + # @param code [Symbol, OpenAI::Models::VectorStores::VectorStoreFile::LastError::Code] One of `server_error` or `rate_limit_exceeded`. + # + # @param message [String] A human-readable description of the error. # One of `server_error` or `rate_limit_exceeded`. # diff --git a/lib/openai/models/vector_stores/vector_store_file_batch.rb b/lib/openai/models/vector_stores/vector_store_file_batch.rb index ee7fb5ea..86d56390 100644 --- a/lib/openai/models/vector_stores/vector_store_file_batch.rb +++ b/lib/openai/models/vector_stores/vector_store_file_batch.rb @@ -46,14 +46,25 @@ class VectorStoreFileBatch < OpenAI::Internal::Type::BaseModel required :vector_store_id, String # @!method initialize(id:, created_at:, file_counts:, status:, vector_store_id:, object: :"vector_store.files_batch") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::VectorStoreFileBatch} for more details. + # # A batch of files attached to a vector store. # - # @param id [String] - # @param created_at [Integer] + # @param id [String] The identifier, which can be referenced in API endpoints. + # + # @param created_at [Integer] The Unix timestamp (in seconds) for when the vector store files batch was create + # ... + # # @param file_counts [OpenAI::Models::VectorStores::VectorStoreFileBatch::FileCounts] - # @param status [Symbol, OpenAI::Models::VectorStores::VectorStoreFileBatch::Status] - # @param vector_store_id [String] - # @param object [Symbol, :"vector_store.files_batch"] + # + # @param status [Symbol, OpenAI::Models::VectorStores::VectorStoreFileBatch::Status] The status of the vector store files batch, which can be either `in_progress`, ` + # ... + # + # @param vector_store_id [String] The ID of the [vector store](https://platform.openai.com/docs/api-reference/vect + # ... + # + # @param object [Symbol, :"vector_store.files_batch"] The object type, which is always `vector_store.file_batch`. # @see OpenAI::Models::VectorStores::VectorStoreFileBatch#file_counts class FileCounts < OpenAI::Internal::Type::BaseModel @@ -88,11 +99,15 @@ class FileCounts < OpenAI::Internal::Type::BaseModel required :total, Integer # @!method initialize(cancelled:, completed:, failed:, in_progress:, total:) - # @param cancelled [Integer] - # @param completed [Integer] - # @param failed [Integer] - # @param in_progress [Integer] - # @param total [Integer] + # @param cancelled [Integer] The number of files that where cancelled. + # + # @param completed [Integer] The number of files that have been processed. + # + # @param failed [Integer] The number of files that have failed to process. + # + # @param in_progress [Integer] The number of files that are currently being processed. + # + # @param total [Integer] The total number of files. end # The status of the vector store files batch, which can be either `in_progress`, diff --git a/lib/openai/resources/audio/speech.rb b/lib/openai/resources/audio/speech.rb index 6a31ca99..cd1044ab 100644 --- a/lib/openai/resources/audio/speech.rb +++ b/lib/openai/resources/audio/speech.rb @@ -4,16 +4,30 @@ module OpenAI module Resources class Audio class Speech + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::SpeechCreateParams} for more details. + # # Generates audio from the input text. # # @overload create(input:, model:, voice:, instructions: nil, response_format: nil, speed: nil, request_options: {}) # - # @param input [String] - # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] - # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] - # @param instructions [String] - # @param response_format [Symbol, OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat] - # @param speed [Float] + # @param input [String] The text to generate audio for. The maximum length is 4096 characters. + # + # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] One of the available [TTS models](https://platform.openai.com/docs/models#tts): + # ... + # + # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported voices are `alloy`, `ash`, + # ... + # + # @param instructions [String] Control the voice of your generated audio with additional instructions. Does not + # ... + # + # @param response_format [Symbol, OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat] The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav + # ... + # + # @param speed [Float] The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [StringIO] diff --git a/lib/openai/resources/audio/transcriptions.rb b/lib/openai/resources/audio/transcriptions.rb index bdde1310..d7f5de3e 100644 --- a/lib/openai/resources/audio/transcriptions.rb +++ b/lib/openai/resources/audio/transcriptions.rb @@ -7,18 +7,36 @@ class Transcriptions # See {OpenAI::Resources::Audio::Transcriptions#create_streaming} for streaming # counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionCreateParams} for more details. + # # Transcribes audio into the input language. # # @overload create(file:, model:, include: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) # - # @param file [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::AudioModel] - # @param include [Array] - # @param language [String] - # @param prompt [String] - # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] - # @param temperature [Float] - # @param timestamp_granularities [Array] + # @param file [Pathname, StringIO] The audio file object (not file name) to transcribe, in one of these formats: fl + # ... + # + # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc + # ... + # + # @param include [Array] Additional information to include in the transcription response. ... + # + # @param language [String] The language of the input audio. Supplying the input language in [ISO-639-1](htt + # ... + # + # @param prompt [String] An optional text to guide the model's style or continue a previous audio segment + # ... + # + # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] The format of the output, in one of these options: `json`, `text`, `srt`, `verbo + # ... + # + # @param temperature [Float] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the + # ... + # + # @param timestamp_granularities [Array] The timestamp granularities to populate for this transcription. `response_format + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Audio::Transcription, OpenAI::Models::Audio::TranscriptionVerbose] @@ -43,18 +61,36 @@ def create(params) # See {OpenAI::Resources::Audio::Transcriptions#create} for non-streaming # counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranscriptionCreateParams} for more details. + # # Transcribes audio into the input language. # # @overload create_streaming(file:, model:, include: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) # - # @param file [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::AudioModel] - # @param include [Array] - # @param language [String] - # @param prompt [String] - # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] - # @param temperature [Float] - # @param timestamp_granularities [Array] + # @param file [Pathname, StringIO] The audio file object (not file name) to transcribe, in one of these formats: fl + # ... + # + # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc + # ... + # + # @param include [Array] Additional information to include in the transcription response. ... + # + # @param language [String] The language of the input audio. Supplying the input language in [ISO-639-1](htt + # ... + # + # @param prompt [String] An optional text to guide the model's style or continue a previous audio segment + # ... + # + # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] The format of the output, in one of these options: `json`, `text`, `srt`, `verbo + # ... + # + # @param temperature [Float] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the + # ... + # + # @param timestamp_granularities [Array] The timestamp granularities to populate for this transcription. `response_format + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Stream] diff --git a/lib/openai/resources/audio/translations.rb b/lib/openai/resources/audio/translations.rb index 418e58af..d52be7ea 100644 --- a/lib/openai/resources/audio/translations.rb +++ b/lib/openai/resources/audio/translations.rb @@ -4,15 +4,28 @@ module OpenAI module Resources class Audio class Translations + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Audio::TranslationCreateParams} for more details. + # # Translates audio into English. # # @overload create(file:, model:, prompt: nil, response_format: nil, temperature: nil, request_options: {}) # - # @param file [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::AudioModel] - # @param prompt [String] - # @param response_format [Symbol, OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat] - # @param temperature [Float] + # @param file [Pathname, StringIO] The audio file object (not file name) translate, in one of these formats: flac, + # ... + # + # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. Only `whisper-1` (which is powered by our open source Wh + # ... + # + # @param prompt [String] An optional text to guide the model's style or continue a previous audio segment + # ... + # + # @param response_format [Symbol, OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat] The format of the output, in one of these options: `json`, `text`, `srt`, `verbo + # ... + # + # @param temperature [Float] The sampling temperature, between 0 and 1. Higher values like 0.8 will make the + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Audio::Translation, OpenAI::Models::Audio::TranslationVerbose] diff --git a/lib/openai/resources/batches.rb b/lib/openai/resources/batches.rb index 84f5ad93..d63aac23 100644 --- a/lib/openai/resources/batches.rb +++ b/lib/openai/resources/batches.rb @@ -3,14 +3,23 @@ module OpenAI module Resources class Batches + # Some parameter documentations has been truncated, see + # {OpenAI::Models::BatchCreateParams} for more details. + # # Creates and executes a batch from an uploaded file of requests # # @overload create(completion_window:, endpoint:, input_file_id:, metadata: nil, request_options: {}) # - # @param completion_window [Symbol, OpenAI::Models::BatchCreateParams::CompletionWindow] - # @param endpoint [Symbol, OpenAI::Models::BatchCreateParams::Endpoint] - # @param input_file_id [String] - # @param metadata [Hash{Symbol=>String}, nil] + # @param completion_window [Symbol, OpenAI::Models::BatchCreateParams::CompletionWindow] The time frame within which the batch should be processed. Currently only `24h` + # ... + # + # @param endpoint [Symbol, OpenAI::Models::BatchCreateParams::Endpoint] The endpoint to be used for all requests in the batch. Currently `/v1/responses` + # ... + # + # @param input_file_id [String] The ID of an uploaded file that contains requests for the new batch. ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Batch] @@ -31,7 +40,8 @@ def create(params) # # @overload retrieve(batch_id, request_options: {}) # - # @param batch_id [String] + # @param batch_id [String] The ID of the batch to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Batch] @@ -46,12 +56,19 @@ def retrieve(batch_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::BatchListParams} for more details. + # # List your organization's batches. # # @overload list(after: nil, limit: nil, request_options: {}) # - # @param after [String] - # @param limit [Integer] + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -75,7 +92,8 @@ def list(params = {}) # # @overload cancel(batch_id, request_options: {}) # - # @param batch_id [String] + # @param batch_id [String] The ID of the batch to cancel. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Batch] diff --git a/lib/openai/resources/beta/assistants.rb b/lib/openai/resources/beta/assistants.rb index a7f952e7..303843a0 100644 --- a/lib/openai/resources/beta/assistants.rb +++ b/lib/openai/resources/beta/assistants.rb @@ -4,21 +4,42 @@ module OpenAI module Resources class Beta class Assistants + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantCreateParams} for more details. + # # Create an assistant with a model and instructions. # # @overload create(model:, description: nil, instructions: nil, metadata: nil, name: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_resources: nil, tools: nil, top_p: nil, request_options: {}) # - # @param model [String, Symbol, OpenAI::Models::ChatModel] - # @param description [String, nil] - # @param instructions [String, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_resources [OpenAI::Models::Beta::AssistantCreateParams::ToolResources, nil] - # @param tools [Array] - # @param top_p [Float, nil] + # @param model [String, Symbol, OpenAI::Models::ChatModel] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param description [String, nil] The description of the assistant. The maximum length is 512 characters. ... + # + # @param instructions [String, nil] The system instructions that the assistant uses. The maximum length is 256,000 c + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String, nil] The name of the assistant. The maximum length is 256 characters. ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_resources [OpenAI::Models::Beta::AssistantCreateParams::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param tools [Array] A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Assistant] @@ -39,7 +60,8 @@ def create(params) # # @overload retrieve(assistant_id, request_options: {}) # - # @param assistant_id [String] + # @param assistant_id [String] The ID of the assistant to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Assistant] @@ -54,22 +76,44 @@ def retrieve(assistant_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantUpdateParams} for more details. + # # Modifies an assistant. # # @overload update(assistant_id, description: nil, instructions: nil, metadata: nil, model: nil, name: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_resources: nil, tools: nil, top_p: nil, request_options: {}) # - # @param assistant_id [String] - # @param description [String, nil] - # @param instructions [String, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::Beta::AssistantUpdateParams::Model] - # @param name [String, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_resources [OpenAI::Models::Beta::AssistantUpdateParams::ToolResources, nil] - # @param tools [Array] - # @param top_p [Float, nil] + # @param assistant_id [String] The ID of the assistant to modify. + # + # @param description [String, nil] The description of the assistant. The maximum length is 512 characters. ... + # + # @param instructions [String, nil] The system instructions that the assistant uses. The maximum length is 256,000 c + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, Symbol, OpenAI::Models::Beta::AssistantUpdateParams::Model] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param name [String, nil] The name of the assistant. The maximum length is 256 characters. ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_resources [OpenAI::Models::Beta::AssistantUpdateParams::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param tools [Array] A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Assistant] @@ -86,14 +130,25 @@ def update(assistant_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::AssistantListParams} for more details. + # # Returns a list of assistants. # # @overload list(after: nil, before: nil, limit: nil, order: nil, request_options: {}) # - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::AssistantListParams::Order] + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::AssistantListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -115,7 +170,8 @@ def list(params = {}) # # @overload delete(assistant_id, request_options: {}) # - # @param assistant_id [String] + # @param assistant_id [String] The ID of the assistant to delete. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::AssistantDeleted] diff --git a/lib/openai/resources/beta/threads.rb b/lib/openai/resources/beta/threads.rb index d5b01740..85c88739 100644 --- a/lib/openai/resources/beta/threads.rb +++ b/lib/openai/resources/beta/threads.rb @@ -10,13 +10,21 @@ class Threads # @return [OpenAI::Resources::Beta::Threads::Messages] attr_reader :messages + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateParams} for more details. + # # Create a thread. # # @overload create(messages: nil, metadata: nil, tool_resources: nil, request_options: {}) # - # @param messages [Array] - # @param metadata [Hash{Symbol=>String}, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadCreateParams::ToolResources, nil] + # @param messages [Array] A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadCreateParams::ToolResources, nil] A set of resources that are made available to the assistant's tools in this thre + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Thread] @@ -37,7 +45,8 @@ def create(params = {}) # # @overload retrieve(thread_id, request_options: {}) # - # @param thread_id [String] + # @param thread_id [String] The ID of the thread to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Thread] @@ -52,13 +61,20 @@ def retrieve(thread_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadUpdateParams} for more details. + # # Modifies a thread. # # @overload update(thread_id, metadata: nil, tool_resources: nil, request_options: {}) # - # @param thread_id [String] - # @param metadata [Hash{Symbol=>String}, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, nil] + # @param thread_id [String] The ID of the thread to modify. Only the `metadata` can be modified. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, nil] A set of resources that are made available to the assistant's tools in this thre + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Thread] @@ -79,7 +95,8 @@ def update(thread_id, params = {}) # # @overload delete(thread_id, request_options: {}) # - # @param thread_id [String] + # @param thread_id [String] The ID of the thread to delete. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::ThreadDeleted] @@ -96,25 +113,55 @@ def delete(thread_id, params = {}) # See {OpenAI::Resources::Beta::Threads#stream_raw} for streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams} for more details. + # # Create a thread and run it in one request. # # @overload create_and_run(assistant_id:, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, response_format: nil, temperature: nil, thread: nil, tool_choice: nil, tool_resources: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {}) # - # @param assistant_id [String] - # @param instructions [String, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_prompt_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] - # @param parallel_tool_calls [Boolean] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param thread [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread] - # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil] - # @param tools [Array, nil] - # @param top_p [Float, nil] - # @param truncation_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil] + # @param assistant_id [String] The ID of the [assistant](https://platform.openai.com/docs/api-reference/assista + # ... + # + # @param instructions [String, nil] Override the default system message of the assistant. This is useful for modifyi + # ... + # + # @param max_completion_tokens [Integer, nil] The maximum number of completion tokens that may be used over the course of the + # ... + # + # @param max_prompt_tokens [Integer, nil] The maximum number of prompt tokens that may be used over the course of the run. + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param thread [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread] Options to create a new thread. If no thread is provided when running a ... + # + # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] Controls which (if any) tool is called by the model. ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param tools [Array, nil] Override the tools the assistant can use for this run. This is useful for modify + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param truncation_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil] Controls for how a thread will be truncated prior to the run. Use this to contro + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Run] @@ -142,25 +189,55 @@ def stream # See {OpenAI::Resources::Beta::Threads#create_and_run} for non-streaming # counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ThreadCreateAndRunParams} for more details. + # # Create a thread and run it in one request. # # @overload stream_raw(assistant_id:, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, response_format: nil, temperature: nil, thread: nil, tool_choice: nil, tool_resources: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {}) # - # @param assistant_id [String] - # @param instructions [String, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_prompt_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] - # @param parallel_tool_calls [Boolean] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param thread [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread] - # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] - # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil] - # @param tools [Array, nil] - # @param top_p [Float, nil] - # @param truncation_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil] + # @param assistant_id [String] The ID of the [assistant](https://platform.openai.com/docs/api-reference/assista + # ... + # + # @param instructions [String, nil] Override the default system message of the assistant. This is useful for modifyi + # ... + # + # @param max_completion_tokens [Integer, nil] The maximum number of completion tokens that may be used over the course of the + # ... + # + # @param max_prompt_tokens [Integer, nil] The maximum number of prompt tokens that may be used over the course of the run. + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Specifies the format that the model must output. Compatible with [GPT-4o](https: + # ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param thread [OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread] Options to create a new thread. If no thread is provided when running a ... + # + # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] Controls which (if any) tool is called by the model. ... + # + # @param tool_resources [OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, nil] A set of resources that are used by the assistant's tools. The resources are spe + # ... + # + # @param tools [Array, nil] Override the tools the assistant can use for this run. This is useful for modify + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param truncation_strategy [OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, nil] Controls for how a thread will be truncated prior to the run. Use this to contro + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Stream] diff --git a/lib/openai/resources/beta/threads/messages.rb b/lib/openai/resources/beta/threads/messages.rb index 81de13fc..d9191639 100644 --- a/lib/openai/resources/beta/threads/messages.rb +++ b/lib/openai/resources/beta/threads/messages.rb @@ -5,15 +5,24 @@ module Resources class Beta class Threads class Messages + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::MessageCreateParams} for more details. + # # Create a message. # # @overload create(thread_id, content:, role:, attachments: nil, metadata: nil, request_options: {}) # - # @param thread_id [String] - # @param content [String, Array] - # @param role [Symbol, OpenAI::Models::Beta::Threads::MessageCreateParams::Role] - # @param attachments [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] + # @param thread_id [String] The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) t + # ... + # + # @param content [String, Array] The text contents of the message. + # + # @param role [Symbol, OpenAI::Models::Beta::Threads::MessageCreateParams::Role] The role of the entity that is creating the message. Allowed values include: ... + # + # @param attachments [Array, nil] A list of files attached to the message, and the tools they should be added to. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Message] @@ -30,12 +39,18 @@ def create(thread_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::MessageRetrieveParams} for more details. + # # Retrieve a message. # # @overload retrieve(message_id, thread_id:, request_options: {}) # - # @param message_id [String] - # @param thread_id [String] + # @param message_id [String] The ID of the message to retrieve. + # + # @param thread_id [String] The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) t + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Message] @@ -55,13 +70,20 @@ def retrieve(message_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::MessageUpdateParams} for more details. + # # Modifies a message. # # @overload update(message_id, thread_id:, metadata: nil, request_options: {}) # - # @param message_id [String] - # @param thread_id [String] - # @param metadata [Hash{Symbol=>String}, nil] + # @param message_id [String] Path param: The ID of the message to modify. + # + # @param thread_id [String] Path param: The ID of the thread to which this message belongs. + # + # @param metadata [Hash{Symbol=>String}, nil] Body param: Set of 16 key-value pairs that can be attached to an object. This ca + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Message] @@ -82,16 +104,30 @@ def update(message_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::MessageListParams} for more details. + # # Returns a list of messages for a given thread. # # @overload list(thread_id, after: nil, before: nil, limit: nil, order: nil, run_id: nil, request_options: {}) # - # @param thread_id [String] - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::Threads::MessageListParams::Order] - # @param run_id [String] + # @param thread_id [String] The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) t + # ... + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::Threads::MessageListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # + # @param run_id [String] Filter messages by the run ID that generated them. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -113,8 +149,10 @@ def list(thread_id, params = {}) # # @overload delete(message_id, thread_id:, request_options: {}) # - # @param message_id [String] - # @param thread_id [String] + # @param message_id [String] The ID of the message to delete. + # + # @param thread_id [String] The ID of the thread to which this message belongs. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::MessageDeleted] diff --git a/lib/openai/resources/beta/threads/runs.rb b/lib/openai/resources/beta/threads/runs.rb index 8ebefd9c..1dfcaeb2 100644 --- a/lib/openai/resources/beta/threads/runs.rb +++ b/lib/openai/resources/beta/threads/runs.rb @@ -11,28 +11,63 @@ class Runs # See {OpenAI::Resources::Beta::Threads::Runs#create_stream_raw} for streaming # counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunCreateParams} for more details. + # # Create a run. # # @overload create(thread_id, assistant_id:, include: nil, additional_instructions: nil, additional_messages: nil, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_choice: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {}) # - # @param thread_id [String] - # @param assistant_id [String] - # @param include [Array] - # @param additional_instructions [String, nil] - # @param additional_messages [Array, nil] - # @param instructions [String, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_prompt_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] - # @param parallel_tool_calls [Boolean] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] - # @param tools [Array, nil] - # @param top_p [Float, nil] - # @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil] + # @param thread_id [String] Path param: The ID of the thread to run. + # + # @param assistant_id [String] Body param: The ID of the [assistant](https://platform.openai.com/docs/api-refer + # ... + # + # @param include [Array] Query param: A list of additional fields to include in the response. Currently t + # ... + # + # @param additional_instructions [String, nil] Body param: Appends additional instructions at the end of the instructions for t + # ... + # + # @param additional_messages [Array, nil] Body param: Adds additional messages to the thread before creating the run. + # + # @param instructions [String, nil] Body param: Overrides the [instructions](https://platform.openai.com/docs/api-re + # ... + # + # @param max_completion_tokens [Integer, nil] Body param: The maximum number of completion tokens that may be used over the co + # ... + # + # @param max_prompt_tokens [Integer, nil] Body param: The maximum number of prompt tokens that may be used over the course + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Body param: Set of 16 key-value pairs that can be attached to an object. This ca + # ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] Body param: The ID of the [Model](https://platform.openai.com/docs/api-reference + # ... + # + # @param parallel_tool_calls [Boolean] Body param: Whether to enable [parallel function calling](https://platform.opena + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Body param: **o-series models only** ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Body param: Specifies the format that the model must output. Compatible with [GP + # ... + # + # @param temperature [Float, nil] Body param: What sampling temperature to use, between 0 and 2. Higher values lik + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] Body param: Controls which (if any) tool is called by the model. ... + # + # @param tools [Array, nil] Body param: Override the tools the assistant can use for this run. This is usefu + # ... + # + # @param top_p [Float, nil] Body param: An alternative to sampling with temperature, called nucleus sampling + # ... + # + # @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil] Body param: Controls for how a thread will be truncated prior to the run. Use th + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Run] @@ -58,28 +93,63 @@ def create(thread_id, params) # See {OpenAI::Resources::Beta::Threads::Runs#create} for non-streaming # counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunCreateParams} for more details. + # # Create a run. # # @overload create_stream_raw(thread_id, assistant_id:, include: nil, additional_instructions: nil, additional_messages: nil, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_choice: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {}) # - # @param thread_id [String] - # @param assistant_id [String] - # @param include [Array] - # @param additional_instructions [String, nil] - # @param additional_messages [Array, nil] - # @param instructions [String, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_prompt_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] - # @param parallel_tool_calls [Boolean] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] - # @param temperature [Float, nil] - # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] - # @param tools [Array, nil] - # @param top_p [Float, nil] - # @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil] + # @param thread_id [String] Path param: The ID of the thread to run. + # + # @param assistant_id [String] Body param: The ID of the [assistant](https://platform.openai.com/docs/api-refer + # ... + # + # @param include [Array] Query param: A list of additional fields to include in the response. Currently t + # ... + # + # @param additional_instructions [String, nil] Body param: Appends additional instructions at the end of the instructions for t + # ... + # + # @param additional_messages [Array, nil] Body param: Adds additional messages to the thread before creating the run. + # + # @param instructions [String, nil] Body param: Overrides the [instructions](https://platform.openai.com/docs/api-re + # ... + # + # @param max_completion_tokens [Integer, nil] Body param: The maximum number of completion tokens that may be used over the co + # ... + # + # @param max_prompt_tokens [Integer, nil] Body param: The maximum number of prompt tokens that may be used over the course + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Body param: Set of 16 key-value pairs that can be attached to an object. This ca + # ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, nil] Body param: The ID of the [Model](https://platform.openai.com/docs/api-reference + # ... + # + # @param parallel_tool_calls [Boolean] Body param: Whether to enable [parallel function calling](https://platform.opena + # ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Body param: **o-series models only** ... + # + # @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil] Body param: Specifies the format that the model must output. Compatible with [GP + # ... + # + # @param temperature [Float, nil] Body param: What sampling temperature to use, between 0 and 2. Higher values lik + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil] Body param: Controls which (if any) tool is called by the model. ... + # + # @param tools [Array, nil] Body param: Override the tools the assistant can use for this run. This is usefu + # ... + # + # @param top_p [Float, nil] Body param: An alternative to sampling with temperature, called nucleus sampling + # ... + # + # @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil] Body param: Controls for how a thread will be truncated prior to the run. Use th + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Stream] @@ -105,12 +175,18 @@ def create_stream_raw(thread_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunRetrieveParams} for more details. + # # Retrieves a run. # # @overload retrieve(run_id, thread_id:, request_options: {}) # - # @param run_id [String] - # @param thread_id [String] + # @param run_id [String] The ID of the run to retrieve. + # + # @param thread_id [String] The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) t + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Run] @@ -130,13 +206,21 @@ def retrieve(run_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunUpdateParams} for more details. + # # Modifies a run. # # @overload update(run_id, thread_id:, metadata: nil, request_options: {}) # - # @param run_id [String] - # @param thread_id [String] - # @param metadata [Hash{Symbol=>String}, nil] + # @param run_id [String] Path param: The ID of the run to modify. + # + # @param thread_id [String] Path param: The ID of the [thread](https://platform.openai.com/docs/api-referenc + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Body param: Set of 16 key-value pairs that can be attached to an object. This ca + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Run] @@ -157,15 +241,27 @@ def update(run_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunListParams} for more details. + # # Returns a list of runs belonging to a thread. # # @overload list(thread_id, after: nil, before: nil, limit: nil, order: nil, request_options: {}) # - # @param thread_id [String] - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::Threads::RunListParams::Order] + # @param thread_id [String] The ID of the thread the run belongs to. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::Threads::RunListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -187,8 +283,10 @@ def list(thread_id, params = {}) # # @overload cancel(run_id, thread_id:, request_options: {}) # - # @param run_id [String] - # @param thread_id [String] + # @param run_id [String] The ID of the run to cancel. + # + # @param thread_id [String] The ID of the thread to which this run belongs. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Run] @@ -211,6 +309,9 @@ def cancel(run_id, params) # See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs_stream_raw} for # streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams} for more details. + # # When a run has the `status: "requires_action"` and `required_action.type` is # `submit_tool_outputs`, this endpoint can be used to submit the outputs from the # tool calls once they're all completed. All outputs must be submitted in a single @@ -218,9 +319,13 @@ def cancel(run_id, params) # # @overload submit_tool_outputs(run_id, thread_id:, tool_outputs:, request_options: {}) # - # @param run_id [String] - # @param thread_id [String] - # @param tool_outputs [Array] + # @param run_id [String] Path param: The ID of the run that requires the tool output submission. + # + # @param thread_id [String] Path param: The ID of the [thread](https://platform.openai.com/docs/api-referenc + # ... + # + # @param tool_outputs [Array] Body param: A list of tools for which the outputs are being submitted. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Run] @@ -248,6 +353,9 @@ def submit_tool_outputs(run_id, params) # See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs} for # non-streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams} for more details. + # # When a run has the `status: "requires_action"` and `required_action.type` is # `submit_tool_outputs`, this endpoint can be used to submit the outputs from the # tool calls once they're all completed. All outputs must be submitted in a single @@ -255,9 +363,13 @@ def submit_tool_outputs(run_id, params) # # @overload submit_tool_outputs_stream_raw(run_id, thread_id:, tool_outputs:, request_options: {}) # - # @param run_id [String] - # @param thread_id [String] - # @param tool_outputs [Array] + # @param run_id [String] Path param: The ID of the run that requires the tool output submission. + # + # @param thread_id [String] Path param: The ID of the [thread](https://platform.openai.com/docs/api-referenc + # ... + # + # @param tool_outputs [Array] Body param: A list of tools for which the outputs are being submitted. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Stream] diff --git a/lib/openai/resources/beta/threads/runs/steps.rb b/lib/openai/resources/beta/threads/runs/steps.rb index 65972e48..21bbd9a5 100644 --- a/lib/openai/resources/beta/threads/runs/steps.rb +++ b/lib/openai/resources/beta/threads/runs/steps.rb @@ -6,14 +6,22 @@ class Beta class Threads class Runs class Steps + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::StepRetrieveParams} for more details. + # # Retrieves a run step. # # @overload retrieve(step_id, thread_id:, run_id:, include: nil, request_options: {}) # - # @param step_id [String] - # @param thread_id [String] - # @param run_id [String] - # @param include [Array] + # @param step_id [String] Path param: The ID of the run step to retrieve. + # + # @param thread_id [String] Path param: The ID of the thread to which the run and run step belongs. + # + # @param run_id [String] Path param: The ID of the run to which the run step belongs. + # + # @param include [Array] Query param: A list of additional fields to include in the response. Currently t + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Beta::Threads::Runs::RunStep] @@ -38,17 +46,32 @@ def retrieve(step_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::Threads::Runs::StepListParams} for more details. + # # Returns a list of run steps belonging to a run. # # @overload list(run_id, thread_id:, after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}) # - # @param run_id [String] - # @param thread_id [String] - # @param after [String] - # @param before [String] - # @param include [Array] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Beta::Threads::Runs::StepListParams::Order] + # @param run_id [String] Path param: The ID of the run the run steps belong to. + # + # @param thread_id [String] Path param: The ID of the thread the run and run steps belong to. + # + # @param after [String] Query param: A cursor for use in pagination. `after` is an object ID that define + # ... + # + # @param before [String] Query param: A cursor for use in pagination. `before` is an object ID that defin + # ... + # + # @param include [Array] Query param: A list of additional fields to include in the response. Currently t + # ... + # + # @param limit [Integer] Query param: A limit on the number of objects to be returned. Limit can range be + # ... + # + # @param order [Symbol, OpenAI::Models::Beta::Threads::Runs::StepListParams::Order] Query param: Sort order by the `created_at` timestamp of the objects. `asc` for + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] diff --git a/lib/openai/resources/chat/completions.rb b/lib/openai/resources/chat/completions.rb index 51ba4c47..66a4c48c 100644 --- a/lib/openai/resources/chat/completions.rb +++ b/lib/openai/resources/chat/completions.rb @@ -9,6 +9,9 @@ class Completions # See {OpenAI::Resources::Chat::Completions#stream_raw} for streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionCreateParams} for more details. + # # **Starting a new project?** We recommend trying # [Responses](https://platform.openai.com/docs/api-reference/responses) to take # advantage of the latest OpenAI platform features. Compare @@ -29,36 +32,73 @@ class Completions # # @overload create(messages:, model:, audio: nil, frequency_penalty: nil, function_call: nil, functions: nil, logit_bias: nil, logprobs: nil, max_completion_tokens: nil, max_tokens: nil, metadata: nil, modalities: nil, n: nil, parallel_tool_calls: nil, prediction: nil, presence_penalty: nil, reasoning_effort: nil, response_format: nil, seed: nil, service_tier: nil, stop: nil, store: nil, stream_options: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, user: nil, web_search_options: nil, request_options: {}) # - # @param messages [Array] - # @param model [String, Symbol, OpenAI::Models::ChatModel] - # @param audio [OpenAI::Models::Chat::ChatCompletionAudioParam, nil] - # @param frequency_penalty [Float, nil] - # @param function_call [Symbol, OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode, OpenAI::Models::Chat::ChatCompletionFunctionCallOption] - # @param functions [Array] - # @param logit_bias [Hash{Symbol=>Integer}, nil] - # @param logprobs [Boolean, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param modalities [Array, nil] - # @param n [Integer, nil] - # @param parallel_tool_calls [Boolean] - # @param prediction [OpenAI::Models::Chat::ChatCompletionPredictionContent, nil] - # @param presence_penalty [Float, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] - # @param seed [Integer, nil] - # @param service_tier [Symbol, OpenAI::Models::Chat::CompletionCreateParams::ServiceTier, nil] - # @param stop [String, Array, nil] - # @param store [Boolean, nil] - # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] - # @param temperature [Float, nil] - # @param tool_choice [Symbol, OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto, OpenAI::Models::Chat::ChatCompletionNamedToolChoice] - # @param tools [Array] - # @param top_logprobs [Integer, nil] - # @param top_p [Float, nil] - # @param user [String] - # @param web_search_options [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions] + # @param messages [Array] A list of messages comprising the conversation so far. Depending on the ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel] Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI ... + # + # @param audio [OpenAI::Models::Chat::ChatCompletionAudioParam, nil] Parameters for audio output. Required when audio output is requested with ... + # + # @param frequency_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on ... + # + # @param function_call [Symbol, OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode, OpenAI::Models::Chat::ChatCompletionFunctionCallOption] Deprecated in favor of `tool_choice`. ... + # + # @param functions [Array] Deprecated in favor of `tools`. ... + # + # @param logit_bias [Hash{Symbol=>Integer}, nil] Modify the likelihood of specified tokens appearing in the completion. ... + # + # @param logprobs [Boolean, nil] Whether to return log probabilities of the output tokens or not. If true, ... + # + # @param max_completion_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a completion, + # ... + # + # @param max_tokens [Integer, nil] The maximum number of [tokens](/tokenizer) that can be generated in the ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param modalities [Array, nil] Output types that you would like the model to generate. ... + # + # @param n [Integer, nil] How many chat completion choices to generate for each input message. Note that y + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param prediction [OpenAI::Models::Chat::ChatCompletionPredictionContent, nil] Static predicted output content, such as the content of a text file that is ... + # + # @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] An object specifying the format that the model must output. ... + # + # @param seed [Integer, nil] This feature is in Beta. ... + # + # @param service_tier [Symbol, OpenAI::Models::Chat::CompletionCreateParams::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param stop [String, Array, nil] Not supported with latest reasoning models `o3` and `o4-mini`. ... + # + # @param store [Boolean, nil] Whether or not to store the output of this chat completion request for ... + # + # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] Options for streaming response. Only set this when you set `stream: true`. ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto, OpenAI::Models::Chat::ChatCompletionNamedToolChoice] Controls which (if any) tool is called by the model. ... + # + # @param tools [Array] A list of tools the model may call. Currently, only functions are supported as a + # ... + # + # @param top_logprobs [Integer, nil] An integer between 0 and 20 specifying the number of most likely tokens to ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # + # @param web_search_options [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions] This tool searches the web for relevant results to use in a response. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Chat::ChatCompletion] @@ -85,6 +125,9 @@ def stream # See {OpenAI::Resources::Chat::Completions#create} for non-streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionCreateParams} for more details. + # # **Starting a new project?** We recommend trying # [Responses](https://platform.openai.com/docs/api-reference/responses) to take # advantage of the latest OpenAI platform features. Compare @@ -105,36 +148,73 @@ def stream # # @overload stream_raw(messages:, model:, audio: nil, frequency_penalty: nil, function_call: nil, functions: nil, logit_bias: nil, logprobs: nil, max_completion_tokens: nil, max_tokens: nil, metadata: nil, modalities: nil, n: nil, parallel_tool_calls: nil, prediction: nil, presence_penalty: nil, reasoning_effort: nil, response_format: nil, seed: nil, service_tier: nil, stop: nil, store: nil, stream_options: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, user: nil, web_search_options: nil, request_options: {}) # - # @param messages [Array] - # @param model [String, Symbol, OpenAI::Models::ChatModel] - # @param audio [OpenAI::Models::Chat::ChatCompletionAudioParam, nil] - # @param frequency_penalty [Float, nil] - # @param function_call [Symbol, OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode, OpenAI::Models::Chat::ChatCompletionFunctionCallOption] - # @param functions [Array] - # @param logit_bias [Hash{Symbol=>Integer}, nil] - # @param logprobs [Boolean, nil] - # @param max_completion_tokens [Integer, nil] - # @param max_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param modalities [Array, nil] - # @param n [Integer, nil] - # @param parallel_tool_calls [Boolean] - # @param prediction [OpenAI::Models::Chat::ChatCompletionPredictionContent, nil] - # @param presence_penalty [Float, nil] - # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] - # @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] - # @param seed [Integer, nil] - # @param service_tier [Symbol, OpenAI::Models::Chat::CompletionCreateParams::ServiceTier, nil] - # @param stop [String, Array, nil] - # @param store [Boolean, nil] - # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] - # @param temperature [Float, nil] - # @param tool_choice [Symbol, OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto, OpenAI::Models::Chat::ChatCompletionNamedToolChoice] - # @param tools [Array] - # @param top_logprobs [Integer, nil] - # @param top_p [Float, nil] - # @param user [String] - # @param web_search_options [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions] + # @param messages [Array] A list of messages comprising the conversation so far. Depending on the ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel] Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI ... + # + # @param audio [OpenAI::Models::Chat::ChatCompletionAudioParam, nil] Parameters for audio output. Required when audio output is requested with ... + # + # @param frequency_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on ... + # + # @param function_call [Symbol, OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode, OpenAI::Models::Chat::ChatCompletionFunctionCallOption] Deprecated in favor of `tool_choice`. ... + # + # @param functions [Array] Deprecated in favor of `tools`. ... + # + # @param logit_bias [Hash{Symbol=>Integer}, nil] Modify the likelihood of specified tokens appearing in the completion. ... + # + # @param logprobs [Boolean, nil] Whether to return log probabilities of the output tokens or not. If true, ... + # + # @param max_completion_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a completion, + # ... + # + # @param max_tokens [Integer, nil] The maximum number of [tokens](/tokenizer) that can be generated in the ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param modalities [Array, nil] Output types that you would like the model to generate. ... + # + # @param n [Integer, nil] How many chat completion choices to generate for each input message. Note that y + # ... + # + # @param parallel_tool_calls [Boolean] Whether to enable [parallel function calling](https://platform.openai.com/docs/g + # ... + # + # @param prediction [OpenAI::Models::Chat::ChatCompletionPredictionContent, nil] Static predicted output content, such as the content of a text file that is ... + # + # @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on ... + # + # @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] **o-series models only** ... + # + # @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] An object specifying the format that the model must output. ... + # + # @param seed [Integer, nil] This feature is in Beta. ... + # + # @param service_tier [Symbol, OpenAI::Models::Chat::CompletionCreateParams::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param stop [String, Array, nil] Not supported with latest reasoning models `o3` and `o4-mini`. ... + # + # @param store [Boolean, nil] Whether or not to store the output of this chat completion request for ... + # + # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] Options for streaming response. Only set this when you set `stream: true`. ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param tool_choice [Symbol, OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto, OpenAI::Models::Chat::ChatCompletionNamedToolChoice] Controls which (if any) tool is called by the model. ... + # + # @param tools [Array] A list of tools the model may call. Currently, only functions are supported as a + # ... + # + # @param top_logprobs [Integer, nil] An integer between 0 and 20 specifying the number of most likely tokens to ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # + # @param web_search_options [OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions] This tool searches the web for relevant results to use in a response. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Stream] @@ -163,7 +243,8 @@ def stream_raw(params) # # @overload retrieve(completion_id, request_options: {}) # - # @param completion_id [String] + # @param completion_id [String] The ID of the chat completion to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Chat::ChatCompletion] @@ -178,14 +259,19 @@ def retrieve(completion_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionUpdateParams} for more details. + # # Modify a stored chat completion. Only Chat Completions that have been created # with the `store` parameter set to `true` can be modified. Currently, the only # supported modification is to update the `metadata` field. # # @overload update(completion_id, metadata:, request_options: {}) # - # @param completion_id [String] - # @param metadata [Hash{Symbol=>String}, nil] + # @param completion_id [String] The ID of the chat completion to update. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Chat::ChatCompletion] @@ -202,16 +288,25 @@ def update(completion_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::CompletionListParams} for more details. + # # List stored Chat Completions. Only Chat Completions that have been stored with # the `store` parameter set to `true` will be returned. # # @overload list(after: nil, limit: nil, metadata: nil, model: nil, order: nil, request_options: {}) # - # @param after [String] - # @param limit [Integer] - # @param metadata [Hash{Symbol=>String}, nil] - # @param model [String] - # @param order [Symbol, OpenAI::Models::Chat::CompletionListParams::Order] + # @param after [String] Identifier for the last chat completion from the previous pagination request. + # + # @param limit [Integer] Number of Chat Completions to retrieve. + # + # @param metadata [Hash{Symbol=>String}, nil] A list of metadata keys to filter the Chat Completions by. Example: ... + # + # @param model [String] The model used to generate the Chat Completions. + # + # @param order [Symbol, OpenAI::Models::Chat::CompletionListParams::Order] Sort order for Chat Completions by timestamp. Use `asc` for ascending order or ` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -234,7 +329,8 @@ def list(params = {}) # # @overload delete(completion_id, request_options: {}) # - # @param completion_id [String] + # @param completion_id [String] The ID of the chat completion to delete. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Chat::ChatCompletionDeleted] diff --git a/lib/openai/resources/chat/completions/messages.rb b/lib/openai/resources/chat/completions/messages.rb index ab3a3e19..a1dd20ca 100644 --- a/lib/openai/resources/chat/completions/messages.rb +++ b/lib/openai/resources/chat/completions/messages.rb @@ -5,15 +5,23 @@ module Resources class Chat class Completions class Messages + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Chat::Completions::MessageListParams} for more details. + # # Get the messages in a stored chat completion. Only Chat Completions that have # been created with the `store` parameter set to `true` will be returned. # # @overload list(completion_id, after: nil, limit: nil, order: nil, request_options: {}) # - # @param completion_id [String] - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Chat::Completions::MessageListParams::Order] + # @param completion_id [String] The ID of the chat completion to retrieve messages from. + # + # @param after [String] Identifier for the last message from the previous pagination request. + # + # @param limit [Integer] Number of messages to retrieve. + # + # @param order [Symbol, OpenAI::Models::Chat::Completions::MessageListParams::Order] Sort order for messages by timestamp. Use `asc` for ascending order or `desc` fo + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] diff --git a/lib/openai/resources/completions.rb b/lib/openai/resources/completions.rb index 859c6b7f..7b563203 100644 --- a/lib/openai/resources/completions.rb +++ b/lib/openai/resources/completions.rb @@ -5,27 +5,58 @@ module Resources class Completions # See {OpenAI::Resources::Completions#create_streaming} for streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::CompletionCreateParams} for more details. + # # Creates a completion for the provided prompt and parameters. # # @overload create(model:, prompt:, best_of: nil, echo: nil, frequency_penalty: nil, logit_bias: nil, logprobs: nil, max_tokens: nil, n: nil, presence_penalty: nil, seed: nil, stop: nil, stream_options: nil, suffix: nil, temperature: nil, top_p: nil, user: nil, request_options: {}) # - # @param model [String, Symbol, OpenAI::Models::CompletionCreateParams::Model] - # @param prompt [String, Array, Array, Array>, nil] - # @param best_of [Integer, nil] - # @param echo [Boolean, nil] - # @param frequency_penalty [Float, nil] - # @param logit_bias [Hash{Symbol=>Integer}, nil] - # @param logprobs [Integer, nil] - # @param max_tokens [Integer, nil] - # @param n [Integer, nil] - # @param presence_penalty [Float, nil] - # @param seed [Integer, nil] - # @param stop [String, Array, nil] - # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] - # @param suffix [String, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param user [String] + # @param model [String, Symbol, OpenAI::Models::CompletionCreateParams::Model] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param prompt [String, Array, Array, Array>, nil] The prompt(s) to generate completions for, encoded as a string, array of strings + # ... + # + # @param best_of [Integer, nil] Generates `best_of` completions server-side and returns the "best" (the one with + # ... + # + # @param echo [Boolean, nil] Echo back the prompt in addition to the completion ... + # + # @param frequency_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on their + # ... + # + # @param logit_bias [Hash{Symbol=>Integer}, nil] Modify the likelihood of specified tokens appearing in the completion. ... + # + # @param logprobs [Integer, nil] Include the log probabilities on the `logprobs` most likely output tokens, as we + # ... + # + # @param max_tokens [Integer, nil] The maximum number of [tokens](/tokenizer) that can be generated in the completi + # ... + # + # @param n [Integer, nil] How many completions to generate for each prompt. ... + # + # @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on whethe + # ... + # + # @param seed [Integer, nil] If specified, our system will make a best effort to sample deterministically, su + # ... + # + # @param stop [String, Array, nil] Not supported with latest reasoning models `o3` and `o4-mini`. ... + # + # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] Options for streaming response. Only set this when you set `stream: true`. ... + # + # @param suffix [String, nil] The suffix that comes after a completion of inserted text. ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Completion] @@ -48,27 +79,58 @@ def create(params) # See {OpenAI::Resources::Completions#create} for non-streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::CompletionCreateParams} for more details. + # # Creates a completion for the provided prompt and parameters. # # @overload create_streaming(model:, prompt:, best_of: nil, echo: nil, frequency_penalty: nil, logit_bias: nil, logprobs: nil, max_tokens: nil, n: nil, presence_penalty: nil, seed: nil, stop: nil, stream_options: nil, suffix: nil, temperature: nil, top_p: nil, user: nil, request_options: {}) # - # @param model [String, Symbol, OpenAI::Models::CompletionCreateParams::Model] - # @param prompt [String, Array, Array, Array>, nil] - # @param best_of [Integer, nil] - # @param echo [Boolean, nil] - # @param frequency_penalty [Float, nil] - # @param logit_bias [Hash{Symbol=>Integer}, nil] - # @param logprobs [Integer, nil] - # @param max_tokens [Integer, nil] - # @param n [Integer, nil] - # @param presence_penalty [Float, nil] - # @param seed [Integer, nil] - # @param stop [String, Array, nil] - # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] - # @param suffix [String, nil] - # @param temperature [Float, nil] - # @param top_p [Float, nil] - # @param user [String] + # @param model [String, Symbol, OpenAI::Models::CompletionCreateParams::Model] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param prompt [String, Array, Array, Array>, nil] The prompt(s) to generate completions for, encoded as a string, array of strings + # ... + # + # @param best_of [Integer, nil] Generates `best_of` completions server-side and returns the "best" (the one with + # ... + # + # @param echo [Boolean, nil] Echo back the prompt in addition to the completion ... + # + # @param frequency_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on their + # ... + # + # @param logit_bias [Hash{Symbol=>Integer}, nil] Modify the likelihood of specified tokens appearing in the completion. ... + # + # @param logprobs [Integer, nil] Include the log probabilities on the `logprobs` most likely output tokens, as we + # ... + # + # @param max_tokens [Integer, nil] The maximum number of [tokens](/tokenizer) that can be generated in the completi + # ... + # + # @param n [Integer, nil] How many completions to generate for each prompt. ... + # + # @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on whethe + # ... + # + # @param seed [Integer, nil] If specified, our system will make a best effort to sample deterministically, su + # ... + # + # @param stop [String, Array, nil] Not supported with latest reasoning models `o3` and `o4-mini`. ... + # + # @param stream_options [OpenAI::Models::Chat::ChatCompletionStreamOptions, nil] Options for streaming response. Only set this when you set `stream: true`. ... + # + # @param suffix [String, nil] The suffix that comes after a completion of inserted text. ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, where the + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Stream] diff --git a/lib/openai/resources/embeddings.rb b/lib/openai/resources/embeddings.rb index f9a2281d..2e0577e6 100644 --- a/lib/openai/resources/embeddings.rb +++ b/lib/openai/resources/embeddings.rb @@ -3,15 +3,28 @@ module OpenAI module Resources class Embeddings + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EmbeddingCreateParams} for more details. + # # Creates an embedding vector representing the input text. # # @overload create(input:, model:, dimensions: nil, encoding_format: nil, user: nil, request_options: {}) # - # @param input [String, Array, Array, Array>] - # @param model [String, Symbol, OpenAI::Models::EmbeddingModel] - # @param dimensions [Integer] - # @param encoding_format [Symbol, OpenAI::Models::EmbeddingCreateParams::EncodingFormat] - # @param user [String] + # @param input [String, Array, Array, Array>] Input text to embed, encoded as a string or array of tokens. To embed multiple i + # ... + # + # @param model [String, Symbol, OpenAI::Models::EmbeddingModel] ID of the model to use. You can use the [List models](https://platform.openai.co + # ... + # + # @param dimensions [Integer] The number of dimensions the resulting output embeddings should have. Only suppo + # ... + # + # @param encoding_format [Symbol, OpenAI::Models::EmbeddingCreateParams::EncodingFormat] The format to return the embeddings in. Can be either `float` or [`base64`](http + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::CreateEmbeddingResponse] diff --git a/lib/openai/resources/evals.rb b/lib/openai/resources/evals.rb index 2996ff10..9decea6d 100644 --- a/lib/openai/resources/evals.rb +++ b/lib/openai/resources/evals.rb @@ -6,6 +6,9 @@ class Evals # @return [OpenAI::Resources::Evals::Runs] attr_reader :runs + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalCreateParams} for more details. + # # Create the structure of an evaluation that can be used to test a model's # performance. An evaluation is a set of testing criteria and a datasource. After # creating an evaluation, you can run it on different models and model parameters. @@ -14,10 +17,14 @@ class Evals # # @overload create(data_source_config:, testing_criteria:, metadata: nil, name: nil, request_options: {}) # - # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] - # @param testing_criteria [Array] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # @param data_source_config [OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs] The configuration for the data source used for the evaluation runs. + # + # @param testing_criteria [Array] A list of graders for all eval runs in this group. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the evaluation. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::EvalCreateResponse] @@ -38,7 +45,8 @@ def create(params) # # @overload retrieve(eval_id, request_options: {}) # - # @param eval_id [String] + # @param eval_id [String] The ID of the evaluation to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::EvalRetrieveResponse] @@ -53,13 +61,19 @@ def retrieve(eval_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalUpdateParams} for more details. + # # Update certain properties of an evaluation. # # @overload update(eval_id, metadata: nil, name: nil, request_options: {}) # - # @param eval_id [String] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # @param eval_id [String] The ID of the evaluation to update. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] Rename the evaluation. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::EvalUpdateResponse] @@ -76,14 +90,22 @@ def update(eval_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::EvalListParams} for more details. + # # List evaluations for a project. # # @overload list(after: nil, limit: nil, order: nil, order_by: nil, request_options: {}) # - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::EvalListParams::Order] - # @param order_by [Symbol, OpenAI::Models::EvalListParams::OrderBy] + # @param after [String] Identifier for the last eval from the previous pagination request. + # + # @param limit [Integer] Number of evals to retrieve. + # + # @param order [Symbol, OpenAI::Models::EvalListParams::Order] Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for d + # ... + # + # @param order_by [Symbol, OpenAI::Models::EvalListParams::OrderBy] Evals can be ordered by creation time or last updated time. Use ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -105,7 +127,8 @@ def list(params = {}) # # @overload delete(eval_id, request_options: {}) # - # @param eval_id [String] + # @param eval_id [String] The ID of the evaluation to delete. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::EvalDeleteResponse] diff --git a/lib/openai/resources/evals/runs.rb b/lib/openai/resources/evals/runs.rb index 77980ec8..0bd63a75 100644 --- a/lib/openai/resources/evals/runs.rb +++ b/lib/openai/resources/evals/runs.rb @@ -7,14 +7,21 @@ class Runs # @return [OpenAI::Resources::Evals::Runs::OutputItems] attr_reader :output_items + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunCreateParams} for more details. + # # Create a new evaluation run. This is the endpoint that will kick off grading. # # @overload create(eval_id, data_source:, metadata: nil, name: nil, request_options: {}) # - # @param eval_id [String] - # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # @param eval_id [String] The ID of the evaluation to create a run for. + # + # @param data_source [OpenAI::Models::Evals::CreateEvalJSONLRunDataSource, OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource, OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource] Details about the run's data source. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the run. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Evals::RunCreateResponse] @@ -35,8 +42,10 @@ def create(eval_id, params) # # @overload retrieve(run_id, eval_id:, request_options: {}) # - # @param run_id [String] - # @param eval_id [String] + # @param run_id [String] The ID of the run to retrieve. + # + # @param eval_id [String] The ID of the evaluation to retrieve runs for. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Evals::RunRetrieveResponse] @@ -56,15 +65,25 @@ def retrieve(run_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::RunListParams} for more details. + # # Get a list of runs for an evaluation. # # @overload list(eval_id, after: nil, limit: nil, order: nil, status: nil, request_options: {}) # - # @param eval_id [String] - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Evals::RunListParams::Order] - # @param status [Symbol, OpenAI::Models::Evals::RunListParams::Status] + # @param eval_id [String] The ID of the evaluation to retrieve runs for. + # + # @param after [String] Identifier for the last run from the previous pagination request. + # + # @param limit [Integer] Number of runs to retrieve. + # + # @param order [Symbol, OpenAI::Models::Evals::RunListParams::Order] Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for de + # ... + # + # @param status [Symbol, OpenAI::Models::Evals::RunListParams::Status] Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -86,8 +105,10 @@ def list(eval_id, params = {}) # # @overload delete(run_id, eval_id:, request_options: {}) # - # @param run_id [String] - # @param eval_id [String] + # @param run_id [String] The ID of the run to delete. + # + # @param eval_id [String] The ID of the evaluation to delete the run from. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Evals::RunDeleteResponse] @@ -111,8 +132,10 @@ def delete(run_id, params) # # @overload cancel(run_id, eval_id:, request_options: {}) # - # @param run_id [String] - # @param eval_id [String] + # @param run_id [String] The ID of the run to cancel. + # + # @param eval_id [String] The ID of the evaluation whose run you want to cancel. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Evals::RunCancelResponse] diff --git a/lib/openai/resources/evals/runs/output_items.rb b/lib/openai/resources/evals/runs/output_items.rb index eb6914ba..04624e2d 100644 --- a/lib/openai/resources/evals/runs/output_items.rb +++ b/lib/openai/resources/evals/runs/output_items.rb @@ -9,9 +9,12 @@ class OutputItems # # @overload retrieve(output_item_id, eval_id:, run_id:, request_options: {}) # - # @param output_item_id [String] - # @param eval_id [String] - # @param run_id [String] + # @param output_item_id [String] The ID of the output item to retrieve. + # + # @param eval_id [String] The ID of the evaluation to retrieve runs for. + # + # @param run_id [String] The ID of the run to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse] @@ -35,16 +38,28 @@ def retrieve(output_item_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Evals::Runs::OutputItemListParams} for more details. + # # Get a list of output items for an evaluation run. # # @overload list(run_id, eval_id:, after: nil, limit: nil, order: nil, status: nil, request_options: {}) # - # @param run_id [String] - # @param eval_id [String] - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Order] - # @param status [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Status] + # @param run_id [String] Path param: The ID of the run to retrieve output items for. + # + # @param eval_id [String] Path param: The ID of the evaluation to retrieve runs for. + # + # @param after [String] Query param: Identifier for the last output item from the previous pagination re + # ... + # + # @param limit [Integer] Query param: Number of output items to retrieve. + # + # @param order [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Order] Query param: Sort order for output items by timestamp. Use `asc` for ascending o + # ... + # + # @param status [Symbol, OpenAI::Models::Evals::Runs::OutputItemListParams::Status] Query param: Filter output items by status. Use `failed` to filter by failed out + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] diff --git a/lib/openai/resources/files.rb b/lib/openai/resources/files.rb index f107ee07..726182c0 100644 --- a/lib/openai/resources/files.rb +++ b/lib/openai/resources/files.rb @@ -3,6 +3,9 @@ module OpenAI module Resources class Files + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FileCreateParams} for more details. + # # Upload a file that can be used across various endpoints. Individual files can be # up to 512 MB, and the size of all files uploaded by one organization can be up # to 100 GB. @@ -27,8 +30,11 @@ class Files # # @overload create(file:, purpose:, request_options: {}) # - # @param file [Pathname, StringIO] - # @param purpose [Symbol, OpenAI::Models::FilePurpose] + # @param file [Pathname, StringIO] The File object (not file name) to be uploaded. ... + # + # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of: - `assistants`: Used in the A + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FileObject] @@ -50,7 +56,8 @@ def create(params) # # @overload retrieve(file_id, request_options: {}) # - # @param file_id [String] + # @param file_id [String] The ID of the file to use for this request. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FileObject] @@ -65,14 +72,24 @@ def retrieve(file_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FileListParams} for more details. + # # Returns a list of files. # # @overload list(after: nil, limit: nil, order: nil, purpose: nil, request_options: {}) # - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::FileListParams::Order] - # @param purpose [String] + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::FileListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # + # @param purpose [String] Only return files with the given purpose. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -94,7 +111,8 @@ def list(params = {}) # # @overload delete(file_id, request_options: {}) # - # @param file_id [String] + # @param file_id [String] The ID of the file to use for this request. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FileDeleted] @@ -113,7 +131,8 @@ def delete(file_id, params = {}) # # @overload content(file_id, request_options: {}) # - # @param file_id [String] + # @param file_id [String] The ID of the file to use for this request. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [StringIO] diff --git a/lib/openai/resources/fine_tuning/checkpoints/permissions.rb b/lib/openai/resources/fine_tuning/checkpoints/permissions.rb index 38c9fe03..1d609a0a 100644 --- a/lib/openai/resources/fine_tuning/checkpoints/permissions.rb +++ b/lib/openai/resources/fine_tuning/checkpoints/permissions.rb @@ -5,6 +5,10 @@ module Resources class FineTuning class Checkpoints class Permissions + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::Checkpoints::PermissionCreateParams} for more + # details. + # # **NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys). # # This enables organization owners to share fine-tuned models with other projects @@ -12,8 +16,10 @@ class Permissions # # @overload create(fine_tuned_model_checkpoint, project_ids:, request_options: {}) # - # @param fine_tuned_model_checkpoint [String] - # @param project_ids [Array] + # @param fine_tuned_model_checkpoint [String] The ID of the fine-tuned model checkpoint to create a permission for. ... + # + # @param project_ids [Array] The project identifiers to grant access to. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Page] @@ -31,6 +37,10 @@ def create(fine_tuned_model_checkpoint, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveParams} for more + # details. + # # **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). # # Organization owners can use this endpoint to view all permissions for a @@ -38,11 +48,16 @@ def create(fine_tuned_model_checkpoint, params) # # @overload retrieve(fine_tuned_model_checkpoint, after: nil, limit: nil, order: nil, project_id: nil, request_options: {}) # - # @param fine_tuned_model_checkpoint [String] - # @param after [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveParams::Order] - # @param project_id [String] + # @param fine_tuned_model_checkpoint [String] The ID of the fine-tuned model checkpoint to get permissions for. ... + # + # @param after [String] Identifier for the last permission ID from the previous pagination request. + # + # @param limit [Integer] Number of permissions to retrieve. + # + # @param order [Symbol, OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveParams::Order] The order in which to retrieve permissions. + # + # @param project_id [String] The ID of the project to get permissions for. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse] @@ -59,6 +74,10 @@ def retrieve(fine_tuned_model_checkpoint, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteParams} for more + # details. + # # **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). # # Organization owners can use this endpoint to delete a permission for a @@ -66,8 +85,10 @@ def retrieve(fine_tuned_model_checkpoint, params = {}) # # @overload delete(permission_id, fine_tuned_model_checkpoint:, request_options: {}) # - # @param permission_id [String] - # @param fine_tuned_model_checkpoint [String] + # @param permission_id [String] The ID of the fine-tuned model checkpoint permission to delete. ... + # + # @param fine_tuned_model_checkpoint [String] The ID of the fine-tuned model checkpoint to delete a permission for. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteResponse] diff --git a/lib/openai/resources/fine_tuning/jobs.rb b/lib/openai/resources/fine_tuning/jobs.rb index 50cf5b51..ba29a2ea 100644 --- a/lib/openai/resources/fine_tuning/jobs.rb +++ b/lib/openai/resources/fine_tuning/jobs.rb @@ -7,6 +7,9 @@ class Jobs # @return [OpenAI::Resources::FineTuning::Jobs::Checkpoints] attr_reader :checkpoints + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCreateParams} for more details. + # # Creates a fine-tuning job which begins the process of creating a new model from # a given dataset. # @@ -17,15 +20,26 @@ class Jobs # # @overload create(model:, training_file:, hyperparameters: nil, integrations: nil, metadata: nil, method_: nil, seed: nil, suffix: nil, validation_file: nil, request_options: {}) # - # @param model [String, Symbol, OpenAI::Models::FineTuning::JobCreateParams::Model] - # @param training_file [String] - # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters] - # @param integrations [Array, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param method_ [OpenAI::Models::FineTuning::JobCreateParams::Method] - # @param seed [Integer, nil] - # @param suffix [String, nil] - # @param validation_file [String, nil] + # @param model [String, Symbol, OpenAI::Models::FineTuning::JobCreateParams::Model] The name of the model to fine-tune. You can select one of the ... + # + # @param training_file [String] The ID of an uploaded file that contains training data. ... + # + # @param hyperparameters [OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters] The hyperparameters used for the fine-tuning job. ... + # + # @param integrations [Array, nil] A list of integrations to enable for your fine-tuning job. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param method_ [OpenAI::Models::FineTuning::JobCreateParams::Method] The method used for fine-tuning. + # + # @param seed [Integer, nil] The seed controls the reproducibility of the job. Passing in the same seed and j + # ... + # + # @param suffix [String, nil] A string of up to 64 characters that will be added to your fine-tuned model name + # ... + # + # @param validation_file [String, nil] The ID of an uploaded file that contains validation data. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FineTuning::FineTuningJob] @@ -42,13 +56,17 @@ def create(params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobRetrieveParams} for more details. + # # Get info about a fine-tuning job. # # [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning) # # @overload retrieve(fine_tuning_job_id, request_options: {}) # - # @param fine_tuning_job_id [String] + # @param fine_tuning_job_id [String] The ID of the fine-tuning job. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FineTuning::FineTuningJob] @@ -63,13 +81,20 @@ def retrieve(fine_tuning_job_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobListParams} for more details. + # # List your organization's fine-tuning jobs # # @overload list(after: nil, limit: nil, metadata: nil, request_options: {}) # - # @param after [String] - # @param limit [Integer] - # @param metadata [Hash{Symbol=>String}, nil] + # @param after [String] Identifier for the last job from the previous pagination request. + # + # @param limit [Integer] Number of fine-tuning jobs to retrieve. + # + # @param metadata [Hash{Symbol=>String}, nil] Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternative + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -87,11 +112,15 @@ def list(params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobCancelParams} for more details. + # # Immediately cancel a fine-tune job. # # @overload cancel(fine_tuning_job_id, request_options: {}) # - # @param fine_tuning_job_id [String] + # @param fine_tuning_job_id [String] The ID of the fine-tuning job to cancel. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::FineTuning::FineTuningJob] @@ -106,13 +135,19 @@ def cancel(fine_tuning_job_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::JobListEventsParams} for more details. + # # Get status updates for a fine-tuning job. # # @overload list_events(fine_tuning_job_id, after: nil, limit: nil, request_options: {}) # - # @param fine_tuning_job_id [String] - # @param after [String] - # @param limit [Integer] + # @param fine_tuning_job_id [String] The ID of the fine-tuning job to get events for. ... + # + # @param after [String] Identifier for the last event from the previous pagination request. + # + # @param limit [Integer] Number of events to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] diff --git a/lib/openai/resources/fine_tuning/jobs/checkpoints.rb b/lib/openai/resources/fine_tuning/jobs/checkpoints.rb index b8195545..2b5e1d8e 100644 --- a/lib/openai/resources/fine_tuning/jobs/checkpoints.rb +++ b/lib/openai/resources/fine_tuning/jobs/checkpoints.rb @@ -5,13 +5,19 @@ module Resources class FineTuning class Jobs class Checkpoints + # Some parameter documentations has been truncated, see + # {OpenAI::Models::FineTuning::Jobs::CheckpointListParams} for more details. + # # List checkpoints for a fine-tuning job. # # @overload list(fine_tuning_job_id, after: nil, limit: nil, request_options: {}) # - # @param fine_tuning_job_id [String] - # @param after [String] - # @param limit [Integer] + # @param fine_tuning_job_id [String] The ID of the fine-tuning job to get checkpoints for. ... + # + # @param after [String] Identifier for the last checkpoint ID from the previous pagination request. + # + # @param limit [Integer] Number of checkpoints to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] diff --git a/lib/openai/resources/images.rb b/lib/openai/resources/images.rb index 40bfb0e5..e5f8f465 100644 --- a/lib/openai/resources/images.rb +++ b/lib/openai/resources/images.rb @@ -3,16 +3,30 @@ module OpenAI module Resources class Images + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ImageCreateVariationParams} for more details. + # # Creates a variation of a given image. This endpoint only supports `dall-e-2`. # # @overload create_variation(image:, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) # - # @param image [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] - # @param n [Integer, nil] - # @param response_format [Symbol, OpenAI::Models::ImageCreateVariationParams::ResponseFormat, nil] - # @param size [Symbol, OpenAI::Models::ImageCreateVariationParams::Size, nil] - # @param user [String] + # @param image [Pathname, StringIO] The image to use as the basis for the variation(s). Must be a valid PNG file, le + # ... + # + # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` is supported at this time + # ... + # + # @param n [Integer, nil] The number of images to generate. Must be between 1 and 10. + # + # @param response_format [Symbol, OpenAI::Models::ImageCreateVariationParams::ResponseFormat, nil] The format in which the generated images are returned. Must be one of `url` or ` + # ... + # + # @param size [Symbol, OpenAI::Models::ImageCreateVariationParams::Size, nil] The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::ImagesResponse] @@ -30,20 +44,40 @@ def create_variation(params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ImageEditParams} for more details. + # # Creates an edited or extended image given one or more source images and a # prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`. # # @overload edit(image:, prompt:, mask: nil, model: nil, n: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {}) # - # @param image [Pathname, StringIO, Array] - # @param prompt [String] - # @param mask [Pathname, StringIO] - # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] - # @param n [Integer, nil] - # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] - # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] - # @param size [Symbol, OpenAI::Models::ImageEditParams::Size, nil] - # @param user [String] + # @param image [Pathname, StringIO, Array] The image(s) to edit. Must be a supported image file or an array of images. For + # ... + # + # @param prompt [String] A text description of the desired image(s). The maximum length is 1000 character + # ... + # + # @param mask [Pathname, StringIO] An additional image whose fully transparent areas (e.g. where alpha is zero) ind + # ... + # + # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are sup + # ... + # + # @param n [Integer, nil] The number of images to generate. Must be between 1 and 10. + # + # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated. `high`, `medium` and `low` are + # ... + # + # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] The format in which the generated images are returned. Must be one of `url` or ` + # ... + # + # @param size [Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. Must be one of `1024x1024`, `1536x1024` (lands + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::ImagesResponse] @@ -61,23 +95,48 @@ def edit(params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ImageGenerateParams} for more details. + # # Creates an image given a prompt. # [Learn more](https://platform.openai.com/docs/guides/images). # # @overload generate(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {}) # - # @param prompt [String] - # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] - # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] - # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil] - # @param n [Integer, nil] - # @param output_compression [Integer, nil] - # @param output_format [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil] - # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil] - # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] - # @param size [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] - # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] - # @param user [String] + # @param prompt [String] A text description of the desired image(s). The maximum length is 32000 characte + # ... + # + # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). ... + # + # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or `gpt-im + # ... + # + # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil] Control the content-moderation level for images generated by `gpt-image-1`. Must + # ... + # + # @param n [Integer, nil] The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only + # ... + # + # @param output_compression [Integer, nil] The compression level (0-100%) for the generated images. This parameter is only + # ... + # + # @param output_format [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil] The format in which the generated images are returned. This parameter is only su + # ... + # + # @param quality [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil] The quality of the image that will be generated. ... + # + # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] The format in which generated images with `dall-e-2` and `dall-e-3` are returned + # ... + # + # @param size [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. Must be one of `1024x1024`, `1536x1024` (lands + # ... + # + # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] The style of the generated images. This parameter is only supported for `dall-e- + # ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::ImagesResponse] diff --git a/lib/openai/resources/models.rb b/lib/openai/resources/models.rb index b77422d4..afe9d3e1 100644 --- a/lib/openai/resources/models.rb +++ b/lib/openai/resources/models.rb @@ -8,7 +8,8 @@ class Models # # @overload retrieve(model, request_options: {}) # - # @param model [String] + # @param model [String] The ID of the model to use for this request + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Model] @@ -48,7 +49,8 @@ def list(params = {}) # # @overload delete(model, request_options: {}) # - # @param model [String] + # @param model [String] The model to delete + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::ModelDeleted] diff --git a/lib/openai/resources/moderations.rb b/lib/openai/resources/moderations.rb index 6df4561d..443d6b18 100644 --- a/lib/openai/resources/moderations.rb +++ b/lib/openai/resources/moderations.rb @@ -3,13 +3,19 @@ module OpenAI module Resources class Moderations + # Some parameter documentations has been truncated, see + # {OpenAI::Models::ModerationCreateParams} for more details. + # # Classifies if text and/or image inputs are potentially harmful. Learn more in # the [moderation guide](https://platform.openai.com/docs/guides/moderation). # # @overload create(input:, model: nil, request_options: {}) # - # @param input [String, Array, Array] - # @param model [String, Symbol, OpenAI::Models::ModerationModel] + # @param input [String, Array, Array] Input (or inputs) to classify. Can be a single string, an array of strings, or + # ... + # + # @param model [String, Symbol, OpenAI::Models::ModerationModel] The content moderation model you would like to use. Learn more in ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::ModerationCreateResponse] diff --git a/lib/openai/resources/responses.rb b/lib/openai/resources/responses.rb index 350e7a3f..381dba94 100644 --- a/lib/openai/resources/responses.rb +++ b/lib/openai/resources/responses.rb @@ -8,6 +8,9 @@ class Responses # See {OpenAI::Resources::Responses#stream_raw} for streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCreateParams} for more details. + # # Creates a model response. Provide # [text](https://platform.openai.com/docs/guides/text) or # [image](https://platform.openai.com/docs/guides/images) inputs to generate @@ -22,24 +25,47 @@ class Responses # # @overload create(input:, model:, include: nil, instructions: nil, max_output_tokens: nil, metadata: nil, parallel_tool_calls: nil, previous_response_id: nil, reasoning: nil, service_tier: nil, store: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_p: nil, truncation: nil, user: nil, request_options: {}) # - # @param input [String, Array] - # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] - # @param include [Array, nil] - # @param instructions [String, nil] - # @param max_output_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param parallel_tool_calls [Boolean, nil] - # @param previous_response_id [String, nil] - # @param reasoning [OpenAI::Models::Reasoning, nil] - # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] - # @param store [Boolean, nil] - # @param temperature [Float, nil] - # @param text [OpenAI::Models::Responses::ResponseTextConfig] - # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] - # @param tools [Array] - # @param top_p [Float, nil] - # @param truncation [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Truncation, nil] - # @param user [String] + # @param input [String, Array] Text, image, or file inputs to the model, used to generate a response. ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI ... + # + # @param include [Array, nil] Specify additional output data to include in the model response. Currently ... + # + # @param instructions [String, nil] Inserts a system (or developer) message as the first item in the model's context + # ... + # + # @param max_output_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a response, in + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param parallel_tool_calls [Boolean, nil] Whether to allow the model to run tool calls in parallel. ... + # + # @param previous_response_id [String, nil] The unique ID of the previous response to the model. Use this to ... + # + # @param reasoning [OpenAI::Models::Reasoning, nil] **o-series models only** ... + # + # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param store [Boolean, nil] Whether to store the generated model response for later retrieval via ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param text [OpenAI::Models::Responses::ResponseTextConfig] Configuration options for a text response from the model. Can be plain ... + # + # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] How the model should select which tool (or tools) to use when generating ... + # + # @param tools [Array] An array of tools the model may call while generating a response. You ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, ... + # + # @param truncation [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Truncation, nil] The truncation strategy to use for the model response. ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Responses::Response] @@ -66,6 +92,9 @@ def stream # See {OpenAI::Resources::Responses#create} for non-streaming counterpart. # + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseCreateParams} for more details. + # # Creates a model response. Provide # [text](https://platform.openai.com/docs/guides/text) or # [image](https://platform.openai.com/docs/guides/images) inputs to generate @@ -80,24 +109,47 @@ def stream # # @overload stream_raw(input:, model:, include: nil, instructions: nil, max_output_tokens: nil, metadata: nil, parallel_tool_calls: nil, previous_response_id: nil, reasoning: nil, service_tier: nil, store: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_p: nil, truncation: nil, user: nil, request_options: {}) # - # @param input [String, Array] - # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] - # @param include [Array, nil] - # @param instructions [String, nil] - # @param max_output_tokens [Integer, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param parallel_tool_calls [Boolean, nil] - # @param previous_response_id [String, nil] - # @param reasoning [OpenAI::Models::Reasoning, nil] - # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] - # @param store [Boolean, nil] - # @param temperature [Float, nil] - # @param text [OpenAI::Models::Responses::ResponseTextConfig] - # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] - # @param tools [Array] - # @param top_p [Float, nil] - # @param truncation [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Truncation, nil] - # @param user [String] + # @param input [String, Array] Text, image, or file inputs to the model, used to generate a response. ... + # + # @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI ... + # + # @param include [Array, nil] Specify additional output data to include in the model response. Currently ... + # + # @param instructions [String, nil] Inserts a system (or developer) message as the first item in the model's context + # ... + # + # @param max_output_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a response, in + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param parallel_tool_calls [Boolean, nil] Whether to allow the model to run tool calls in parallel. ... + # + # @param previous_response_id [String, nil] The unique ID of the previous response to the model. Use this to ... + # + # @param reasoning [OpenAI::Models::Reasoning, nil] **o-series models only** ... + # + # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] Specifies the latency tier to use for processing the request. This parameter is + # ... + # + # @param store [Boolean, nil] Whether to store the generated model response for later retrieval via ... + # + # @param temperature [Float, nil] What sampling temperature to use, between 0 and 2. Higher values like 0.8 will m + # ... + # + # @param text [OpenAI::Models::Responses::ResponseTextConfig] Configuration options for a text response from the model. Can be plain ... + # + # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction] How the model should select which tool (or tools) to use when generating ... + # + # @param tools [Array] An array of tools the model may call while generating a response. You ... + # + # @param top_p [Float, nil] An alternative to sampling with temperature, called nucleus sampling, ... + # + # @param truncation [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Truncation, nil] The truncation strategy to use for the model response. ... + # + # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Stream] @@ -121,12 +173,17 @@ def stream_raw(params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::ResponseRetrieveParams} for more details. + # # Retrieves a model response with the given ID. # # @overload retrieve(response_id, include: nil, request_options: {}) # - # @param response_id [String] - # @param include [Array] + # @param response_id [String] The ID of the response to retrieve. + # + # @param include [Array] Additional fields to include in the response. See the `include` ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Responses::Response] @@ -147,7 +204,8 @@ def retrieve(response_id, params = {}) # # @overload delete(response_id, request_options: {}) # - # @param response_id [String] + # @param response_id [String] The ID of the response to delete. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [nil] diff --git a/lib/openai/resources/responses/input_items.rb b/lib/openai/resources/responses/input_items.rb index 5e875778..a47baded 100644 --- a/lib/openai/resources/responses/input_items.rb +++ b/lib/openai/resources/responses/input_items.rb @@ -4,16 +4,25 @@ module OpenAI module Resources class Responses class InputItems + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Responses::InputItemListParams} for more details. + # # Returns a list of input items for a given response. # # @overload list(response_id, after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}) # - # @param response_id [String] - # @param after [String] - # @param before [String] - # @param include [Array] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::Responses::InputItemListParams::Order] + # @param response_id [String] The ID of the response to retrieve input items for. + # + # @param after [String] An item ID to list items after, used in pagination. ... + # + # @param before [String] An item ID to list items before, used in pagination. ... + # + # @param include [Array] Additional fields to include in the response. See the `include` ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between ... + # + # @param order [Symbol, OpenAI::Models::Responses::InputItemListParams::Order] The order to return the input items in. Default is `asc`. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] diff --git a/lib/openai/resources/uploads.rb b/lib/openai/resources/uploads.rb index 1c497d22..719532b1 100644 --- a/lib/openai/resources/uploads.rb +++ b/lib/openai/resources/uploads.rb @@ -6,6 +6,9 @@ class Uploads # @return [OpenAI::Resources::Uploads::Parts] attr_reader :parts + # Some parameter documentations has been truncated, see + # {OpenAI::Models::UploadCreateParams} for more details. + # # Creates an intermediate # [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object # that you can add @@ -28,10 +31,14 @@ class Uploads # # @overload create(bytes:, filename:, mime_type:, purpose:, request_options: {}) # - # @param bytes [Integer] - # @param filename [String] - # @param mime_type [String] - # @param purpose [Symbol, OpenAI::Models::FilePurpose] + # @param bytes [Integer] The number of bytes in the file you are uploading. ... + # + # @param filename [String] The name of the file to upload. ... + # + # @param mime_type [String] The MIME type of the file. ... + # + # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Upload] @@ -48,11 +55,15 @@ def create(params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::UploadCancelParams} for more details. + # # Cancels the Upload. No Parts may be added after an Upload is cancelled. # # @overload cancel(upload_id, request_options: {}) # - # @param upload_id [String] + # @param upload_id [String] The ID of the Upload. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Upload] @@ -67,6 +78,9 @@ def cancel(upload_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::UploadCompleteParams} for more details. + # # Completes the # [Upload](https://platform.openai.com/docs/api-reference/uploads/object). # @@ -83,9 +97,13 @@ def cancel(upload_id, params = {}) # # @overload complete(upload_id, part_ids:, md5: nil, request_options: {}) # - # @param upload_id [String] - # @param part_ids [Array] - # @param md5 [String] + # @param upload_id [String] The ID of the Upload. ... + # + # @param part_ids [Array] The ordered list of Part IDs. ... + # + # @param md5 [String] The optional md5 checksum for the file contents to verify if the bytes uploaded + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Upload] diff --git a/lib/openai/resources/uploads/parts.rb b/lib/openai/resources/uploads/parts.rb index 12d21af6..b0e572a1 100644 --- a/lib/openai/resources/uploads/parts.rb +++ b/lib/openai/resources/uploads/parts.rb @@ -4,6 +4,9 @@ module OpenAI module Resources class Uploads class Parts + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Uploads::PartCreateParams} for more details. + # # Adds a # [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an # [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object. @@ -18,8 +21,10 @@ class Parts # # @overload create(upload_id, data:, request_options: {}) # - # @param upload_id [String] - # @param data [Pathname, StringIO] + # @param upload_id [String] The ID of the Upload. ... + # + # @param data [Pathname, StringIO] The chunk of bytes for this Part. ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::Uploads::UploadPart] diff --git a/lib/openai/resources/vector_stores.rb b/lib/openai/resources/vector_stores.rb index 3547ae53..cc75a01e 100644 --- a/lib/openai/resources/vector_stores.rb +++ b/lib/openai/resources/vector_stores.rb @@ -9,15 +9,25 @@ class VectorStores # @return [OpenAI::Resources::VectorStores::FileBatches] attr_reader :file_batches + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreCreateParams} for more details. + # # Create a vector store. # # @overload create(chunking_strategy: nil, expires_after: nil, file_ids: nil, metadata: nil, name: nil, request_options: {}) # - # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] - # @param expires_after [OpenAI::Models::VectorStoreCreateParams::ExpiresAfter] - # @param file_ids [Array] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String] + # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # + # @param expires_after [OpenAI::Models::VectorStoreCreateParams::ExpiresAfter] The expiration policy for a vector store. + # + # @param file_ids [Array] A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that + # ... + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String] The name of the vector store. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStore] @@ -38,7 +48,8 @@ def create(params = {}) # # @overload retrieve(vector_store_id, request_options: {}) # - # @param vector_store_id [String] + # @param vector_store_id [String] The ID of the vector store to retrieve. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStore] @@ -53,14 +64,21 @@ def retrieve(vector_store_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreUpdateParams} for more details. + # # Modifies a vector store. # # @overload update(vector_store_id, expires_after: nil, metadata: nil, name: nil, request_options: {}) # - # @param vector_store_id [String] - # @param expires_after [OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, nil] - # @param metadata [Hash{Symbol=>String}, nil] - # @param name [String, nil] + # @param vector_store_id [String] The ID of the vector store to modify. + # + # @param expires_after [OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, nil] The expiration policy for a vector store. + # + # @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param name [String, nil] The name of the vector store. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStore] @@ -77,14 +95,25 @@ def update(vector_store_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreListParams} for more details. + # # Returns a list of vector stores. # # @overload list(after: nil, before: nil, limit: nil, order: nil, request_options: {}) # - # @param after [String] - # @param before [String] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::VectorStoreListParams::Order] + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::VectorStoreListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -106,7 +135,8 @@ def list(params = {}) # # @overload delete(vector_store_id, request_options: {}) # - # @param vector_store_id [String] + # @param vector_store_id [String] The ID of the vector store to delete. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStoreDeleted] @@ -121,17 +151,27 @@ def delete(vector_store_id, params = {}) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStoreSearchParams} for more details. + # # Search a vector store for relevant chunks based on a query and file attributes # filter. # # @overload search(vector_store_id, query:, filters: nil, max_num_results: nil, ranking_options: nil, rewrite_query: nil, request_options: {}) # - # @param vector_store_id [String] - # @param query [String, Array] - # @param filters [OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter] - # @param max_num_results [Integer] - # @param ranking_options [OpenAI::Models::VectorStoreSearchParams::RankingOptions] - # @param rewrite_query [Boolean] + # @param vector_store_id [String] The ID of the vector store to search. + # + # @param query [String, Array] A query string for a search + # + # @param filters [OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter] A filter to apply based on file attributes. + # + # @param max_num_results [Integer] The maximum number of results to return. This number should be between 1 and 50 + # ... + # + # @param ranking_options [OpenAI::Models::VectorStoreSearchParams::RankingOptions] Ranking options for search. + # + # @param rewrite_query [Boolean] Whether to rewrite the natural language query for vector search. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Page] diff --git a/lib/openai/resources/vector_stores/file_batches.rb b/lib/openai/resources/vector_stores/file_batches.rb index 71268646..10b3e3dc 100644 --- a/lib/openai/resources/vector_stores/file_batches.rb +++ b/lib/openai/resources/vector_stores/file_batches.rb @@ -4,14 +4,23 @@ module OpenAI module Resources class VectorStores class FileBatches + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileBatchCreateParams} for more details. + # # Create a vector store file batch. # # @overload create(vector_store_id, file_ids:, attributes: nil, chunking_strategy: nil, request_options: {}) # - # @param vector_store_id [String] - # @param file_ids [Array] - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] - # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] + # @param vector_store_id [String] The ID of the vector store for which to create a File Batch. ... + # + # @param file_ids [Array] A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that + # ... + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStores::VectorStoreFileBatch] @@ -32,8 +41,10 @@ def create(vector_store_id, params) # # @overload retrieve(batch_id, vector_store_id:, request_options: {}) # - # @param batch_id [String] - # @param vector_store_id [String] + # @param batch_id [String] The ID of the file batch being retrieved. + # + # @param vector_store_id [String] The ID of the vector store that the file batch belongs to. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStores::VectorStoreFileBatch] @@ -58,8 +69,10 @@ def retrieve(batch_id, params) # # @overload cancel(batch_id, vector_store_id:, request_options: {}) # - # @param batch_id [String] - # @param vector_store_id [String] + # @param batch_id [String] The ID of the file batch to cancel. + # + # @param vector_store_id [String] The ID of the vector store that the file batch belongs to. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStores::VectorStoreFileBatch] @@ -79,17 +92,32 @@ def cancel(batch_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileBatchListFilesParams} for more details. + # # Returns a list of vector store files in a batch. # # @overload list_files(batch_id, vector_store_id:, after: nil, before: nil, filter: nil, limit: nil, order: nil, request_options: {}) # - # @param batch_id [String] - # @param vector_store_id [String] - # @param after [String] - # @param before [String] - # @param filter [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Order] + # @param batch_id [String] Path param: The ID of the file batch that the files belong to. + # + # @param vector_store_id [String] Path param: The ID of the vector store that the files belong to. + # + # @param after [String] Query param: A cursor for use in pagination. `after` is an object ID that define + # ... + # + # @param before [String] Query param: A cursor for use in pagination. `before` is an object ID that defin + # ... + # + # @param filter [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter] Query param: Filter by file status. One of `in_progress`, `completed`, `failed`, + # ... + # + # @param limit [Integer] Query param: A limit on the number of objects to be returned. Limit can range be + # ... + # + # @param order [Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Order] Query param: Sort order by the `created_at` timestamp of the objects. `asc` for + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] diff --git a/lib/openai/resources/vector_stores/files.rb b/lib/openai/resources/vector_stores/files.rb index 9f6900e7..74870229 100644 --- a/lib/openai/resources/vector_stores/files.rb +++ b/lib/openai/resources/vector_stores/files.rb @@ -4,16 +4,25 @@ module OpenAI module Resources class VectorStores class Files + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileCreateParams} for more details. + # # Create a vector store file by attaching a # [File](https://platform.openai.com/docs/api-reference/files) to a # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object). # # @overload create(vector_store_id, file_id:, attributes: nil, chunking_strategy: nil, request_options: {}) # - # @param vector_store_id [String] - # @param file_id [String] - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] - # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] + # @param vector_store_id [String] The ID of the vector store for which to create a File. ... + # + # @param file_id [String] A [File](https://platform.openai.com/docs/api-reference/files) ID that the vecto + # ... + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Set of 16 key-value pairs that can be attached to an object. This can be ... + # + # @param chunking_strategy [OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Models::StaticFileChunkingStrategyObjectParam] The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStores::VectorStoreFile] @@ -34,8 +43,10 @@ def create(vector_store_id, params) # # @overload retrieve(file_id, vector_store_id:, request_options: {}) # - # @param file_id [String] - # @param vector_store_id [String] + # @param file_id [String] The ID of the file being retrieved. + # + # @param vector_store_id [String] The ID of the vector store that the file belongs to. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStores::VectorStoreFile] @@ -55,13 +66,20 @@ def retrieve(file_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileUpdateParams} for more details. + # # Update attributes on a vector store file. # # @overload update(file_id, vector_store_id:, attributes:, request_options: {}) # - # @param file_id [String] - # @param vector_store_id [String] - # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] + # @param file_id [String] Path param: The ID of the file to update attributes. + # + # @param vector_store_id [String] Path param: The ID of the vector store the file belongs to. + # + # @param attributes [Hash{Symbol=>String, Float, Boolean}, nil] Body param: Set of 16 key-value pairs that can be attached to an object. This ca + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStores::VectorStoreFile] @@ -82,16 +100,30 @@ def update(file_id, params) ) end + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VectorStores::FileListParams} for more details. + # # Returns a list of vector store files. # # @overload list(vector_store_id, after: nil, before: nil, filter: nil, limit: nil, order: nil, request_options: {}) # - # @param vector_store_id [String] - # @param after [String] - # @param before [String] - # @param filter [Symbol, OpenAI::Models::VectorStores::FileListParams::Filter] - # @param limit [Integer] - # @param order [Symbol, OpenAI::Models::VectorStores::FileListParams::Order] + # @param vector_store_id [String] The ID of the vector store that the files belong to. + # + # @param after [String] A cursor for use in pagination. `after` is an object ID that defines your place + # ... + # + # @param before [String] A cursor for use in pagination. `before` is an object ID that defines your place + # ... + # + # @param filter [Symbol, OpenAI::Models::VectorStores::FileListParams::Filter] Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + # ... + # + # @param limit [Integer] A limit on the number of objects to be returned. Limit can range between 1 and 1 + # ... + # + # @param order [Symbol, OpenAI::Models::VectorStores::FileListParams::Order] Sort order by the `created_at` timestamp of the objects. `asc` for ascending ord + # ... + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::CursorPage] @@ -116,8 +148,10 @@ def list(vector_store_id, params = {}) # # @overload delete(file_id, vector_store_id:, request_options: {}) # - # @param file_id [String] - # @param vector_store_id [String] + # @param file_id [String] The ID of the file to delete. + # + # @param vector_store_id [String] The ID of the vector store that the file belongs to. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Models::VectorStores::VectorStoreFileDeleted] @@ -141,8 +175,10 @@ def delete(file_id, params) # # @overload content(file_id, vector_store_id:, request_options: {}) # - # @param file_id [String] - # @param vector_store_id [String] + # @param file_id [String] The ID of the file within the vector store. + # + # @param vector_store_id [String] The ID of the vector store. + # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [OpenAI::Internal::Page] diff --git a/rbi/lib/openai/models/audio/speech_create_params.rbi b/rbi/lib/openai/models/audio/speech_create_params.rbi index 68db9bed..d27b0482 100644 --- a/rbi/lib/openai/models/audio/speech_create_params.rbi +++ b/rbi/lib/openai/models/audio/speech_create_params.rbi @@ -60,16 +60,27 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The text to generate audio for. The maximum length is 4096 characters. input:, + # One of the available [TTS models](https://platform.openai.com/docs/models#tts): + # `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. model:, + # The voice to use when generating the audio. Supported voices are `alloy`, `ash`, + # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and + # `verse`. Previews of the voices are available in the + # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). voice:, + # Control the voice of your generated audio with additional instructions. Does not + # work with `tts-1` or `tts-1-hd`. instructions: nil, + # The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, + # `wav`, and `pcm`. response_format: nil, + # The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is + # the default. speed: nil, request_options: {} - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/audio/transcription.rbi b/rbi/lib/openai/models/audio/transcription.rbi index ccea9d77..fa6cd066 100644 --- a/rbi/lib/openai/models/audio/transcription.rbi +++ b/rbi/lib/openai/models/audio/transcription.rbi @@ -31,8 +31,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(text:, logprobs: nil); end - + def self.new( + # The transcribed text. + text:, + # The log probabilities of the tokens in the transcription. Only returned with the + # models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added + # to the `include` array. + logprobs: nil + ); end sig { override.returns({text: String, logprobs: T::Array[OpenAI::Models::Audio::Transcription::Logprob]}) } def to_hash; end @@ -59,8 +65,14 @@ module OpenAI attr_writer :logprob sig { params(token: String, bytes: T::Array[Float], logprob: Float).returns(T.attached_class) } - def self.new(token: nil, bytes: nil, logprob: nil); end - + def self.new( + # The token in the transcription. + token: nil, + # The bytes of the token. + bytes: nil, + # The log probability of the token. + logprob: nil + ); end sig { override.returns({token: String, bytes: T::Array[Float], logprob: Float}) } def to_hash; end end diff --git a/rbi/lib/openai/models/audio/transcription_create_params.rbi b/rbi/lib/openai/models/audio/transcription_create_params.rbi index c6020c3f..f89a401f 100644 --- a/rbi/lib/openai/models/audio/transcription_create_params.rbi +++ b/rbi/lib/openai/models/audio/transcription_create_params.rbi @@ -103,13 +103,43 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The audio file object (not file name) to transcribe, in one of these formats: + # flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. file:, + # ID of the model to use. The options are `gpt-4o-transcribe`, + # `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source + # Whisper V2 model). model:, + # Additional information to include in the transcription response. `logprobs` will + # return the log probabilities of the tokens in the response to understand the + # model's confidence in the transcription. `logprobs` only works with + # response_format set to `json` and only with the models `gpt-4o-transcribe` and + # `gpt-4o-mini-transcribe`. include: nil, + # The language of the input audio. Supplying the input language in + # [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) + # format will improve accuracy and latency. language: nil, + # An optional text to guide the model's style or continue a previous audio + # segment. The + # [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) + # should match the audio language. prompt: nil, + # The format of the output, in one of these options: `json`, `text`, `srt`, + # `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, + # the only supported format is `json`. response_format: nil, + # The sampling temperature, between 0 and 1. Higher values like 0.8 will make the + # output more random, while lower values like 0.2 will make it more focused and + # deterministic. If set to 0, the model will use + # [log probability](https://en.wikipedia.org/wiki/Log_probability) to + # automatically increase the temperature until certain thresholds are hit. temperature: nil, + # The timestamp granularities to populate for this transcription. + # `response_format` must be set `verbose_json` to use timestamp granularities. + # Either or both of these options are supported: `word`, or `segment`. Note: There + # is no additional latency for segment timestamps, but generating word timestamps + # incurs additional latency. timestamp_granularities: nil, request_options: {} ); end diff --git a/rbi/lib/openai/models/audio/transcription_segment.rbi b/rbi/lib/openai/models/audio/transcription_segment.rbi index 37306ed0..e98fad18 100644 --- a/rbi/lib/openai/models/audio/transcription_segment.rbi +++ b/rbi/lib/openai/models/audio/transcription_segment.rbi @@ -63,19 +63,30 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier of the segment. id:, + # Average logprob of the segment. If the value is lower than -1, consider the + # logprobs failed. avg_logprob:, + # Compression ratio of the segment. If the value is greater than 2.4, consider the + # compression failed. compression_ratio:, + # End time of the segment in seconds. end_:, + # Probability of no speech in the segment. If the value is higher than 1.0 and the + # `avg_logprob` is below -1, consider this segment silent. no_speech_prob:, + # Seek offset of the segment. seek:, + # Start time of the segment in seconds. start:, + # Temperature parameter used for generating the segment. temperature:, + # Text content of the segment. text:, + # Array of token IDs for the text content. tokens: - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi b/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi index c0c5e553..25ace7da 100644 --- a/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi +++ b/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi @@ -38,8 +38,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(delta:, logprobs: nil, type: :"transcript.text.delta"); end - + def self.new( + # The text delta that was additionally transcribed. + delta:, + # The log probabilities of the delta. Only included if you + # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) + # with the `include[]` parameter set to `logprobs`. + logprobs: nil, + # The type of the event. Always `transcript.text.delta`. + type: :"transcript.text.delta" + ); end sig do override .returns( @@ -71,8 +79,14 @@ module OpenAI attr_writer :logprob sig { params(token: String, bytes: T::Array[T.anything], logprob: Float).returns(T.attached_class) } - def self.new(token: nil, bytes: nil, logprob: nil); end - + def self.new( + # The token that was used to generate the log probability. + token: nil, + # The bytes that were used to generate the log probability. + bytes: nil, + # The log probability of the token. + logprob: nil + ); end sig { override.returns({token: String, bytes: T::Array[T.anything], logprob: Float}) } def to_hash; end end diff --git a/rbi/lib/openai/models/audio/transcription_text_done_event.rbi b/rbi/lib/openai/models/audio/transcription_text_done_event.rbi index 95c68dcc..08687ed5 100644 --- a/rbi/lib/openai/models/audio/transcription_text_done_event.rbi +++ b/rbi/lib/openai/models/audio/transcription_text_done_event.rbi @@ -39,8 +39,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(text:, logprobs: nil, type: :"transcript.text.done"); end - + def self.new( + # The text that was transcribed. + text:, + # The log probabilities of the individual tokens in the transcription. Only + # included if you + # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) + # with the `include[]` parameter set to `logprobs`. + logprobs: nil, + # The type of the event. Always `transcript.text.done`. + type: :"transcript.text.done" + ); end sig do override .returns( @@ -72,8 +81,14 @@ module OpenAI attr_writer :logprob sig { params(token: String, bytes: T::Array[T.anything], logprob: Float).returns(T.attached_class) } - def self.new(token: nil, bytes: nil, logprob: nil); end - + def self.new( + # The token that was used to generate the log probability. + token: nil, + # The bytes that were used to generate the log probability. + bytes: nil, + # The log probability of the token. + logprob: nil + ); end sig { override.returns({token: String, bytes: T::Array[T.anything], logprob: Float}) } def to_hash; end end diff --git a/rbi/lib/openai/models/audio/transcription_verbose.rbi b/rbi/lib/openai/models/audio/transcription_verbose.rbi index 76b0838c..43af0a5c 100644 --- a/rbi/lib/openai/models/audio/transcription_verbose.rbi +++ b/rbi/lib/openai/models/audio/transcription_verbose.rbi @@ -45,8 +45,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(duration:, language:, text:, segments: nil, words: nil); end - + def self.new( + # The duration of the input audio. + duration:, + # The language of the input audio. + language:, + # The transcribed text. + text:, + # Segments of the transcribed text and their corresponding details. + segments: nil, + # Extracted words and their corresponding timestamps. + words: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/audio/transcription_word.rbi b/rbi/lib/openai/models/audio/transcription_word.rbi index 639e066d..51122c61 100644 --- a/rbi/lib/openai/models/audio/transcription_word.rbi +++ b/rbi/lib/openai/models/audio/transcription_word.rbi @@ -17,8 +17,14 @@ module OpenAI attr_accessor :word sig { params(end_: Float, start: Float, word: String).returns(T.attached_class) } - def self.new(end_:, start:, word:); end - + def self.new( + # End time of the word in seconds. + end_:, + # Start time of the word in seconds. + start:, + # The text content of the word. + word: + ); end sig { override.returns({end_: Float, start: Float, word: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/audio/translation_create_params.rbi b/rbi/lib/openai/models/audio/translation_create_params.rbi index 405309c1..807e0bb2 100644 --- a/rbi/lib/openai/models/audio/translation_create_params.rbi +++ b/rbi/lib/openai/models/audio/translation_create_params.rbi @@ -57,9 +57,29 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file:, model:, prompt: nil, response_format: nil, temperature: nil, request_options: {}) - end - + def self.new( + # The audio file object (not file name) translate, in one of these formats: flac, + # mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + file:, + # ID of the model to use. Only `whisper-1` (which is powered by our open source + # Whisper V2 model) is currently available. + model:, + # An optional text to guide the model's style or continue a previous audio + # segment. The + # [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) + # should be in English. + prompt: nil, + # The format of the output, in one of these options: `json`, `text`, `srt`, + # `verbose_json`, or `vtt`. + response_format: nil, + # The sampling temperature, between 0 and 1. Higher values like 0.8 will make the + # output more random, while lower values like 0.2 will make it more focused and + # deterministic. If set to 0, the model will use + # [log probability](https://en.wikipedia.org/wiki/Log_probability) to + # automatically increase the temperature until certain thresholds are hit. + temperature: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/audio/translation_verbose.rbi b/rbi/lib/openai/models/audio/translation_verbose.rbi index 77fb4815..9458e067 100644 --- a/rbi/lib/openai/models/audio/translation_verbose.rbi +++ b/rbi/lib/openai/models/audio/translation_verbose.rbi @@ -35,8 +35,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(duration:, language:, text:, segments: nil); end - + def self.new( + # The duration of the input audio. + duration:, + # The language of the output translation (always `english`). + language:, + # The translated text. + text:, + # Segments of the translated text and their corresponding details. + segments: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi b/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi index d072297d..7ea24386 100644 --- a/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi +++ b/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi @@ -10,8 +10,10 @@ module OpenAI # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :auto); end - + def self.new( + # Always `auto`. + type: :auto + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/batch.rbi b/rbi/lib/openai/models/batch.rbi index 8de778c2..bbb7b1cd 100644 --- a/rbi/lib/openai/models/batch.rbi +++ b/rbi/lib/openai/models/batch.rbi @@ -149,24 +149,47 @@ module OpenAI end def self.new( id:, + # The time frame within which the batch should be processed. completion_window:, + # The Unix timestamp (in seconds) for when the batch was created. created_at:, + # The OpenAI API endpoint used by the batch. endpoint:, + # The ID of the input file for the batch. input_file_id:, + # The current status of the batch. status:, + # The Unix timestamp (in seconds) for when the batch was cancelled. cancelled_at: nil, + # The Unix timestamp (in seconds) for when the batch started cancelling. cancelling_at: nil, + # The Unix timestamp (in seconds) for when the batch was completed. completed_at: nil, + # The ID of the file containing the outputs of requests with errors. error_file_id: nil, errors: nil, + # The Unix timestamp (in seconds) for when the batch expired. expired_at: nil, + # The Unix timestamp (in seconds) for when the batch will expire. expires_at: nil, + # The Unix timestamp (in seconds) for when the batch failed. failed_at: nil, + # The Unix timestamp (in seconds) for when the batch started finalizing. finalizing_at: nil, + # The Unix timestamp (in seconds) for when the batch started processing. in_progress_at: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # The ID of the file containing the outputs of successfully executed requests. output_file_id: nil, + # The request counts for different statuses within the batch. request_counts: nil, + # The object type, which is always `batch`. object: :batch ); end sig do @@ -236,8 +259,11 @@ module OpenAI params(data: T::Array[T.any(OpenAI::Models::BatchError, OpenAI::Internal::AnyHash)], object: String) .returns(T.attached_class) end - def self.new(data: nil, object: nil); end - + def self.new( + data: nil, + # The object type, which is always `list`. + object: nil + ); end sig { override.returns({data: T::Array[OpenAI::Models::BatchError], object: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/batch_create_params.rbi b/rbi/lib/openai/models/batch_create_params.rbi index 3a795500..fec9c7ac 100644 --- a/rbi/lib/openai/models/batch_create_params.rbi +++ b/rbi/lib/openai/models/batch_create_params.rbi @@ -49,8 +49,34 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(completion_window:, endpoint:, input_file_id:, metadata: nil, request_options: {}); end - + def self.new( + # The time frame within which the batch should be processed. Currently only `24h` + # is supported. + completion_window:, + # The endpoint to be used for all requests in the batch. Currently + # `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` + # are supported. Note that `/v1/embeddings` batches are also restricted to a + # maximum of 50,000 embedding inputs across all requests in the batch. + endpoint:, + # The ID of an uploaded file that contains requests for the new batch. + # + # See [upload file](https://platform.openai.com/docs/api-reference/files/create) + # for how to upload a file. + # + # Your input file must be formatted as a + # [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), + # and must be uploaded with the purpose `batch`. The file can contain up to 50,000 + # requests, and can be up to 200 MB in size. + input_file_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/batch_error.rbi b/rbi/lib/openai/models/batch_error.rbi index 0871460e..24b461c6 100644 --- a/rbi/lib/openai/models/batch_error.rbi +++ b/rbi/lib/openai/models/batch_error.rbi @@ -29,8 +29,16 @@ module OpenAI params(code: String, line: T.nilable(Integer), message: String, param: T.nilable(String)) .returns(T.attached_class) end - def self.new(code: nil, line: nil, message: nil, param: nil); end - + def self.new( + # An error code identifying the error type. + code: nil, + # The line number of the input file where the error occurred, if applicable. + line: nil, + # A human-readable message providing more details about the error. + message: nil, + # The name of the parameter that caused the error, if applicable. + param: nil + ); end sig do override.returns({code: String, line: T.nilable(Integer), message: String, param: T.nilable(String)}) end diff --git a/rbi/lib/openai/models/batch_list_params.rbi b/rbi/lib/openai/models/batch_list_params.rbi index 9ae31328..397a8042 100644 --- a/rbi/lib/openai/models/batch_list_params.rbi +++ b/rbi/lib/openai/models/batch_list_params.rbi @@ -32,8 +32,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, request_options: {}); end - + def self.new( + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. + after: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. + limit: nil, + request_options: {} + ); end sig { override.returns({after: String, limit: Integer, request_options: OpenAI::RequestOptions}) } def to_hash; end end diff --git a/rbi/lib/openai/models/batch_request_counts.rbi b/rbi/lib/openai/models/batch_request_counts.rbi index 2c97e840..8f022136 100644 --- a/rbi/lib/openai/models/batch_request_counts.rbi +++ b/rbi/lib/openai/models/batch_request_counts.rbi @@ -17,8 +17,14 @@ module OpenAI # The request counts for different statuses within the batch. sig { params(completed: Integer, failed: Integer, total: Integer).returns(T.attached_class) } - def self.new(completed:, failed:, total:); end - + def self.new( + # Number of requests that have been completed successfully. + completed:, + # Number of requests that have failed. + failed:, + # Total number of requests in the batch. + total: + ); end sig { override.returns({completed: Integer, failed: Integer, total: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/assistant.rbi b/rbi/lib/openai/models/beta/assistant.rbi index f8ef7368..438ec36e 100644 --- a/rbi/lib/openai/models/beta/assistant.rbi +++ b/rbi/lib/openai/models/beta/assistant.rbi @@ -160,18 +160,71 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The identifier, which can be referenced in API endpoints. id:, + # The Unix timestamp (in seconds) for when the assistant was created. created_at:, + # The description of the assistant. The maximum length is 512 characters. description:, + # The system instructions that the assistant uses. The maximum length is 256,000 + # characters. instructions:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # ID of the model to use. You can use the + # [List models](https://platform.openai.com/docs/api-reference/models/list) API to + # see all of your available models, or see our + # [Model overview](https://platform.openai.com/docs/models) for descriptions of + # them. model:, + # The name of the assistant. The maximum length is 256 characters. name:, + # A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # assistant. Tools can be of types `code_interpreter`, `file_search`, or + # `function`. tools:, + # Specifies the format that the model must output. Compatible with + # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + # [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + # and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + # + # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + # Outputs which ensures the model will match your supplied JSON schema. Learn more + # in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + # message the model generates is valid JSON. + # + # **Important:** when using JSON mode, you **must** also instruct the model to + # produce JSON yourself via a system or user message. Without this, the model may + # generate an unending stream of whitespace until the generation reaches the token + # limit, resulting in a long-running and seemingly "stuck" request. Also note that + # the message content may be partially cut off if `finish_reason="length"`, which + # indicates the generation exceeded `max_tokens` or the conversation exceeded the + # max context length. response_format: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. temperature: nil, + # A set of resources that are used by the assistant's tools. The resources are + # specific to the type of tool. For example, the `code_interpreter` tool requires + # a list of file IDs, while the `file_search` tool requires a list of vector store + # IDs. tool_resources: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or temperature but not both. top_p: nil, + # The object type, which is always `assistant`. object: :assistant ); end sig do @@ -267,8 +320,12 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # available to the `code_interpreter`` tool. There can be a maximum of 20 files + # associated with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -285,8 +342,13 @@ module OpenAI attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } - def self.new(vector_store_ids: nil); end - + def self.new( + # The ID of the + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this assistant. There can be a maximum of 1 vector store attached to + # the assistant. + vector_store_ids: nil + ); end sig { override.returns({vector_store_ids: T::Array[String]}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/assistant_create_params.rbi b/rbi/lib/openai/models/beta/assistant_create_params.rbi index f068ee9b..d4ce6a96 100644 --- a/rbi/lib/openai/models/beta/assistant_create_params.rbi +++ b/rbi/lib/openai/models/beta/assistant_create_params.rbi @@ -175,16 +175,72 @@ module OpenAI .returns(T.attached_class) end def self.new( + # ID of the model to use. You can use the + # [List models](https://platform.openai.com/docs/api-reference/models/list) API to + # see all of your available models, or see our + # [Model overview](https://platform.openai.com/docs/models) for descriptions of + # them. model:, + # The description of the assistant. The maximum length is 512 characters. description: nil, + # The system instructions that the assistant uses. The maximum length is 256,000 + # characters. instructions: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # The name of the assistant. The maximum length is 256 characters. name: nil, + # **o-series models only** + # + # Constrains effort on reasoning for + # [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can + # result in faster responses and fewer tokens used on reasoning in a response. reasoning_effort: nil, + # Specifies the format that the model must output. Compatible with + # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + # [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + # and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + # + # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + # Outputs which ensures the model will match your supplied JSON schema. Learn more + # in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + # message the model generates is valid JSON. + # + # **Important:** when using JSON mode, you **must** also instruct the model to + # produce JSON yourself via a system or user message. Without this, the model may + # generate an unending stream of whitespace until the generation reaches the token + # limit, resulting in a long-running and seemingly "stuck" request. Also note that + # the message content may be partially cut off if `finish_reason="length"`, which + # indicates the generation exceeded `max_tokens` or the conversation exceeded the + # max context length. response_format: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. temperature: nil, + # A set of resources that are used by the assistant's tools. The resources are + # specific to the type of tool. For example, the `code_interpreter` tool requires + # a list of file IDs, while the `file_search` tool requires a list of vector store + # IDs. tool_resources: nil, + # A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # assistant. Tools can be of types `code_interpreter`, `file_search`, or + # `function`. tools: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or temperature but not both. top_p: nil, request_options: {} ); end @@ -298,8 +354,12 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # available to the `code_interpreter` tool. There can be a maximum of 20 files + # associated with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -351,8 +411,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(vector_store_ids: nil, vector_stores: nil); end - + def self.new( + # The + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this assistant. There can be a maximum of 1 vector store attached to + # the assistant. + vector_store_ids: nil, + # A helper to create a + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # with file_ids and attach it to this assistant. There can be a maximum of 1 + # vector store attached to the assistant. + vector_stores: nil + ); end sig do override .returns( @@ -421,8 +491,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(chunking_strategy: nil, file_ids: nil, metadata: nil); end - + def self.new( + # The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # strategy. + chunking_strategy: nil, + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to + # add to the vector store. There can be a maximum of 10000 files in a vector + # store. + file_ids: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil + ); end sig do override .returns( @@ -451,8 +535,10 @@ module OpenAI # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :auto); end - + def self.new( + # Always `auto`. + type: :auto + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -490,8 +576,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(static:, type: :static); end - + def self.new( + static:, + # Always `static`. + type: :static + ); end sig do override .returns( @@ -521,8 +610,15 @@ module OpenAI max_chunk_size_tokens: Integer ).returns(T.attached_class) end - def self.new(chunk_overlap_tokens:, max_chunk_size_tokens:); end - + def self.new( + # The number of tokens that overlap between chunks. The default value is `400`. + # + # Note that the overlap must not exceed half of `max_chunk_size_tokens`. + chunk_overlap_tokens:, + # The maximum number of tokens in each chunk. The default value is `800`. The + # minimum value is `100` and the maximum value is `4096`. + max_chunk_size_tokens: + ); end sig { override.returns({chunk_overlap_tokens: Integer, max_chunk_size_tokens: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/assistant_list_params.rbi b/rbi/lib/openai/models/beta/assistant_list_params.rbi index 48df52cc..70d05fcf 100644 --- a/rbi/lib/openai/models/beta/assistant_list_params.rbi +++ b/rbi/lib/openai/models/beta/assistant_list_params.rbi @@ -53,8 +53,25 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, before: nil, limit: nil, order: nil, request_options: {}); end - + def self.new( + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. + after: nil, + # A cursor for use in pagination. `before` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # starting with obj_foo, your subsequent call can include before=obj_foo in order + # to fetch the previous page of the list. + before: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. + limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. + order: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/assistant_stream_event.rbi b/rbi/lib/openai/models/beta/assistant_stream_event.rbi index 5cb77eb2..3b46028a 100644 --- a/rbi/lib/openai/models/beta/assistant_stream_event.rbi +++ b/rbi/lib/openai/models/beta/assistant_stream_event.rbi @@ -56,8 +56,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, enabled: nil, event: :"thread.created"); end - + def self.new( + # Represents a thread that contains + # [messages](https://platform.openai.com/docs/api-reference/messages). + data:, + # Whether to enable input audio transcription. + enabled: nil, + event: :"thread.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Thread, event: Symbol, enabled: T::Boolean}) } def to_hash; end end @@ -80,8 +86,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.created"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -104,8 +114,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.queued"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.queued" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -128,8 +142,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.in_progress"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.in_progress" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -152,8 +170,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.requires_action"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.requires_action" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -176,8 +198,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.completed"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.completed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -200,8 +226,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.incomplete"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.incomplete" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -224,8 +254,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.failed"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.failed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -248,8 +282,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.cancelling"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.cancelling" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -272,8 +310,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.cancelled"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.cancelled" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -296,8 +338,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.expired"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.expired" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -323,8 +369,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.created"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -350,8 +399,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.in_progress"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.in_progress" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -380,8 +432,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.delta"); end - + def self.new( + # Represents a run step delta i.e. any changed fields on a run step during + # streaming. + data:, + event: :"thread.run.step.delta" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, event: Symbol}) } def to_hash; end end @@ -407,8 +463,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.completed"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.completed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -434,8 +493,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.failed"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.failed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -461,8 +523,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.cancelled"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.cancelled" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -488,8 +553,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.expired"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.expired" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -513,8 +581,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.created"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end @@ -538,8 +610,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.in_progress"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.in_progress" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end @@ -566,8 +642,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.delta"); end - + def self.new( + # Represents a message delta i.e. any changed fields on a message during + # streaming. + data:, + event: :"thread.message.delta" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::MessageDeltaEvent, event: Symbol}) } def to_hash; end end @@ -591,8 +671,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.completed"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.completed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end @@ -616,8 +700,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.incomplete"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.incomplete" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/assistant_tool_choice.rbi b/rbi/lib/openai/models/beta/assistant_tool_choice.rbi index 3ef8c526..b8e37979 100644 --- a/rbi/lib/openai/models/beta/assistant_tool_choice.rbi +++ b/rbi/lib/openai/models/beta/assistant_tool_choice.rbi @@ -23,8 +23,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(type:, function: nil); end - + def self.new( + # The type of the tool. If type is `function`, the function name must be set + type:, + function: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi b/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi index c7334df0..4a88f071 100644 --- a/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi +++ b/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi @@ -9,8 +9,10 @@ module OpenAI attr_accessor :name sig { params(name: String).returns(T.attached_class) } - def self.new(name:); end - + def self.new( + # The name of the function to call. + name: + ); end sig { override.returns({name: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/assistant_update_params.rbi b/rbi/lib/openai/models/beta/assistant_update_params.rbi index 8e100d6d..29f452a9 100644 --- a/rbi/lib/openai/models/beta/assistant_update_params.rbi +++ b/rbi/lib/openai/models/beta/assistant_update_params.rbi @@ -178,16 +178,72 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The description of the assistant. The maximum length is 512 characters. description: nil, + # The system instructions that the assistant uses. The maximum length is 256,000 + # characters. instructions: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # ID of the model to use. You can use the + # [List models](https://platform.openai.com/docs/api-reference/models/list) API to + # see all of your available models, or see our + # [Model overview](https://platform.openai.com/docs/models) for descriptions of + # them. model: nil, + # The name of the assistant. The maximum length is 256 characters. name: nil, + # **o-series models only** + # + # Constrains effort on reasoning for + # [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can + # result in faster responses and fewer tokens used on reasoning in a response. reasoning_effort: nil, + # Specifies the format that the model must output. Compatible with + # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + # [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + # and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + # + # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + # Outputs which ensures the model will match your supplied JSON schema. Learn more + # in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + # message the model generates is valid JSON. + # + # **Important:** when using JSON mode, you **must** also instruct the model to + # produce JSON yourself via a system or user message. Without this, the model may + # generate an unending stream of whitespace until the generation reaches the token + # limit, resulting in a long-running and seemingly "stuck" request. Also note that + # the message content may be partially cut off if `finish_reason="length"`, which + # indicates the generation exceeded `max_tokens` or the conversation exceeded the + # max context length. response_format: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. temperature: nil, + # A set of resources that are used by the assistant's tools. The resources are + # specific to the type of tool. For example, the `code_interpreter` tool requires + # a list of file IDs, while the `file_search` tool requires a list of vector store + # IDs. tool_resources: nil, + # A list of tool enabled on the assistant. There can be a maximum of 128 tools per + # assistant. Tools can be of types `code_interpreter`, `file_search`, or + # `function`. tools: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or temperature but not both. top_p: nil, request_options: {} ); end @@ -364,8 +420,13 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # Overrides the list of + # [file](https://platform.openai.com/docs/api-reference/files) IDs made available + # to the `code_interpreter` tool. There can be a maximum of 20 files associated + # with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -382,8 +443,13 @@ module OpenAI attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } - def self.new(vector_store_ids: nil); end - + def self.new( + # Overrides the + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this assistant. There can be a maximum of 1 vector store attached to + # the assistant. + vector_store_ids: nil + ); end sig { override.returns({vector_store_ids: T::Array[String]}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/code_interpreter_tool.rbi b/rbi/lib/openai/models/beta/code_interpreter_tool.rbi index cacd14eb..d1ac9cc7 100644 --- a/rbi/lib/openai/models/beta/code_interpreter_tool.rbi +++ b/rbi/lib/openai/models/beta/code_interpreter_tool.rbi @@ -9,8 +9,10 @@ module OpenAI attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :code_interpreter); end - + def self.new( + # The type of tool being defined: `code_interpreter` + type: :code_interpreter + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/file_search_tool.rbi b/rbi/lib/openai/models/beta/file_search_tool.rbi index ad127d97..e2c738a3 100644 --- a/rbi/lib/openai/models/beta/file_search_tool.rbi +++ b/rbi/lib/openai/models/beta/file_search_tool.rbi @@ -25,8 +25,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_search: nil, type: :file_search); end - + def self.new( + # Overrides for the file search tool. + file_search: nil, + # The type of tool being defined: `file_search` + type: :file_search + ); end sig { override.returns({type: Symbol, file_search: OpenAI::Models::Beta::FileSearchTool::FileSearch}) } def to_hash; end @@ -70,8 +74,24 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(max_num_results: nil, ranking_options: nil); end - + def self.new( + # The maximum number of results the file search tool should output. The default is + # 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between + # 1 and 50 inclusive. + # + # Note that the file search tool may output fewer than `max_num_results` results. + # See the + # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + # for more information. + max_num_results: nil, + # The ranking options for the file search. If not specified, the file search tool + # will use the `auto` ranker and a score_threshold of 0. + # + # See the + # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + # for more information. + ranking_options: nil + ); end sig do override .returns( @@ -107,8 +127,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(score_threshold:, ranker: nil); end - + def self.new( + # The score threshold for the file search. All values must be a floating point + # number between 0 and 1. + score_threshold:, + # The ranker to use for the file search. If not specified will use the `auto` + # ranker. + ranker: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/function_tool.rbi b/rbi/lib/openai/models/beta/function_tool.rbi index b375f86a..5a914d6f 100644 --- a/rbi/lib/openai/models/beta/function_tool.rbi +++ b/rbi/lib/openai/models/beta/function_tool.rbi @@ -18,8 +18,11 @@ module OpenAI params(function: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(function:, type: :function); end - + def self.new( + function:, + # The type of tool being defined: `function` + type: :function + ); end sig { override.returns({function: OpenAI::Models::FunctionDefinition, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/message_stream_event.rbi b/rbi/lib/openai/models/beta/message_stream_event.rbi index 3f070ad2..ad322e59 100644 --- a/rbi/lib/openai/models/beta/message_stream_event.rbi +++ b/rbi/lib/openai/models/beta/message_stream_event.rbi @@ -28,8 +28,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.created"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end @@ -53,8 +57,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.in_progress"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.in_progress" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end @@ -81,8 +89,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.delta"); end - + def self.new( + # Represents a message delta i.e. any changed fields on a message during + # streaming. + data:, + event: :"thread.message.delta" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::MessageDeltaEvent, event: Symbol}) } def to_hash; end end @@ -106,8 +118,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.completed"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.completed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end @@ -131,8 +147,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.message.incomplete"); end - + def self.new( + # Represents a message within a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.message.incomplete" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Message, event: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/run_step_stream_event.rbi b/rbi/lib/openai/models/beta/run_step_stream_event.rbi index c004aab8..80a4d141 100644 --- a/rbi/lib/openai/models/beta/run_step_stream_event.rbi +++ b/rbi/lib/openai/models/beta/run_step_stream_event.rbi @@ -30,8 +30,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.created"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -57,8 +60,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.in_progress"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.in_progress" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -87,8 +93,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.delta"); end - + def self.new( + # Represents a run step delta i.e. any changed fields on a run step during + # streaming. + data:, + event: :"thread.run.step.delta" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, event: Symbol}) } def to_hash; end end @@ -114,8 +124,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.completed"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.completed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -141,8 +154,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.failed"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.failed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -168,8 +184,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.cancelled"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.cancelled" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end @@ -195,8 +214,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.step.expired"); end - + def self.new( + # Represents a step in execution of a run. + data:, + event: :"thread.run.step.expired" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Runs::RunStep, event: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/run_stream_event.rbi b/rbi/lib/openai/models/beta/run_stream_event.rbi index 29f03175..1f8fa007 100644 --- a/rbi/lib/openai/models/beta/run_stream_event.rbi +++ b/rbi/lib/openai/models/beta/run_stream_event.rbi @@ -26,8 +26,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.created"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -50,8 +54,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.queued"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.queued" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -74,8 +82,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.in_progress"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.in_progress" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -98,8 +110,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.requires_action"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.requires_action" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -122,8 +138,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.completed"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.completed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -146,8 +166,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.incomplete"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.incomplete" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -170,8 +194,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.failed"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.failed" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -194,8 +222,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.cancelling"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.cancelling" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -218,8 +250,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.cancelled"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.cancelled" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end @@ -242,8 +278,12 @@ module OpenAI params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Internal::AnyHash), event: Symbol) .returns(T.attached_class) end - def self.new(data:, event: :"thread.run.expired"); end - + def self.new( + # Represents an execution run on a + # [thread](https://platform.openai.com/docs/api-reference/threads). + data:, + event: :"thread.run.expired" + ); end sig { override.returns({data: OpenAI::Models::Beta::Threads::Run, event: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/thread.rbi b/rbi/lib/openai/models/beta/thread.rbi index 0a393255..46c58f55 100644 --- a/rbi/lib/openai/models/beta/thread.rbi +++ b/rbi/lib/openai/models/beta/thread.rbi @@ -52,8 +52,26 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, created_at:, metadata:, tool_resources:, object: :thread); end - + def self.new( + # The identifier, which can be referenced in API endpoints. + id:, + # The Unix timestamp (in seconds) for when the thread was created. + created_at:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata:, + # A set of resources that are made available to the assistant's tools in this + # thread. The resources are specific to the type of tool. For example, the + # `code_interpreter` tool requires a list of file IDs, while the `file_search` + # tool requires a list of vector store IDs. + tool_resources:, + # The object type, which is always `thread`. + object: :thread + ); end sig do override .returns( @@ -126,8 +144,12 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # available to the `code_interpreter` tool. There can be a maximum of 20 files + # associated with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -144,8 +166,13 @@ module OpenAI attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } - def self.new(vector_store_ids: nil); end - + def self.new( + # The + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this thread. There can be a maximum of 1 vector store attached to + # the thread. + vector_store_ids: nil + ); end sig { override.returns({vector_store_ids: T::Array[String]}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi b/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi index ef54ba30..fed5543a 100644 --- a/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi +++ b/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi @@ -231,20 +231,93 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The ID of the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to + # execute this run. assistant_id:, + # Override the default system message of the assistant. This is useful for + # modifying the behavior on a per-run basis. instructions: nil, + # The maximum number of completion tokens that may be used over the course of the + # run. The run will make a best effort to use only the number of completion tokens + # specified, across multiple turns of the run. If the run exceeds the number of + # completion tokens specified, the run will end with status `incomplete`. See + # `incomplete_details` for more info. max_completion_tokens: nil, + # The maximum number of prompt tokens that may be used over the course of the run. + # The run will make a best effort to use only the number of prompt tokens + # specified, across multiple turns of the run. If the run exceeds the number of + # prompt tokens specified, the run will end with status `incomplete`. See + # `incomplete_details` for more info. max_prompt_tokens: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + # be used to execute this run. If a value is provided here, it will override the + # model associated with the assistant. If not, the model associated with the + # assistant will be used. model: nil, + # Whether to enable + # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + # during tool use. parallel_tool_calls: nil, + # Specifies the format that the model must output. Compatible with + # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + # [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + # and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + # + # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + # Outputs which ensures the model will match your supplied JSON schema. Learn more + # in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + # message the model generates is valid JSON. + # + # **Important:** when using JSON mode, you **must** also instruct the model to + # produce JSON yourself via a system or user message. Without this, the model may + # generate an unending stream of whitespace until the generation reaches the token + # limit, resulting in a long-running and seemingly "stuck" request. Also note that + # the message content may be partially cut off if `finish_reason="length"`, which + # indicates the generation exceeded `max_tokens` or the conversation exceeded the + # max context length. response_format: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. temperature: nil, + # Options to create a new thread. If no thread is provided when running a request, + # an empty thread will be created. thread: nil, + # Controls which (if any) tool is called by the model. `none` means the model will + # not call any tools and instead generates a message. `auto` is the default value + # and means the model can pick between generating a message or calling one or more + # tools. `required` means the model must call one or more tools before responding + # to the user. Specifying a particular tool like `{"type": "file_search"}` or + # `{"type": "function", "function": {"name": "my_function"}}` forces the model to + # call that tool. tool_choice: nil, + # A set of resources that are used by the assistant's tools. The resources are + # specific to the type of tool. For example, the `code_interpreter` tool requires + # a list of file IDs, while the `file_search` tool requires a list of vector store + # IDs. tool_resources: nil, + # Override the tools the assistant can use for this run. This is useful for + # modifying the behavior on a per-run basis. tools: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or temperature but not both. top_p: nil, + # Controls for how a thread will be truncated prior to the run. Use this to + # control the intial context window of the run. truncation_strategy: nil, request_options: {} ); end @@ -356,8 +429,23 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(messages: nil, metadata: nil, tool_resources: nil); end - + def self.new( + # A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + # start the thread with. + messages: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # A set of resources that are made available to the assistant's tools in this + # thread. The resources are specific to the type of tool. For example, the + # `code_interpreter` tool requires a list of file IDs, while the `file_search` + # tool requires a list of vector store IDs. + tool_resources: nil + ); end sig do override .returns( @@ -436,8 +524,26 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, attachments: nil, metadata: nil); end - + def self.new( + # The text contents of the message. + content:, + # The role of the entity that is creating the message. Allowed values include: + # + # - `user`: Indicates the message is sent by an actual user and should be used in + # most cases to represent user-generated messages. + # - `assistant`: Indicates the message is generated by the assistant. Use this + # value to insert messages from the assistant into the conversation. + role:, + # A list of files attached to the message, and the tools they should be added to. + attachments: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil + ); end sig do override .returns( @@ -562,8 +668,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_id: nil, tools: nil); end - + def self.new( + # The ID of the file to attach to the message. + file_id: nil, + # The tools to add this file to. + tools: nil + ); end sig do override .returns( @@ -589,8 +699,10 @@ module OpenAI attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :file_search); end - + def self.new( + # The type of tool being defined: `file_search` + type: :file_search + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -676,8 +788,12 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # available to the `code_interpreter` tool. There can be a maximum of 20 files + # associated with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -731,8 +847,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(vector_store_ids: nil, vector_stores: nil); end - + def self.new( + # The + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this thread. There can be a maximum of 1 vector store attached to + # the thread. + vector_store_ids: nil, + # A helper to create a + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # with file_ids and attach it to this thread. There can be a maximum of 1 vector + # store attached to the thread. + vector_stores: nil + ); end sig do override .returns( @@ -801,8 +927,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(chunking_strategy: nil, file_ids: nil, metadata: nil); end - + def self.new( + # The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # strategy. + chunking_strategy: nil, + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to + # add to the vector store. There can be a maximum of 10000 files in a vector + # store. + file_ids: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil + ); end sig do override .returns( @@ -831,8 +971,10 @@ module OpenAI # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :auto); end - + def self.new( + # Always `auto`. + type: :auto + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -870,8 +1012,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(static:, type: :static); end - + def self.new( + static:, + # Always `static`. + type: :static + ); end sig do override .returns( @@ -901,8 +1046,15 @@ module OpenAI max_chunk_size_tokens: Integer ).returns(T.attached_class) end - def self.new(chunk_overlap_tokens:, max_chunk_size_tokens:); end - + def self.new( + # The number of tokens that overlap between chunks. The default value is `400`. + # + # Note that the overlap must not exceed half of `max_chunk_size_tokens`. + chunk_overlap_tokens:, + # The maximum number of tokens in each chunk. The default value is `800`. The + # minimum value is `100` and the maximum value is `4096`. + max_chunk_size_tokens: + ); end sig do override.returns({chunk_overlap_tokens: Integer, max_chunk_size_tokens: Integer}) end @@ -993,8 +1145,12 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # available to the `code_interpreter` tool. There can be a maximum of 20 files + # associated with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -1011,8 +1167,13 @@ module OpenAI attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } - def self.new(vector_store_ids: nil); end - + def self.new( + # The ID of the + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this assistant. There can be a maximum of 1 vector store attached to + # the assistant. + vector_store_ids: nil + ); end sig { override.returns({vector_store_ids: T::Array[String]}) } def to_hash; end end @@ -1040,8 +1201,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(type:, last_messages: nil); end - + def self.new( + # The truncation strategy to use for the thread. The default is `auto`. If set to + # `last_messages`, the thread will be truncated to the n most recent messages in + # the thread. When set to `auto`, messages in the middle of the thread will be + # dropped to fit the context length of the model, `max_prompt_tokens`. + type:, + # The number of most recent messages from the thread when constructing the context + # for the run. + last_messages: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/thread_create_params.rbi b/rbi/lib/openai/models/beta/thread_create_params.rbi index 6d1ed043..7a7ae81c 100644 --- a/rbi/lib/openai/models/beta/thread_create_params.rbi +++ b/rbi/lib/openai/models/beta/thread_create_params.rbi @@ -53,8 +53,24 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(messages: nil, metadata: nil, tool_resources: nil, request_options: {}); end - + def self.new( + # A list of [messages](https://platform.openai.com/docs/api-reference/messages) to + # start the thread with. + messages: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # A set of resources that are made available to the assistant's tools in this + # thread. The resources are specific to the type of tool. For example, the + # `code_interpreter` tool requires a list of file IDs, while the `file_search` + # tool requires a list of vector store IDs. + tool_resources: nil, + request_options: {} + ); end sig do override .returns( @@ -129,8 +145,26 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, attachments: nil, metadata: nil); end - + def self.new( + # The text contents of the message. + content:, + # The role of the entity that is creating the message. Allowed values include: + # + # - `user`: Indicates the message is sent by an actual user and should be used in + # most cases to represent user-generated messages. + # - `assistant`: Indicates the message is generated by the assistant. Use this + # value to insert messages from the assistant into the conversation. + role:, + # A list of files attached to the message, and the tools they should be added to. + attachments: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil + ); end sig do override .returns( @@ -250,8 +284,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_id: nil, tools: nil); end - + def self.new( + # The ID of the file to attach to the message. + file_id: nil, + # The tools to add this file to. + tools: nil + ); end sig do override .returns( @@ -277,8 +315,10 @@ module OpenAI attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :file_search); end - + def self.new( + # The type of tool being defined: `file_search` + type: :file_search + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -352,8 +392,12 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # available to the `code_interpreter` tool. There can be a maximum of 20 files + # associated with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -405,8 +449,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(vector_store_ids: nil, vector_stores: nil); end - + def self.new( + # The + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this thread. There can be a maximum of 1 vector store attached to + # the thread. + vector_store_ids: nil, + # A helper to create a + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # with file_ids and attach it to this thread. There can be a maximum of 1 vector + # store attached to the thread. + vector_stores: nil + ); end sig do override .returns( @@ -475,8 +529,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(chunking_strategy: nil, file_ids: nil, metadata: nil); end - + def self.new( + # The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # strategy. + chunking_strategy: nil, + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to + # add to the vector store. There can be a maximum of 10000 files in a vector + # store. + file_ids: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil + ); end sig do override .returns( @@ -505,8 +573,10 @@ module OpenAI # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :auto); end - + def self.new( + # Always `auto`. + type: :auto + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -544,8 +614,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(static:, type: :static); end - + def self.new( + static:, + # Always `static`. + type: :static + ); end sig do override .returns( @@ -575,8 +648,15 @@ module OpenAI max_chunk_size_tokens: Integer ).returns(T.attached_class) end - def self.new(chunk_overlap_tokens:, max_chunk_size_tokens:); end - + def self.new( + # The number of tokens that overlap between chunks. The default value is `400`. + # + # Note that the overlap must not exceed half of `max_chunk_size_tokens`. + chunk_overlap_tokens:, + # The maximum number of tokens in each chunk. The default value is `800`. The + # minimum value is `100` and the maximum value is `4096`. + max_chunk_size_tokens: + ); end sig { override.returns({chunk_overlap_tokens: Integer, max_chunk_size_tokens: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/thread_stream_event.rbi b/rbi/lib/openai/models/beta/thread_stream_event.rbi index f169b98c..b8bd735a 100644 --- a/rbi/lib/openai/models/beta/thread_stream_event.rbi +++ b/rbi/lib/openai/models/beta/thread_stream_event.rbi @@ -33,8 +33,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, enabled: nil, event: :"thread.created"); end - + def self.new( + # Represents a thread that contains + # [messages](https://platform.openai.com/docs/api-reference/messages). + data:, + # Whether to enable input audio transcription. + enabled: nil, + event: :"thread.created" + ); end sig { override.returns({data: OpenAI::Models::Beta::Thread, event: Symbol, enabled: T::Boolean}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/thread_update_params.rbi b/rbi/lib/openai/models/beta/thread_update_params.rbi index 1eb3f670..9af4b827 100644 --- a/rbi/lib/openai/models/beta/thread_update_params.rbi +++ b/rbi/lib/openai/models/beta/thread_update_params.rbi @@ -39,8 +39,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(metadata: nil, tool_resources: nil, request_options: {}); end - + def self.new( + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # A set of resources that are made available to the assistant's tools in this + # thread. The resources are specific to the type of tool. For example, the + # `code_interpreter` tool requires a list of file IDs, while the `file_search` + # tool requires a list of vector store IDs. + tool_resources: nil, + request_options: {} + ); end sig do override .returns( @@ -111,8 +124,12 @@ module OpenAI attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } - def self.new(file_ids: nil); end - + def self.new( + # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made + # available to the `code_interpreter` tool. There can be a maximum of 20 files + # associated with the tool. + file_ids: nil + ); end sig { override.returns({file_ids: T::Array[String]}) } def to_hash; end end @@ -129,8 +146,13 @@ module OpenAI attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } - def self.new(vector_store_ids: nil); end - + def self.new( + # The + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # attached to this thread. There can be a maximum of 1 vector store attached to + # the thread. + vector_store_ids: nil + ); end sig { override.returns({vector_store_ids: T::Array[String]}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi index a9b10bb9..8f129c30 100644 --- a/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi @@ -43,8 +43,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(end_index:, file_citation:, start_index:, text:, type: :file_citation); end - + def self.new( + end_index:, + file_citation:, + start_index:, + # The text in the message content that needs to be replaced. + text:, + # Always `file_citation`. + type: :file_citation + ); end sig do override .returns( @@ -65,8 +72,10 @@ module OpenAI attr_accessor :file_id sig { params(file_id: String).returns(T.attached_class) } - def self.new(file_id:); end - + def self.new( + # The ID of the specific File the citation is from. + file_id: + ); end sig { override.returns({file_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi index 1d28545a..5d81ac86 100644 --- a/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi @@ -58,15 +58,16 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The index of the annotation in the text content part. index:, end_index: nil, file_citation: nil, start_index: nil, + # The text in the message content that needs to be replaced. text: nil, + # Always `file_citation`. type: :file_citation - ) - end - + ); end sig do override .returns( @@ -98,8 +99,12 @@ module OpenAI attr_writer :quote sig { params(file_id: String, quote: String).returns(T.attached_class) } - def self.new(file_id: nil, quote: nil); end - + def self.new( + # The ID of the specific File the citation is from. + file_id: nil, + # The specific quote in the file. + quote: nil + ); end sig { override.returns({file_id: String, quote: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi index 87953109..fc4afa16 100644 --- a/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi @@ -42,8 +42,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(end_index:, file_path:, start_index:, text:, type: :file_path); end - + def self.new( + end_index:, + file_path:, + start_index:, + # The text in the message content that needs to be replaced. + text:, + # Always `file_path`. + type: :file_path + ); end sig do override .returns( @@ -64,8 +71,10 @@ module OpenAI attr_accessor :file_id sig { params(file_id: String).returns(T.attached_class) } - def self.new(file_id:); end - + def self.new( + # The ID of the file that was generated. + file_id: + ); end sig { override.returns({file_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi index 4c2c8c36..e58879be 100644 --- a/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi @@ -56,9 +56,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, end_index: nil, file_path: nil, start_index: nil, text: nil, type: :file_path) - end - + def self.new( + # The index of the annotation in the text content part. + index:, + end_index: nil, + file_path: nil, + start_index: nil, + # The text in the message content that needs to be replaced. + text: nil, + # Always `file_path`. + type: :file_path + ); end sig do override .returns( @@ -83,8 +91,10 @@ module OpenAI attr_writer :file_id sig { params(file_id: String).returns(T.attached_class) } - def self.new(file_id: nil); end - + def self.new( + # The ID of the file that was generated. + file_id: nil + ); end sig { override.returns({file_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/image_file.rbi b/rbi/lib/openai/models/beta/threads/image_file.rbi index c6c13ccf..f7ded701 100644 --- a/rbi/lib/openai/models/beta/threads/image_file.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file.rbi @@ -23,8 +23,15 @@ module OpenAI params(file_id: String, detail: OpenAI::Models::Beta::Threads::ImageFile::Detail::OrSymbol) .returns(T.attached_class) end - def self.new(file_id:, detail: nil); end - + def self.new( + # The [File](https://platform.openai.com/docs/api-reference/files) ID of the image + # in the message content. Set `purpose="vision"` when uploading the File if you + # need to later display the file content. + file_id:, + # Specifies the detail level of the image if specified by the user. `low` uses + # fewer tokens, you can opt in to high resolution using `high`. + detail: nil + ); end sig { override.returns({file_id: String, detail: OpenAI::Models::Beta::Threads::ImageFile::Detail::OrSymbol}) } def to_hash; end diff --git a/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi b/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi index 90524b05..1b87fd3f 100644 --- a/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi @@ -24,8 +24,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(image_file:, type: :image_file); end - + def self.new( + image_file:, + # Always `image_file`. + type: :image_file + ); end sig { override.returns({image_file: OpenAI::Models::Beta::Threads::ImageFile, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/image_file_delta.rbi b/rbi/lib/openai/models/beta/threads/image_file_delta.rbi index c677a276..628e1cef 100644 --- a/rbi/lib/openai/models/beta/threads/image_file_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file_delta.rbi @@ -26,8 +26,15 @@ module OpenAI params(detail: OpenAI::Models::Beta::Threads::ImageFileDelta::Detail::OrSymbol, file_id: String) .returns(T.attached_class) end - def self.new(detail: nil, file_id: nil); end - + def self.new( + # Specifies the detail level of the image if specified by the user. `low` uses + # fewer tokens, you can opt in to high resolution using `high`. + detail: nil, + # The [File](https://platform.openai.com/docs/api-reference/files) ID of the image + # in the message content. Set `purpose="vision"` when uploading the File if you + # need to later display the file content. + file_id: nil + ); end sig do override .returns({detail: OpenAI::Models::Beta::Threads::ImageFileDelta::Detail::TaggedSymbol, file_id: String}) diff --git a/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi b/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi index 74be2ead..c0ae3f1e 100644 --- a/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi @@ -29,8 +29,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, image_file: nil, type: :image_file); end - + def self.new( + # The index of the content part in the message. + index:, + image_file: nil, + # Always `image_file`. + type: :image_file + ); end sig do override.returns({index: Integer, type: Symbol, image_file: OpenAI::Models::Beta::Threads::ImageFileDelta}) end diff --git a/rbi/lib/openai/models/beta/threads/image_url.rbi b/rbi/lib/openai/models/beta/threads/image_url.rbi index b98e88e4..6c364602 100644 --- a/rbi/lib/openai/models/beta/threads/image_url.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url.rbi @@ -22,8 +22,14 @@ module OpenAI params(url: String, detail: OpenAI::Models::Beta::Threads::ImageURL::Detail::OrSymbol) .returns(T.attached_class) end - def self.new(url:, detail: nil); end - + def self.new( + # The external URL of the image, must be a supported image types: jpeg, jpg, png, + # gif, webp. + url:, + # Specifies the detail level of the image. `low` uses fewer tokens, you can opt in + # to high resolution using `high`. Default value is `auto` + detail: nil + ); end sig { override.returns({url: String, detail: OpenAI::Models::Beta::Threads::ImageURL::Detail::OrSymbol}) } def to_hash; end diff --git a/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi b/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi index a960242b..53b64254 100644 --- a/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi @@ -20,8 +20,11 @@ module OpenAI params(image_url: T.any(OpenAI::Models::Beta::Threads::ImageURL, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(image_url:, type: :image_url); end - + def self.new( + image_url:, + # The type of the content part. + type: :image_url + ); end sig { override.returns({image_url: OpenAI::Models::Beta::Threads::ImageURL, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/image_url_delta.rbi b/rbi/lib/openai/models/beta/threads/image_url_delta.rbi index a9c81f3e..0de64fe7 100644 --- a/rbi/lib/openai/models/beta/threads/image_url_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url_delta.rbi @@ -25,8 +25,14 @@ module OpenAI params(detail: OpenAI::Models::Beta::Threads::ImageURLDelta::Detail::OrSymbol, url: String) .returns(T.attached_class) end - def self.new(detail: nil, url: nil); end - + def self.new( + # Specifies the detail level of the image. `low` uses fewer tokens, you can opt in + # to high resolution using `high`. + detail: nil, + # The URL of the image, must be a supported image types: jpeg, jpg, png, gif, + # webp. + url: nil + ); end sig do override.returns({detail: OpenAI::Models::Beta::Threads::ImageURLDelta::Detail::TaggedSymbol, url: String}) end diff --git a/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi b/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi index ed36acf3..e7eb2ab2 100644 --- a/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi @@ -28,8 +28,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, image_url: nil, type: :image_url); end - + def self.new( + # The index of the content part in the message. + index:, + image_url: nil, + # Always `image_url`. + type: :image_url + ); end sig { override.returns({index: Integer, type: Symbol, image_url: OpenAI::Models::Beta::Threads::ImageURLDelta}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/message.rbi b/rbi/lib/openai/models/beta/threads/message.rbi index eef51a4c..3c4ecef7 100644 --- a/rbi/lib/openai/models/beta/threads/message.rbi +++ b/rbi/lib/openai/models/beta/threads/message.rbi @@ -121,19 +121,44 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The identifier, which can be referenced in API endpoints. id:, + # If applicable, the ID of the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) that + # authored this message. assistant_id:, + # A list of files attached to the message, and the tools they were added to. attachments:, + # The Unix timestamp (in seconds) for when the message was completed. completed_at:, + # The content of the message in array of text and/or images. content:, + # The Unix timestamp (in seconds) for when the message was created. created_at:, + # The Unix timestamp (in seconds) for when the message was marked as incomplete. incomplete_at:, + # On an incomplete message, details about why the message is incomplete. incomplete_details:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The entity that produced the message. One of `user` or `assistant`. role:, + # The ID of the [run](https://platform.openai.com/docs/api-reference/runs) + # associated with the creation of this message. Value is `null` when messages are + # created manually using the create message or create thread endpoints. run_id:, + # The status of the message, which can be either `in_progress`, `incomplete`, or + # `completed`. status:, + # The [thread](https://platform.openai.com/docs/api-reference/threads) ID that + # this message belongs to. thread_id:, + # The object type, which is always `thread.message`. object: :"thread.message" ); end sig do @@ -216,8 +241,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_id: nil, tools: nil); end - + def self.new( + # The ID of the file to attach to the message. + file_id: nil, + # The tools to add this file to. + tools: nil + ); end sig do override .returns( @@ -243,8 +272,10 @@ module OpenAI attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :file_search); end - + def self.new( + # The type of tool being defined: `file_search` + type: :file_search + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -269,8 +300,10 @@ module OpenAI params(reason: OpenAI::Models::Beta::Threads::Message::IncompleteDetails::Reason::OrSymbol) .returns(T.attached_class) end - def self.new(reason:); end - + def self.new( + # The reason the message is incomplete. + reason: + ); end sig do override.returns({reason: OpenAI::Models::Beta::Threads::Message::IncompleteDetails::Reason::TaggedSymbol}) end diff --git a/rbi/lib/openai/models/beta/threads/message_create_params.rbi b/rbi/lib/openai/models/beta/threads/message_create_params.rbi index 6c57ca1f..326dc671 100644 --- a/rbi/lib/openai/models/beta/threads/message_create_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_create_params.rbi @@ -69,8 +69,27 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, attachments: nil, metadata: nil, request_options: {}); end - + def self.new( + # The text contents of the message. + content:, + # The role of the entity that is creating the message. Allowed values include: + # + # - `user`: Indicates the message is sent by an actual user and should be used in + # most cases to represent user-generated messages. + # - `assistant`: Indicates the message is generated by the assistant. Use this + # value to insert messages from the assistant into the conversation. + role:, + # A list of files attached to the message, and the tools they should be added to. + attachments: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + request_options: {} + ); end sig do override .returns( @@ -191,8 +210,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_id: nil, tools: nil); end - + def self.new( + # The ID of the file to attach to the message. + file_id: nil, + # The tools to add this file to. + tools: nil + ); end sig do override .returns( @@ -218,8 +241,10 @@ module OpenAI attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :file_search); end - + def self.new( + # The type of tool being defined: `file_search` + type: :file_search + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/message_delta.rbi b/rbi/lib/openai/models/beta/threads/message_delta.rbi index 6156e86b..55f3b251 100644 --- a/rbi/lib/openai/models/beta/threads/message_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/message_delta.rbi @@ -61,8 +61,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content: nil, role: nil); end - + def self.new( + # The content of the message in array of text and/or images. + content: nil, + # The entity that produced the message. One of `user` or `assistant`. + role: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/message_delta_event.rbi b/rbi/lib/openai/models/beta/threads/message_delta_event.rbi index f5e5b29b..4e6d3d17 100644 --- a/rbi/lib/openai/models/beta/threads/message_delta_event.rbi +++ b/rbi/lib/openai/models/beta/threads/message_delta_event.rbi @@ -30,8 +30,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, delta:, object: :"thread.message.delta"); end - + def self.new( + # The identifier of the message, which can be referenced in API endpoints. + id:, + # The delta containing the fields that have changed on the Message. + delta:, + # The object type, which is always `thread.message.delta`. + object: :"thread.message.delta" + ); end sig { override.returns({id: String, delta: OpenAI::Models::Beta::Threads::MessageDelta, object: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/message_list_params.rbi b/rbi/lib/openai/models/beta/threads/message_list_params.rbi index 945d30d3..50cf3829 100644 --- a/rbi/lib/openai/models/beta/threads/message_list_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_list_params.rbi @@ -62,8 +62,27 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, before: nil, limit: nil, order: nil, run_id: nil, request_options: {}); end - + def self.new( + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. + after: nil, + # A cursor for use in pagination. `before` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # starting with obj_foo, your subsequent call can include before=obj_foo in order + # to fetch the previous page of the list. + before: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. + limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. + order: nil, + # Filter messages by the run ID that generated them. + run_id: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/message_update_params.rbi b/rbi/lib/openai/models/beta/threads/message_update_params.rbi index 09e67673..33d47d32 100644 --- a/rbi/lib/openai/models/beta/threads/message_update_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_update_params.rbi @@ -28,8 +28,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(thread_id:, metadata: nil, request_options: {}); end - + def self.new( + thread_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi b/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi index 591afe27..70e4dbb9 100644 --- a/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi @@ -14,8 +14,11 @@ module OpenAI # The refusal content generated by the assistant. sig { params(refusal: String, type: Symbol).returns(T.attached_class) } - def self.new(refusal:, type: :refusal); end - + def self.new( + refusal:, + # Always `refusal`. + type: :refusal + ); end sig { override.returns({refusal: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi b/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi index 8c9e2d1f..8b3878d9 100644 --- a/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi @@ -21,8 +21,13 @@ module OpenAI # The refusal content that is part of a message. sig { params(index: Integer, refusal: String, type: Symbol).returns(T.attached_class) } - def self.new(index:, refusal: nil, type: :refusal); end - + def self.new( + # The index of the refusal part in the message. + index:, + refusal: nil, + # Always `refusal`. + type: :refusal + ); end sig { override.returns({index: Integer, type: Symbol, refusal: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi b/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi index 61ec2da8..b1788c25 100644 --- a/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi @@ -38,8 +38,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, function:, type: :function); end - + def self.new( + # The ID of the tool call. This ID must be referenced when you submit the tool + # outputs in using the + # [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + # endpoint. + id:, + # The function definition. + function:, + # The type of tool call the output is required for. For now, this is always + # `function`. + type: :function + ); end sig do override .returns( @@ -59,8 +69,12 @@ module OpenAI # The function definition. sig { params(arguments: String, name: String).returns(T.attached_class) } - def self.new(arguments:, name:); end - + def self.new( + # The arguments that the model expects you to pass to the function. + arguments:, + # The name of the function. + name: + ); end sig { override.returns({arguments: String, name: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/run.rbi b/rbi/lib/openai/models/beta/threads/run.rbi index f0708be8..102cf828 100644 --- a/rbi/lib/openai/models/beta/threads/run.rbi +++ b/rbi/lib/openai/models/beta/threads/run.rbi @@ -283,32 +283,108 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The identifier, which can be referenced in API endpoints. id:, + # The ID of the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + # execution of this run. assistant_id:, + # The Unix timestamp (in seconds) for when the run was cancelled. cancelled_at:, + # The Unix timestamp (in seconds) for when the run was completed. completed_at:, + # The Unix timestamp (in seconds) for when the run was created. created_at:, + # The Unix timestamp (in seconds) for when the run will expire. expires_at:, + # The Unix timestamp (in seconds) for when the run failed. failed_at:, + # Details on why the run is incomplete. Will be `null` if the run is not + # incomplete. incomplete_details:, + # The instructions that the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + # this run. instructions:, + # The last error associated with this run. Will be `null` if there are no errors. last_error:, + # The maximum number of completion tokens specified to have been used over the + # course of the run. max_completion_tokens:, + # The maximum number of prompt tokens specified to have been used over the course + # of the run. max_prompt_tokens:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The model that the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + # this run. model:, + # Whether to enable + # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + # during tool use. parallel_tool_calls:, + # Details on the action required to continue the run. Will be `null` if no action + # is required. required_action:, + # Specifies the format that the model must output. Compatible with + # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + # [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + # and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + # + # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + # Outputs which ensures the model will match your supplied JSON schema. Learn more + # in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + # message the model generates is valid JSON. + # + # **Important:** when using JSON mode, you **must** also instruct the model to + # produce JSON yourself via a system or user message. Without this, the model may + # generate an unending stream of whitespace until the generation reaches the token + # limit, resulting in a long-running and seemingly "stuck" request. Also note that + # the message content may be partially cut off if `finish_reason="length"`, which + # indicates the generation exceeded `max_tokens` or the conversation exceeded the + # max context length. response_format:, + # The Unix timestamp (in seconds) for when the run was started. started_at:, + # The status of the run, which can be either `queued`, `in_progress`, + # `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, + # `incomplete`, or `expired`. status:, + # The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) + # that was executed on as a part of this run. thread_id:, + # Controls which (if any) tool is called by the model. `none` means the model will + # not call any tools and instead generates a message. `auto` is the default value + # and means the model can pick between generating a message or calling one or more + # tools. `required` means the model must call one or more tools before responding + # to the user. Specifying a particular tool like `{"type": "file_search"}` or + # `{"type": "function", "function": {"name": "my_function"}}` forces the model to + # call that tool. tool_choice:, + # The list of tools that the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + # this run. tools:, + # Controls for how a thread will be truncated prior to the run. Use this to + # control the intial context window of the run. truncation_strategy:, + # Usage statistics related to the run. This value will be `null` if the run is not + # in a terminal state (i.e. `in_progress`, `queued`, etc.). usage:, + # The sampling temperature used for this run. If not set, defaults to 1. temperature: nil, + # The nucleus sampling value used for this run. If not set, defaults to 1. top_p: nil, + # The object type, which is always `thread.run`. object: :"thread.run" ); end sig do @@ -380,8 +456,11 @@ module OpenAI params(reason: OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason::OrSymbol) .returns(T.attached_class) end - def self.new(reason: nil); end - + def self.new( + # The reason why the run is incomplete. This will point to which specific token + # limit was reached over the course of the run. + reason: nil + ); end sig { override.returns({reason: OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason::TaggedSymbol}) } def to_hash; end @@ -418,8 +497,12 @@ module OpenAI params(code: OpenAI::Models::Beta::Threads::Run::LastError::Code::OrSymbol, message: String) .returns(T.attached_class) end - def self.new(code:, message:); end - + def self.new( + # One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + code:, + # A human-readable description of the error. + message: + ); end sig do override .returns({code: OpenAI::Models::Beta::Threads::Run::LastError::Code::TaggedSymbol, message: String}) @@ -470,8 +553,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(submit_tool_outputs:, type: :submit_tool_outputs); end - + def self.new( + # Details on the tool outputs needed for this run to continue. + submit_tool_outputs:, + # For now, this is always `submit_tool_outputs`. + type: :submit_tool_outputs + ); end sig do override .returns( @@ -492,8 +579,10 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(tool_calls:); end - + def self.new( + # A list of the relevant tool calls. + tool_calls: + ); end sig { override.returns({tool_calls: T::Array[OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall]}) } def to_hash; end end @@ -521,8 +610,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(type:, last_messages: nil); end - + def self.new( + # The truncation strategy to use for the thread. The default is `auto`. If set to + # `last_messages`, the thread will be truncated to the n most recent messages in + # the thread. When set to `auto`, messages in the middle of the thread will be + # dropped to fit the context length of the model, `max_prompt_tokens`. + type:, + # The number of most recent messages from the thread when constructing the context + # for the run. + last_messages: nil + ); end sig do override .returns( @@ -576,8 +673,14 @@ module OpenAI total_tokens: Integer ).returns(T.attached_class) end - def self.new(completion_tokens:, prompt_tokens:, total_tokens:); end - + def self.new( + # Number of completion tokens used over the course of the run. + completion_tokens:, + # Number of prompt tokens used over the course of the run. + prompt_tokens:, + # Total number of tokens used (prompt + completion). + total_tokens: + ); end sig do override.returns({completion_tokens: Integer, prompt_tokens: Integer, total_tokens: Integer}) end diff --git a/rbi/lib/openai/models/beta/threads/run_create_params.rbi b/rbi/lib/openai/models/beta/threads/run_create_params.rbi index 3d4cc20a..9bee75b3 100644 --- a/rbi/lib/openai/models/beta/threads/run_create_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_create_params.rbi @@ -243,22 +243,107 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The ID of the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to + # execute this run. assistant_id:, + # A list of additional fields to include in the response. Currently the only + # supported value is `step_details.tool_calls[*].file_search.results[*].content` + # to fetch the file search result content. + # + # See the + # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + # for more information. include: nil, + # Appends additional instructions at the end of the instructions for the run. This + # is useful for modifying the behavior on a per-run basis without overriding other + # instructions. additional_instructions: nil, + # Adds additional messages to the thread before creating the run. additional_messages: nil, + # Overrides the + # [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) + # of the assistant. This is useful for modifying the behavior on a per-run basis. instructions: nil, + # The maximum number of completion tokens that may be used over the course of the + # run. The run will make a best effort to use only the number of completion tokens + # specified, across multiple turns of the run. If the run exceeds the number of + # completion tokens specified, the run will end with status `incomplete`. See + # `incomplete_details` for more info. max_completion_tokens: nil, + # The maximum number of prompt tokens that may be used over the course of the run. + # The run will make a best effort to use only the number of prompt tokens + # specified, across multiple turns of the run. If the run exceeds the number of + # prompt tokens specified, the run will end with status `incomplete`. See + # `incomplete_details` for more info. max_prompt_tokens: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + # be used to execute this run. If a value is provided here, it will override the + # model associated with the assistant. If not, the model associated with the + # assistant will be used. model: nil, + # Whether to enable + # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + # during tool use. parallel_tool_calls: nil, + # **o-series models only** + # + # Constrains effort on reasoning for + # [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can + # result in faster responses and fewer tokens used on reasoning in a response. reasoning_effort: nil, + # Specifies the format that the model must output. Compatible with + # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + # [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + # and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + # + # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + # Outputs which ensures the model will match your supplied JSON schema. Learn more + # in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + # message the model generates is valid JSON. + # + # **Important:** when using JSON mode, you **must** also instruct the model to + # produce JSON yourself via a system or user message. Without this, the model may + # generate an unending stream of whitespace until the generation reaches the token + # limit, resulting in a long-running and seemingly "stuck" request. Also note that + # the message content may be partially cut off if `finish_reason="length"`, which + # indicates the generation exceeded `max_tokens` or the conversation exceeded the + # max context length. response_format: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. temperature: nil, + # Controls which (if any) tool is called by the model. `none` means the model will + # not call any tools and instead generates a message. `auto` is the default value + # and means the model can pick between generating a message or calling one or more + # tools. `required` means the model must call one or more tools before responding + # to the user. Specifying a particular tool like `{"type": "file_search"}` or + # `{"type": "function", "function": {"name": "my_function"}}` forces the model to + # call that tool. tool_choice: nil, + # Override the tools the assistant can use for this run. This is useful for + # modifying the behavior on a per-run basis. tools: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or temperature but not both. top_p: nil, + # Controls for how a thread will be truncated prior to the run. Use this to + # control the intial context window of the run. truncation_strategy: nil, request_options: {} ); end @@ -379,8 +464,26 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, attachments: nil, metadata: nil); end - + def self.new( + # The text contents of the message. + content:, + # The role of the entity that is creating the message. Allowed values include: + # + # - `user`: Indicates the message is sent by an actual user and should be used in + # most cases to represent user-generated messages. + # - `assistant`: Indicates the message is generated by the assistant. Use this + # value to insert messages from the assistant into the conversation. + role:, + # A list of files attached to the message, and the tools they should be added to. + attachments: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil + ); end sig do override .returns( @@ -506,8 +609,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_id: nil, tools: nil); end - + def self.new( + # The ID of the file to attach to the message. + file_id: nil, + # The tools to add this file to. + tools: nil + ); end sig do override .returns( @@ -533,8 +640,10 @@ module OpenAI attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :file_search); end - + def self.new( + # The type of tool being defined: `file_search` + type: :file_search + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -583,8 +692,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(type:, last_messages: nil); end - + def self.new( + # The truncation strategy to use for the thread. The default is `auto`. If set to + # `last_messages`, the thread will be truncated to the n most recent messages in + # the thread. When set to `auto`, messages in the middle of the thread will be + # dropped to fit the context length of the model, `max_prompt_tokens`. + type:, + # The number of most recent messages from the thread when constructing the context + # for the run. + last_messages: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/run_list_params.rbi b/rbi/lib/openai/models/beta/threads/run_list_params.rbi index d38cd84b..24f6d425 100644 --- a/rbi/lib/openai/models/beta/threads/run_list_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_list_params.rbi @@ -54,8 +54,25 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, before: nil, limit: nil, order: nil, request_options: {}); end - + def self.new( + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. + after: nil, + # A cursor for use in pagination. `before` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # starting with obj_foo, your subsequent call can include before=obj_foo in order + # to fetch the previous page of the list. + before: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. + limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. + order: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi b/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi index e347bb7b..af244e16 100644 --- a/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi @@ -23,8 +23,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(thread_id:, tool_outputs:, request_options: {}); end - + def self.new( + thread_id:, + # A list of tools for which the outputs are being submitted. + tool_outputs:, + request_options: {} + ); end sig do override .returns( @@ -54,8 +58,13 @@ module OpenAI attr_writer :tool_call_id sig { params(output: String, tool_call_id: String).returns(T.attached_class) } - def self.new(output: nil, tool_call_id: nil); end - + def self.new( + # The output of the tool call to be submitted to continue the run. + output: nil, + # The ID of the tool call in the `required_action` object within the run object + # the output is being submitted for. + tool_call_id: nil + ); end sig { override.returns({output: String, tool_call_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/run_update_params.rbi b/rbi/lib/openai/models/beta/threads/run_update_params.rbi index 9c4e4bb2..175d4516 100644 --- a/rbi/lib/openai/models/beta/threads/run_update_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_update_params.rbi @@ -28,8 +28,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(thread_id:, metadata: nil, request_options: {}); end - + def self.new( + thread_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi index a751e294..f0b834d2 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi @@ -23,8 +23,14 @@ module OpenAI # Text output from the Code Interpreter tool call as part of a run step. sig { params(index: Integer, logs: String, type: Symbol).returns(T.attached_class) } - def self.new(index:, logs: nil, type: :logs); end - + def self.new( + # The index of the output in the outputs array. + index:, + # The text output from the Code Interpreter tool call. + logs: nil, + # Always `logs`. + type: :logs + ); end sig { override.returns({index: Integer, type: Symbol, logs: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi index 3cc75c96..9cadda46 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi @@ -33,8 +33,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, image: nil, type: :image); end - + def self.new( + # The index of the output in the outputs array. + index:, + image: nil, + # Always `image`. + type: :image + ); end sig do override .returns( @@ -53,8 +58,11 @@ module OpenAI attr_writer :file_id sig { params(file_id: String).returns(T.attached_class) } - def self.new(file_id: nil); end - + def self.new( + # The [file](https://platform.openai.com/docs/api-reference/files) ID of the + # image. + file_id: nil + ); end sig { override.returns({file_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi index 898db2f2..7ea07c11 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi @@ -42,8 +42,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, code_interpreter:, type: :code_interpreter); end - + def self.new( + # The ID of the tool call. + id:, + # The Code Interpreter tool call definition. + code_interpreter:, + # The type of tool call. This is always going to be `code_interpreter` for this + # type of tool call. + type: :code_interpreter + ); end sig do override .returns( @@ -90,8 +97,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input:, outputs:); end - + def self.new( + # The input to the Code Interpreter tool call. + input:, + # The outputs from the Code Interpreter tool call. Code Interpreter can output one + # or more items, including text (`logs`) or images (`image`). Each of these are + # represented by a different object type. + outputs: + ); end sig do override .returns( @@ -123,8 +136,12 @@ module OpenAI # Text output from the Code Interpreter tool call as part of a run step. sig { params(logs: String, type: Symbol).returns(T.attached_class) } - def self.new(logs:, type: :logs); end - + def self.new( + # The text output from the Code Interpreter tool call. + logs:, + # Always `logs`. + type: :logs + ); end sig { override.returns({logs: String, type: Symbol}) } def to_hash; end end @@ -162,8 +179,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(image:, type: :image); end - + def self.new( + image:, + # Always `image`. + type: :image + ); end sig do override .returns( @@ -182,8 +202,11 @@ module OpenAI attr_accessor :file_id sig { params(file_id: String).returns(T.attached_class) } - def self.new(file_id:); end - + def self.new( + # The [file](https://platform.openai.com/docs/api-reference/files) ID of the + # image. + file_id: + ); end sig { override.returns({file_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi index 06162584..b5314dd2 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi @@ -50,8 +50,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, id: nil, code_interpreter: nil, type: :code_interpreter); end - + def self.new( + # The index of the tool call in the tool calls array. + index:, + # The ID of the tool call. + id: nil, + # The Code Interpreter tool call definition. + code_interpreter: nil, + # The type of tool call. This is always going to be `code_interpreter` for this + # type of tool call. + type: :code_interpreter + ); end sig do override .returns( @@ -118,8 +127,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input: nil, outputs: nil); end - + def self.new( + # The input to the Code Interpreter tool call. + input: nil, + # The outputs from the Code Interpreter tool call. Code Interpreter can output one + # or more items, including text (`logs`) or images (`image`). Each of these are + # represented by a different object type. + outputs: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi index 77bfcf06..5fab3990 100644 --- a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi @@ -35,8 +35,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, file_search:, type: :file_search); end - + def self.new( + # The ID of the tool call object. + id:, + # For now, this is always going to be an empty object. + file_search:, + # The type of tool call. This is always going to be `file_search` for this type of + # tool call. + type: :file_search + ); end sig do override .returns( @@ -94,8 +101,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(ranking_options: nil, results: nil); end - + def self.new( + # The ranking options for the file search. + ranking_options: nil, + # The results of the file search. + results: nil + ); end sig do override .returns( @@ -130,8 +141,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(ranker:, score_threshold:); end - + def self.new( + # The ranker to use for the file search. If not specified will use the `auto` + # ranker. + ranker:, + # The score threshold for the file search. All values must be a floating point + # number between 0 and 1. + score_threshold: + ); end sig do override .returns( @@ -224,8 +241,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_id:, file_name:, score:, content: nil); end - + def self.new( + # The ID of the file that result was found in. + file_id:, + # The name of the file that result was found in. + file_name:, + # The score of the result. All values must be a floating point number between 0 + # and 1. + score:, + # The content of the result that was found. The content is only included if + # requested via the include query parameter. + content: nil + ); end sig do override .returns( @@ -272,8 +299,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(text: nil, type: nil); end - + def self.new( + # The text content of the file. + text: nil, + # The type of the content. + type: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi index 80a2db89..5d6789be 100644 --- a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi @@ -34,8 +34,17 @@ module OpenAI type: Symbol ).returns(T.attached_class) end - def self.new(file_search:, index:, id: nil, type: :file_search); end - + def self.new( + # For now, this is always going to be an empty object. + file_search:, + # The index of the tool call in the tool calls array. + index:, + # The ID of the tool call object. + id: nil, + # The type of tool call. This is always going to be `file_search` for this type of + # tool call. + type: :file_search + ); end sig { override.returns({file_search: T.anything, index: Integer, type: Symbol, id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi b/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi index 12d00e7e..b3e20062 100644 --- a/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi @@ -35,8 +35,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, function:, type: :function); end - + def self.new( + # The ID of the tool call object. + id:, + # The definition of the function that was called. + function:, + # The type of tool call. This is always going to be `function` for this type of + # tool call. + type: :function + ); end sig do override .returns( @@ -64,8 +71,16 @@ module OpenAI sig do params(arguments: String, name: String, output: T.nilable(String)).returns(T.attached_class) end - def self.new(arguments:, name:, output:); end - + def self.new( + # The arguments passed to the function. + arguments:, + # The name of the function. + name:, + # The output of the function. This will be `null` if the outputs have not been + # [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + # yet. + output: + ); end sig { override.returns({arguments: String, name: String, output: T.nilable(String)}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi index df5bcf34..3a495934 100644 --- a/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi @@ -43,8 +43,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, id: nil, function: nil, type: :function); end - + def self.new( + # The index of the tool call in the tool calls array. + index:, + # The ID of the tool call object. + id: nil, + # The definition of the function that was called. + function: nil, + # The type of tool call. This is always going to be `function` for this type of + # tool call. + type: :function + ); end sig do override .returns( @@ -83,8 +92,16 @@ module OpenAI sig do params(arguments: String, name: String, output: T.nilable(String)).returns(T.attached_class) end - def self.new(arguments: nil, name: nil, output: nil); end - + def self.new( + # The arguments passed to the function. + arguments: nil, + # The name of the function. + name: nil, + # The output of the function. This will be `null` if the outputs have not been + # [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + # yet. + output: nil + ); end sig { override.returns({arguments: String, name: String, output: T.nilable(String)}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi b/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi index 583a179d..d5358c72 100644 --- a/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi @@ -35,8 +35,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(message_creation:, type: :message_creation); end - + def self.new( + message_creation:, + # Always `message_creation`. + type: :message_creation + ); end sig do override .returns( @@ -54,8 +57,10 @@ module OpenAI attr_accessor :message_id sig { params(message_id: String).returns(T.attached_class) } - def self.new(message_id:); end - + def self.new( + # The ID of the message that was created by this run step. + message_id: + ); end sig { override.returns({message_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step.rbi index db09f851..0e70020b 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step.rbi @@ -133,21 +133,50 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The identifier of the run step, which can be referenced in API endpoints. id:, + # The ID of the + # [assistant](https://platform.openai.com/docs/api-reference/assistants) + # associated with the run step. assistant_id:, + # The Unix timestamp (in seconds) for when the run step was cancelled. cancelled_at:, + # The Unix timestamp (in seconds) for when the run step completed. completed_at:, + # The Unix timestamp (in seconds) for when the run step was created. created_at:, + # The Unix timestamp (in seconds) for when the run step expired. A step is + # considered expired if the parent run is expired. expired_at:, + # The Unix timestamp (in seconds) for when the run step failed. failed_at:, + # The last error associated with this run step. Will be `null` if there are no + # errors. last_error:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that + # this run step is a part of. run_id:, + # The status of the run step, which can be either `in_progress`, `cancelled`, + # `failed`, `completed`, or `expired`. status:, + # The details of the run step. step_details:, + # The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) + # that was run. thread_id:, + # The type of run step, which can be either `message_creation` or `tool_calls`. type:, + # Usage statistics related to the run step. This value will be `null` while the + # run step's status is `in_progress`. usage:, + # The object type, which is always `thread.run.step`. object: :"thread.run.step" ); end sig do @@ -193,8 +222,12 @@ module OpenAI params(code: OpenAI::Models::Beta::Threads::Runs::RunStep::LastError::Code::OrSymbol, message: String) .returns(T.attached_class) end - def self.new(code:, message:); end - + def self.new( + # One of `server_error` or `rate_limit_exceeded`. + code:, + # A human-readable description of the error. + message: + ); end sig do override .returns( @@ -289,8 +322,14 @@ module OpenAI total_tokens: Integer ).returns(T.attached_class) end - def self.new(completion_tokens:, prompt_tokens:, total_tokens:); end - + def self.new( + # Number of completion tokens used over the course of the run step. + completion_tokens:, + # Number of prompt tokens used over the course of the run step. + prompt_tokens:, + # Total number of tokens used (prompt + completion). + total_tokens: + ); end sig do override.returns({completion_tokens: Integer, prompt_tokens: Integer, total_tokens: Integer}) end diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi index 561b30d0..d151496b 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi @@ -42,8 +42,10 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(step_details: nil); end - + def self.new( + # The details of the run step. + step_details: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi index e1124389..a9a700a4 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi @@ -31,8 +31,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, delta:, object: :"thread.run.step.delta"); end - + def self.new( + # The identifier of the run step, which can be referenced in API endpoints. + id:, + # The delta containing the fields that have changed on the run step. + delta:, + # The object type, which is always `thread.run.step.delta`. + object: :"thread.run.step.delta" + ); end sig { override.returns({id: String, delta: OpenAI::Models::Beta::Threads::Runs::RunStepDelta, object: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi index 2b151753..efe29b30 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi @@ -35,8 +35,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(message_creation: nil, type: :message_creation); end - + def self.new( + message_creation: nil, + # Always `message_creation`. + type: :message_creation + ); end sig do override .returns( @@ -57,8 +60,10 @@ module OpenAI attr_writer :message_id sig { params(message_id: String).returns(T.attached_class) } - def self.new(message_id: nil); end - + def self.new( + # The ID of the message that was created by this run step. + message_id: nil + ); end sig { override.returns({message_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi b/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi index 9f8536b3..bda4f8f6 100644 --- a/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi @@ -75,15 +75,32 @@ module OpenAI end def self.new( thread_id:, + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. after: nil, + # A cursor for use in pagination. `before` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # starting with obj_foo, your subsequent call can include before=obj_foo in order + # to fetch the previous page of the list. before: nil, + # A list of additional fields to include in the response. Currently the only + # supported value is `step_details.tool_calls[*].file_search.results[*].content` + # to fetch the file search result content. + # + # See the + # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + # for more information. include: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. order: nil, request_options: {} - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi b/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi index c4b7c54d..a1c6e7c5 100644 --- a/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi @@ -37,8 +37,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(thread_id:, run_id:, include: nil, request_options: {}); end - + def self.new( + thread_id:, + run_id:, + # A list of additional fields to include in the response. Currently the only + # supported value is `step_details.tool_calls[*].file_search.results[*].content` + # to fetch the file search result content. + # + # See the + # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + # for more information. + include: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi b/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi index 796b549d..ea795b43 100644 --- a/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi @@ -58,8 +58,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(tool_calls: nil, type: :tool_calls); end - + def self.new( + # An array of tool calls the run step was involved in. These can be associated + # with one of three types of tools: `code_interpreter`, `file_search`, or + # `function`. + tool_calls: nil, + # Always `tool_calls`. + type: :tool_calls + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi b/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi index 34fdc65c..a5240f76 100644 --- a/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi @@ -41,8 +41,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(tool_calls:, type: :tool_calls); end - + def self.new( + # An array of tool calls the run step was involved in. These can be associated + # with one of three types of tools: `code_interpreter`, `file_search`, or + # `function`. + tool_calls:, + # Always `tool_calls`. + type: :tool_calls + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/text.rbi b/rbi/lib/openai/models/beta/threads/text.rbi index 0c5b65ab..64eb1b67 100644 --- a/rbi/lib/openai/models/beta/threads/text.rbi +++ b/rbi/lib/openai/models/beta/threads/text.rbi @@ -34,8 +34,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(annotations:, value:); end - + def self.new( + annotations:, + # The data that makes up the text. + value: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/text_content_block.rbi b/rbi/lib/openai/models/beta/threads/text_content_block.rbi index 60e48d2f..c1c5eb8c 100644 --- a/rbi/lib/openai/models/beta/threads/text_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/text_content_block.rbi @@ -20,8 +20,11 @@ module OpenAI params(text: T.any(OpenAI::Models::Beta::Threads::Text, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(text:, type: :text); end - + def self.new( + text:, + # Always `text`. + type: :text + ); end sig { override.returns({text: OpenAI::Models::Beta::Threads::Text, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi b/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi index ecf224cb..20626187 100644 --- a/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi +++ b/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi @@ -15,8 +15,12 @@ module OpenAI # The text content that is part of a message. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :text); end - + def self.new( + # Text content to be sent to the model + text:, + # Always `text`. + type: :text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/beta/threads/text_delta.rbi b/rbi/lib/openai/models/beta/threads/text_delta.rbi index 7776fa38..8d384acc 100644 --- a/rbi/lib/openai/models/beta/threads/text_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/text_delta.rbi @@ -53,8 +53,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(annotations: nil, value: nil); end - + def self.new( + annotations: nil, + # The data that makes up the text. + value: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/beta/threads/text_delta_block.rbi b/rbi/lib/openai/models/beta/threads/text_delta_block.rbi index d22fc8db..e054d1d2 100644 --- a/rbi/lib/openai/models/beta/threads/text_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/text_delta_block.rbi @@ -28,8 +28,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, text: nil, type: :text); end - + def self.new( + # The index of the content part in the message. + index:, + text: nil, + # Always `text`. + type: :text + ); end sig { override.returns({index: Integer, type: Symbol, text: OpenAI::Models::Beta::Threads::TextDelta}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion.rbi b/rbi/lib/openai/models/chat/chat_completion.rbi index 43d751bd..dbf3c910 100644 --- a/rbi/lib/openai/models/chat/chat_completion.rbi +++ b/rbi/lib/openai/models/chat/chat_completion.rbi @@ -78,13 +78,41 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A unique identifier for the chat completion. id:, + # A list of chat completion choices. Can be more than one if `n` is greater + # than 1. choices:, + # The Unix timestamp (in seconds) of when the chat completion was created. created:, + # The model used for the chat completion. model:, + # Specifies the latency tier to use for processing the request. This parameter is + # relevant for customers subscribed to the scale tier service: + # + # - If set to 'auto', and the Project is Scale tier enabled, the system will + # utilize scale tier credits until they are exhausted. + # - If set to 'auto', and the Project is not Scale tier enabled, the request will + # be processed using the default service tier with a lower uptime SLA and no + # latency guarentee. + # - If set to 'default', the request will be processed using the default service + # tier with a lower uptime SLA and no latency guarentee. + # - If set to 'flex', the request will be processed with the Flex Processing + # service tier. + # [Learn more](https://platform.openai.com/docs/guides/flex-processing). + # - When not set, the default behavior is 'auto'. + # + # When this parameter is set, the response body will include the `service_tier` + # utilized. service_tier: nil, + # This fingerprint represents the backend configuration that the model runs with. + # + # Can be used in conjunction with the `seed` request parameter to understand when + # backend changes have been made that might impact determinism. system_fingerprint: nil, + # Usage statistics for the completion request. usage: nil, + # The object type, which is always `chat.completion`. object: :"chat.completion" ); end sig do @@ -146,8 +174,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(finish_reason:, index:, logprobs:, message:); end - + def self.new( + # The reason the model stopped generating tokens. This will be `stop` if the model + # hit a natural stop point or a provided stop sequence, `length` if the maximum + # number of tokens specified in the request was reached, `content_filter` if + # content was omitted due to a flag from our content filters, `tool_calls` if the + # model called a tool, or `function_call` (deprecated) if the model called a + # function. + finish_reason:, + # The index of the choice in the list of choices. + index:, + # Log probability information for the choice. + logprobs:, + # A chat completion message generated by the model. + message: + ); end sig do override .returns( @@ -202,8 +243,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, refusal:); end - + def self.new( + # A list of message content tokens with log probability information. + content:, + # A list of message refusal tokens with log probability information. + refusal: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi index 436f9a60..a9321c4b 100644 --- a/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi @@ -110,16 +110,25 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Data about a previous audio response from the model. + # [Learn more](https://platform.openai.com/docs/guides/audio). audio: nil, + # The contents of the assistant message. Required unless `tool_calls` or + # `function_call` is specified. content: nil, + # Deprecated and replaced by `tool_calls`. The name and arguments of a function + # that should be called, as generated by the model. function_call: nil, + # An optional name for the participant. Provides the model information to + # differentiate between participants of the same role. name: nil, + # The refusal message by the assistant. refusal: nil, + # The tool calls generated by the model, such as function calls. tool_calls: nil, + # The role of the messages author, in this case `assistant`. role: :assistant - ) - end - + ); end sig do override .returns( @@ -154,8 +163,10 @@ module OpenAI # Data about a previous audio response from the model. # [Learn more](https://platform.openai.com/docs/guides/audio). sig { params(id: String).returns(T.attached_class) } - def self.new(id:); end - + def self.new( + # Unique identifier for a previous audio response from the model. + id: + ); end sig { override.returns({id: String}) } def to_hash; end end @@ -217,8 +228,15 @@ module OpenAI # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. sig { params(arguments: String, name: String).returns(T.attached_class) } - def self.new(arguments:, name:); end - + def self.new( + # The arguments to call the function with, as generated by the model in JSON + # format. Note that the model does not always generate valid JSON, and may + # hallucinate parameters not defined by your function schema. Validate the + # arguments in your code before calling your function. + arguments:, + # The name of the function to call. + name: + ); end sig { override.returns({arguments: String, name: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_audio.rbi b/rbi/lib/openai/models/chat/chat_completion_audio.rbi index 77f2a8a9..3a562bd2 100644 --- a/rbi/lib/openai/models/chat/chat_completion_audio.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_audio.rbi @@ -28,8 +28,18 @@ module OpenAI sig do params(id: String, data: String, expires_at: Integer, transcript: String).returns(T.attached_class) end - def self.new(id:, data:, expires_at:, transcript:); end - + def self.new( + # Unique identifier for this audio response. + id:, + # Base64 encoded audio bytes generated by the model, in the format specified in + # the request. + data:, + # The Unix timestamp (in seconds) for when this audio response will no longer be + # accessible on the server for use in multi-turn conversations. + expires_at:, + # Transcript of the audio generated by the model. + transcript: + ); end sig { override.returns({id: String, data: String, expires_at: Integer, transcript: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi b/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi index 231ca7da..f8798fa0 100644 --- a/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi @@ -24,8 +24,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(format_:, voice:); end - + def self.new( + # Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, + # or `pcm16`. + format_:, + # The voice the model uses to respond. Supported voices are `alloy`, `ash`, + # `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. + voice: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_chunk.rbi b/rbi/lib/openai/models/chat/chat_completion_chunk.rbi index 8c755f8f..c4d28509 100644 --- a/rbi/lib/openai/models/chat/chat_completion_chunk.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_chunk.rbi @@ -86,13 +86,48 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A unique identifier for the chat completion. Each chunk has the same ID. id:, + # A list of chat completion choices. Can contain more than one elements if `n` is + # greater than 1. Can also be empty for the last chunk if you set + # `stream_options: {"include_usage": true}`. choices:, + # The Unix timestamp (in seconds) of when the chat completion was created. Each + # chunk has the same timestamp. created:, + # The model to generate the completion. model:, + # Specifies the latency tier to use for processing the request. This parameter is + # relevant for customers subscribed to the scale tier service: + # + # - If set to 'auto', and the Project is Scale tier enabled, the system will + # utilize scale tier credits until they are exhausted. + # - If set to 'auto', and the Project is not Scale tier enabled, the request will + # be processed using the default service tier with a lower uptime SLA and no + # latency guarentee. + # - If set to 'default', the request will be processed using the default service + # tier with a lower uptime SLA and no latency guarentee. + # - If set to 'flex', the request will be processed with the Flex Processing + # service tier. + # [Learn more](https://platform.openai.com/docs/guides/flex-processing). + # - When not set, the default behavior is 'auto'. + # + # When this parameter is set, the response body will include the `service_tier` + # utilized. service_tier: nil, + # This fingerprint represents the backend configuration that the model runs with. + # Can be used in conjunction with the `seed` request parameter to understand when + # backend changes have been made that might impact determinism. system_fingerprint: nil, + # An optional field that will only be present when you set + # `stream_options: {"include_usage": true}` in your request. When present, it + # contains a null value **except for the last chunk** which contains the token + # usage statistics for the entire request. + # + # **NOTE:** If the stream is interrupted or cancelled, you may not receive the + # final usage chunk which contains the total token usage for the request. usage: nil, + # The object type, which is always `chat.completion.chunk`. object: :"chat.completion.chunk" ); end sig do @@ -157,8 +192,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(delta:, finish_reason:, index:, logprobs: nil); end - + def self.new( + # A chat completion delta generated by streamed model responses. + delta:, + # The reason the model stopped generating tokens. This will be `stop` if the model + # hit a natural stop point or a provided stop sequence, `length` if the maximum + # number of tokens specified in the request was reached, `content_filter` if + # content was omitted due to a flag from our content filters, `tool_calls` if the + # model called a tool, or `function_call` (deprecated) if the model called a + # function. + finish_reason:, + # The index of the choice in the list of choices. + index:, + # Log probability information for the choice. + logprobs: nil + ); end sig do override .returns( @@ -223,8 +271,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content: nil, function_call: nil, refusal: nil, role: nil, tool_calls: nil); end - + def self.new( + # The contents of the chunk message. + content: nil, + # Deprecated and replaced by `tool_calls`. The name and arguments of a function + # that should be called, as generated by the model. + function_call: nil, + # The refusal message generated by the model. + refusal: nil, + # The role of the author of this message. + role: nil, + tool_calls: nil + ); end sig do override .returns( @@ -260,8 +318,15 @@ module OpenAI # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. sig { params(arguments: String, name: String).returns(T.attached_class) } - def self.new(arguments: nil, name: nil); end - + def self.new( + # The arguments to call the function with, as generated by the model in JSON + # format. Note that the model does not always generate valid JSON, and may + # hallucinate parameters not defined by your function schema. Validate the + # arguments in your code before calling your function. + arguments: nil, + # The name of the function to call. + name: nil + ); end sig { override.returns({arguments: String, name: String}) } def to_hash; end end @@ -330,8 +395,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(index:, id: nil, function: nil, type: nil); end - + def self.new( + index:, + # The ID of the tool call. + id: nil, + function: nil, + # The type of the tool. Currently, only `function` is supported. + type: nil + ); end sig do override .returns( @@ -364,8 +435,15 @@ module OpenAI attr_writer :name sig { params(arguments: String, name: String).returns(T.attached_class) } - def self.new(arguments: nil, name: nil); end - + def self.new( + # The arguments to call the function with, as generated by the model in JSON + # format. Note that the model does not always generate valid JSON, and may + # hallucinate parameters not defined by your function schema. Validate the + # arguments in your code before calling your function. + arguments: nil, + # The name of the function to call. + name: nil + ); end sig { override.returns({arguments: String, name: String}) } def to_hash; end end @@ -433,8 +511,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, refusal:); end - + def self.new( + # A list of message content tokens with log probability information. + content:, + # A list of message refusal tokens with log probability information. + refusal: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part.rbi index ba9fd403..d380d60e 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part.rbi @@ -33,8 +33,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file:, type: :file); end - + def self.new( + file:, + # The type of the content part. Always `file`. + type: :file + ); end sig { override.returns({file: OpenAI::Models::Chat::ChatCompletionContentPart::File::File, type: Symbol}) } def to_hash; end @@ -62,8 +65,15 @@ module OpenAI attr_writer :filename sig { params(file_data: String, file_id: String, filename: String).returns(T.attached_class) } - def self.new(file_data: nil, file_id: nil, filename: nil); end - + def self.new( + # The base64 encoded file data, used when passing the file to the model as a + # string. + file_data: nil, + # The ID of an uploaded file to use as input. + file_id: nil, + # The name of the file, used when passing the file to the model as a string. + filename: nil + ); end sig { override.returns({file_data: String, file_id: String, filename: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi index e28956c2..8d2a8ddd 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi @@ -27,8 +27,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(image_url:, type: :image_url); end - + def self.new( + image_url:, + # The type of the content part. + type: :image_url + ); end sig do override.returns({image_url: OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL, type: Symbol}) end @@ -54,8 +57,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(url:, detail: nil); end - + def self.new( + # Either a URL of the image or the base64 encoded image data. + url:, + # Specifies the detail level of the image. Learn more in the + # [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). + detail: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi index 9e55ccdf..34e7e778 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi @@ -27,8 +27,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input_audio:, type: :input_audio); end - + def self.new( + input_audio:, + # The type of the content part. Always `input_audio`. + type: :input_audio + ); end sig do override .returns( @@ -53,8 +56,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, format_:); end - + def self.new( + # Base64 encoded audio data. + data:, + # The format of the encoded audio data. Currently supports "wav" and "mp3". + format_: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi index 6aedee59..8088fdc0 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi @@ -13,8 +13,12 @@ module OpenAI attr_accessor :type sig { params(refusal: String, type: Symbol).returns(T.attached_class) } - def self.new(refusal:, type: :refusal); end - + def self.new( + # The refusal message generated by the model. + refusal:, + # The type of the content part. + type: :refusal + ); end sig { override.returns({refusal: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi index ee4dcfaf..8fecc89b 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi @@ -15,8 +15,12 @@ module OpenAI # Learn about # [text inputs](https://platform.openai.com/docs/guides/text-generation). sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :text); end - + def self.new( + # The text content. + text:, + # The type of the content part. + type: :text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_deleted.rbi b/rbi/lib/openai/models/chat/chat_completion_deleted.rbi index 0c496584..e5083b94 100644 --- a/rbi/lib/openai/models/chat/chat_completion_deleted.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_deleted.rbi @@ -17,8 +17,14 @@ module OpenAI attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } - def self.new(id:, deleted:, object: :"chat.completion.deleted"); end - + def self.new( + # The ID of the chat completion that was deleted. + id:, + # Whether the chat completion was deleted. + deleted:, + # The type of object being deleted. + object: :"chat.completion.deleted" + ); end sig { override.returns({id: String, deleted: T::Boolean, object: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi index 6e56c125..ea4a6d05 100644 --- a/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi @@ -34,8 +34,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, name: nil, role: :developer); end - + def self.new( + # The contents of the developer message. + content:, + # An optional name for the participant. Provides the model information to + # differentiate between participants of the same role. + name: nil, + # The role of the messages author, in this case `developer`. + role: :developer + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi b/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi index 5dcea933..93220f0f 100644 --- a/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi @@ -11,8 +11,10 @@ module OpenAI # Specifying a particular function via `{"name": "my_function"}` forces the model # to call that function. sig { params(name: String).returns(T.attached_class) } - def self.new(name:); end - + def self.new( + # The name of the function to call. + name: + ); end sig { override.returns({name: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi index 0b1e82e1..dd32f6f7 100644 --- a/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi @@ -17,8 +17,14 @@ module OpenAI attr_accessor :role sig { params(content: T.nilable(String), name: String, role: Symbol).returns(T.attached_class) } - def self.new(content:, name:, role: :function); end - + def self.new( + # The contents of the function message. + content:, + # The name of the function to call. + name:, + # The role of the messages author, in this case `function`. + role: :function + ); end sig { override.returns({content: T.nilable(String), name: String, role: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_message.rbi b/rbi/lib/openai/models/chat/chat_completion_message.rbi index f70217f5..dcffce2a 100644 --- a/rbi/lib/openai/models/chat/chat_completion_message.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_message.rbi @@ -77,16 +77,25 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The contents of the message. content:, + # The refusal message generated by the model. refusal:, + # Annotations for the message, when applicable, as when using the + # [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). annotations: nil, + # If the audio output modality is requested, this object contains data about the + # audio response from the model. + # [Learn more](https://platform.openai.com/docs/guides/audio). audio: nil, + # Deprecated and replaced by `tool_calls`. The name and arguments of a function + # that should be called, as generated by the model. function_call: nil, + # The tool calls generated by the model, such as function calls. tool_calls: nil, + # The role of the author of this message. role: :assistant - ) - end - + ); end sig do override .returns( @@ -128,8 +137,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(url_citation:, type: :url_citation); end - + def self.new( + # A URL citation when using web search. + url_citation:, + # The type of the URL citation. Always `url_citation`. + type: :url_citation + ); end sig do override .returns( @@ -164,8 +177,16 @@ module OpenAI url: String ).returns(T.attached_class) end - def self.new(end_index:, start_index:, title:, url:); end - + def self.new( + # The index of the last character of the URL citation in the message. + end_index:, + # The index of the first character of the URL citation in the message. + start_index:, + # The title of the web resource. + title:, + # The URL of the web resource. + url: + ); end sig { override.returns({end_index: Integer, start_index: Integer, title: String, url: String}) } def to_hash; end end @@ -186,8 +207,15 @@ module OpenAI # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. sig { params(arguments: String, name: String).returns(T.attached_class) } - def self.new(arguments:, name:); end - + def self.new( + # The arguments to call the function with, as generated by the model in JSON + # format. Note that the model does not always generate valid JSON, and may + # hallucinate parameters not defined by your function schema. Validate the + # arguments in your code before calling your function. + arguments:, + # The name of the function to call. + name: + ); end sig { override.returns({arguments: String, name: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi b/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi index 85b1dc6e..77013f68 100644 --- a/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi @@ -32,8 +32,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, function:, type: :function); end - + def self.new( + # The ID of the tool call. + id:, + # The function that the model called. + function:, + # The type of the tool. Currently, only `function` is supported. + type: :function + ); end sig do override .returns( @@ -56,8 +62,15 @@ module OpenAI # The function that the model called. sig { params(arguments: String, name: String).returns(T.attached_class) } - def self.new(arguments:, name:); end - + def self.new( + # The arguments to call the function with, as generated by the model in JSON + # format. Note that the model does not always generate valid JSON, and may + # hallucinate parameters not defined by your function schema. Validate the + # arguments in your code before calling your function. + arguments:, + # The name of the function to call. + name: + ); end sig { override.returns({arguments: String, name: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi b/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi index 041eea0a..f7ef280e 100644 --- a/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi @@ -28,8 +28,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(function:, type: :function); end - + def self.new( + function:, + # The type of the tool. Currently, only `function` is supported. + type: :function + ); end sig { override.returns({function: OpenAI::Models::Chat::ChatCompletionNamedToolChoice::Function, type: Symbol}) } def to_hash; end @@ -39,8 +42,10 @@ module OpenAI attr_accessor :name sig { params(name: String).returns(T.attached_class) } - def self.new(name:); end - + def self.new( + # The name of the function to call. + name: + ); end sig { override.returns({name: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi b/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi index a993e33a..93fab93c 100644 --- a/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi @@ -27,8 +27,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :content); end - + def self.new( + # The content that should be matched when generating a model response. If + # generated tokens would match this content, the entire model response can be + # returned much more quickly. + content:, + # The type of the predicted content you want to provide. This type is currently + # always `content`. + type: :content + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_store_message.rbi b/rbi/lib/openai/models/chat/chat_completion_store_message.rbi index 67a32515..5af6dfc9 100644 --- a/rbi/lib/openai/models/chat/chat_completion_store_message.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_store_message.rbi @@ -10,8 +10,10 @@ module OpenAI # A chat completion message generated by the model. sig { params(id: String).returns(T.attached_class) } - def self.new(id:); end - + def self.new( + # The identifier of the chat message. + id: + ); end sig { override.returns({id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi b/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi index 771ab84e..08fdb738 100644 --- a/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi @@ -19,8 +19,16 @@ module OpenAI # Options for streaming response. Only set this when you set `stream: true`. sig { params(include_usage: T::Boolean).returns(T.attached_class) } - def self.new(include_usage: nil); end - + def self.new( + # If set, an additional chunk will be streamed before the `data: [DONE]` message. + # The `usage` field on this chunk shows the token usage statistics for the entire + # request, and the `choices` field will always be an empty array. + # + # All other chunks will also include a `usage` field, but with a null value. + # **NOTE:** If the stream is interrupted, you may not receive the final usage + # chunk which contains the total token usage for the request. + include_usage: nil + ); end sig { override.returns({include_usage: T::Boolean}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi index b21a46af..aeac775d 100644 --- a/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi @@ -34,8 +34,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, name: nil, role: :system); end - + def self.new( + # The contents of the system message. + content:, + # An optional name for the participant. Provides the model information to + # differentiate between participants of the same role. + name: nil, + # The role of the messages author, in this case `system`. + role: :system + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi b/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi index 0f4594a5..00a79a48 100644 --- a/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi @@ -36,8 +36,23 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(token:, bytes:, logprob:, top_logprobs:); end - + def self.new( + # The token. + token:, + # A list of integers representing the UTF-8 bytes representation of the token. + # Useful in instances where characters are represented by multiple tokens and + # their byte representations must be combined to generate the correct text + # representation. Can be `null` if there is no bytes representation for the token. + bytes:, + # The log probability of this token, if it is within the top 20 most likely + # tokens. Otherwise, the value `-9999.0` is used to signify that the token is very + # unlikely. + logprob:, + # List of the most likely tokens and their log probability, at this token + # position. In rare cases, there may be fewer than the number of requested + # `top_logprobs` returned. + top_logprobs: + ); end sig do override .returns( @@ -76,8 +91,19 @@ module OpenAI logprob: Float ).returns(T.attached_class) end - def self.new(token:, bytes:, logprob:); end - + def self.new( + # The token. + token:, + # A list of integers representing the UTF-8 bytes representation of the token. + # Useful in instances where characters are represented by multiple tokens and + # their byte representations must be combined to generate the correct text + # representation. Can be `null` if there is no bytes representation for the token. + bytes:, + # The log probability of this token, if it is within the top 20 most likely + # tokens. Otherwise, the value `-9999.0` is used to signify that the token is very + # unlikely. + logprob: + ); end sig { override.returns({token: String, bytes: T.nilable(T::Array[Integer]), logprob: Float}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_tool.rbi b/rbi/lib/openai/models/chat/chat_completion_tool.rbi index e6559aed..0b898367 100644 --- a/rbi/lib/openai/models/chat/chat_completion_tool.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_tool.rbi @@ -18,8 +18,11 @@ module OpenAI params(function: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(function:, type: :function); end - + def self.new( + function:, + # The type of the tool. Currently, only `function` is supported. + type: :function + ); end sig { override.returns({function: OpenAI::Models::FunctionDefinition, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi index 3e792e43..b0ed167b 100644 --- a/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi @@ -27,8 +27,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, tool_call_id:, role: :tool); end - + def self.new( + # The contents of the tool message. + content:, + # Tool call that this message is responding to. + tool_call_id:, + # The role of the messages author, in this case `tool`. + role: :tool + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi index 24c806a5..197c73d0 100644 --- a/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi @@ -55,8 +55,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, name: nil, role: :user); end - + def self.new( + # The contents of the user message. + content:, + # An optional name for the participant. Provides the model information to + # differentiate between participants of the same role. + name: nil, + # The role of the messages author, in this case `user`. + role: :user + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/completion_create_params.rbi b/rbi/lib/openai/models/chat/completion_create_params.rbi index 6e3970fc..2f954588 100644 --- a/rbi/lib/openai/models/chat/completion_create_params.rbi +++ b/rbi/lib/openai/models/chat/completion_create_params.rbi @@ -440,35 +440,193 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A list of messages comprising the conversation so far. Depending on the + # [model](https://platform.openai.com/docs/models) you use, different message + # types (modalities) are supported, like + # [text](https://platform.openai.com/docs/guides/text-generation), + # [images](https://platform.openai.com/docs/guides/vision), and + # [audio](https://platform.openai.com/docs/guides/audio). messages:, + # Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a + # wide range of models with different capabilities, performance characteristics, + # and price points. Refer to the + # [model guide](https://platform.openai.com/docs/models) to browse and compare + # available models. model:, + # Parameters for audio output. Required when audio output is requested with + # `modalities: ["audio"]`. + # [Learn more](https://platform.openai.com/docs/guides/audio). audio: nil, + # Number between -2.0 and 2.0. Positive values penalize new tokens based on their + # existing frequency in the text so far, decreasing the model's likelihood to + # repeat the same line verbatim. frequency_penalty: nil, + # Deprecated in favor of `tool_choice`. + # + # Controls which (if any) function is called by the model. + # + # `none` means the model will not call a function and instead generates a message. + # + # `auto` means the model can pick between generating a message or calling a + # function. + # + # Specifying a particular function via `{"name": "my_function"}` forces the model + # to call that function. + # + # `none` is the default when no functions are present. `auto` is the default if + # functions are present. function_call: nil, + # Deprecated in favor of `tools`. + # + # A list of functions the model may generate JSON inputs for. functions: nil, + # Modify the likelihood of specified tokens appearing in the completion. + # + # Accepts a JSON object that maps tokens (specified by their token ID in the + # tokenizer) to an associated bias value from -100 to 100. Mathematically, the + # bias is added to the logits generated by the model prior to sampling. The exact + # effect will vary per model, but values between -1 and 1 should decrease or + # increase likelihood of selection; values like -100 or 100 should result in a ban + # or exclusive selection of the relevant token. logit_bias: nil, + # Whether to return log probabilities of the output tokens or not. If true, + # returns the log probabilities of each output token returned in the `content` of + # `message`. logprobs: nil, + # An upper bound for the number of tokens that can be generated for a completion, + # including visible output tokens and + # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). max_completion_tokens: nil, + # The maximum number of [tokens](/tokenizer) that can be generated in the chat + # completion. This value can be used to control + # [costs](https://openai.com/api/pricing/) for text generated via API. + # + # This value is now deprecated in favor of `max_completion_tokens`, and is not + # compatible with + # [o-series models](https://platform.openai.com/docs/guides/reasoning). max_tokens: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # Output types that you would like the model to generate. Most models are capable + # of generating text, which is the default: + # + # `["text"]` + # + # The `gpt-4o-audio-preview` model can also be used to + # [generate audio](https://platform.openai.com/docs/guides/audio). To request that + # this model generate both text and audio responses, you can use: + # + # `["text", "audio"]` modalities: nil, + # How many chat completion choices to generate for each input message. Note that + # you will be charged based on the number of generated tokens across all of the + # choices. Keep `n` as `1` to minimize costs. n: nil, + # Whether to enable + # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + # during tool use. parallel_tool_calls: nil, + # Static predicted output content, such as the content of a text file that is + # being regenerated. prediction: nil, + # Number between -2.0 and 2.0. Positive values penalize new tokens based on + # whether they appear in the text so far, increasing the model's likelihood to + # talk about new topics. presence_penalty: nil, + # **o-series models only** + # + # Constrains effort on reasoning for + # [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can + # result in faster responses and fewer tokens used on reasoning in a response. reasoning_effort: nil, + # An object specifying the format that the model must output. + # + # Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + # Outputs which ensures the model will match your supplied JSON schema. Learn more + # in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # Setting to `{ "type": "json_object" }` enables the older JSON mode, which + # ensures the message the model generates is valid JSON. Using `json_schema` is + # preferred for models that support it. response_format: nil, + # This feature is in Beta. If specified, our system will make a best effort to + # sample deterministically, such that repeated requests with the same `seed` and + # parameters should return the same result. Determinism is not guaranteed, and you + # should refer to the `system_fingerprint` response parameter to monitor changes + # in the backend. seed: nil, + # Specifies the latency tier to use for processing the request. This parameter is + # relevant for customers subscribed to the scale tier service: + # + # - If set to 'auto', and the Project is Scale tier enabled, the system will + # utilize scale tier credits until they are exhausted. + # - If set to 'auto', and the Project is not Scale tier enabled, the request will + # be processed using the default service tier with a lower uptime SLA and no + # latency guarentee. + # - If set to 'default', the request will be processed using the default service + # tier with a lower uptime SLA and no latency guarentee. + # - If set to 'flex', the request will be processed with the Flex Processing + # service tier. + # [Learn more](https://platform.openai.com/docs/guides/flex-processing). + # - When not set, the default behavior is 'auto'. + # + # When this parameter is set, the response body will include the `service_tier` + # utilized. service_tier: nil, + # Not supported with latest reasoning models `o3` and `o4-mini`. + # + # Up to 4 sequences where the API will stop generating further tokens. The + # returned text will not contain the stop sequence. stop: nil, + # Whether or not to store the output of this chat completion request for use in + # our [model distillation](https://platform.openai.com/docs/guides/distillation) + # or [evals](https://platform.openai.com/docs/guides/evals) products. store: nil, + # Options for streaming response. Only set this when you set `stream: true`. stream_options: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. We generally recommend altering this or `top_p` but + # not both. temperature: nil, + # Controls which (if any) tool is called by the model. `none` means the model will + # not call any tool and instead generates a message. `auto` means the model can + # pick between generating a message or calling one or more tools. `required` means + # the model must call one or more tools. Specifying a particular tool via + # `{"type": "function", "function": {"name": "my_function"}}` forces the model to + # call that tool. + # + # `none` is the default when no tools are present. `auto` is the default if tools + # are present. tool_choice: nil, + # A list of tools the model may call. Currently, only functions are supported as a + # tool. Use this to provide a list of functions the model may generate JSON inputs + # for. A max of 128 functions are supported. tools: nil, + # An integer between 0 and 20 specifying the number of most likely tokens to + # return at each token position, each with an associated log probability. + # `logprobs` must be set to `true` if this parameter is used. top_logprobs: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or `temperature` but not both. top_p: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). user: nil, + # This tool searches the web for relevant results to use in a response. Learn more + # about the + # [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). web_search_options: nil, request_options: {} ); end @@ -624,8 +782,22 @@ module OpenAI params(name: String, description: String, parameters: T::Hash[Symbol, T.anything]) .returns(T.attached_class) end - def self.new(name:, description: nil, parameters: nil); end - + def self.new( + # The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + # underscores and dashes, with a maximum length of 64. + name:, + # A description of what the function does, used by the model to choose when and + # how to call the function. + description: nil, + # The parameters the functions accepts, described as a JSON Schema object. See the + # [guide](https://platform.openai.com/docs/guides/function-calling) for examples, + # and the + # [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + # documentation about the format. + # + # Omitting `parameters` defines a function with an empty parameter list. + parameters: nil + ); end sig do override.returns({name: String, description: String, parameters: T::Hash[Symbol, T.anything]}) end @@ -761,8 +933,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(search_context_size: nil, user_location: nil); end - + def self.new( + # High level guidance for the amount of context window space to use for the + # search. One of `low`, `medium`, or `high`. `medium` is the default. + search_context_size: nil, + # Approximate location parameters for the search. + user_location: nil + ); end sig do override .returns( @@ -839,8 +1016,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(approximate:, type: :approximate); end - + def self.new( + # Approximate location parameters for the search. + approximate:, + # The type of location approximation. Always `approximate`. + type: :approximate + ); end sig do override .returns( @@ -892,8 +1073,18 @@ module OpenAI timezone: String ).returns(T.attached_class) end - def self.new(city: nil, country: nil, region: nil, timezone: nil); end - + def self.new( + # Free text input for the city of the user, e.g. `San Francisco`. + city: nil, + # The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + # the user, e.g. `US`. + country: nil, + # Free text input for the region of the user, e.g. `California`. + region: nil, + # The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + # user, e.g. `America/Los_Angeles`. + timezone: nil + ); end sig { override.returns({city: String, country: String, region: String, timezone: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/chat/completion_list_params.rbi b/rbi/lib/openai/models/chat/completion_list_params.rbi index f83e4b89..2574d2d6 100644 --- a/rbi/lib/openai/models/chat/completion_list_params.rbi +++ b/rbi/lib/openai/models/chat/completion_list_params.rbi @@ -53,8 +53,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, metadata: nil, model: nil, order: nil, request_options: {}); end - + def self.new( + # Identifier for the last chat completion from the previous pagination request. + after: nil, + # Number of Chat Completions to retrieve. + limit: nil, + # A list of metadata keys to filter the Chat Completions by. Example: + # + # `metadata[key1]=value1&metadata[key2]=value2` + metadata: nil, + # The model used to generate the Chat Completions. + model: nil, + # Sort order for Chat Completions by timestamp. Use `asc` for ascending order or + # `desc` for descending order. Defaults to `asc`. + order: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/chat/completion_update_params.rbi b/rbi/lib/openai/models/chat/completion_update_params.rbi index b85b54da..48669c83 100644 --- a/rbi/lib/openai/models/chat/completion_update_params.rbi +++ b/rbi/lib/openai/models/chat/completion_update_params.rbi @@ -23,8 +23,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(metadata:, request_options: {}); end - + def self.new( + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata:, + request_options: {} + ); end sig do override.returns( { diff --git a/rbi/lib/openai/models/chat/completions/message_list_params.rbi b/rbi/lib/openai/models/chat/completions/message_list_params.rbi index a661288c..aa957ac1 100644 --- a/rbi/lib/openai/models/chat/completions/message_list_params.rbi +++ b/rbi/lib/openai/models/chat/completions/message_list_params.rbi @@ -39,8 +39,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, order: nil, request_options: {}); end - + def self.new( + # Identifier for the last message from the previous pagination request. + after: nil, + # Number of messages to retrieve. + limit: nil, + # Sort order for messages by timestamp. Use `asc` for ascending order or `desc` + # for descending order. Defaults to `asc`. + order: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/comparison_filter.rbi b/rbi/lib/openai/models/comparison_filter.rbi index 19f90169..43b5c434 100644 --- a/rbi/lib/openai/models/comparison_filter.rbi +++ b/rbi/lib/openai/models/comparison_filter.rbi @@ -33,8 +33,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(key:, type:, value:); end - + def self.new( + # The key to compare against the value. + key:, + # Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. + # + # - `eq`: equals + # - `ne`: not equal + # - `gt`: greater than + # - `gte`: greater than or equal + # - `lt`: less than + # - `lte`: less than or equal + type:, + # The value to compare against the attribute key; supports string, number, or + # boolean types. + value: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/completion.rbi b/rbi/lib/openai/models/completion.rbi index aa47ab99..4cc82449 100644 --- a/rbi/lib/openai/models/completion.rbi +++ b/rbi/lib/openai/models/completion.rbi @@ -55,16 +55,24 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A unique identifier for the completion. id:, + # The list of completion choices the model generated for the input prompt. choices:, + # The Unix timestamp (in seconds) of when the completion was created. created:, + # The model used for completion. model:, + # This fingerprint represents the backend configuration that the model runs with. + # + # Can be used in conjunction with the `seed` request parameter to understand when + # backend changes have been made that might impact determinism. system_fingerprint: nil, + # Usage statistics for the completion request. usage: nil, + # The object type, which is always "text_completion" object: :text_completion - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/completion_choice.rbi b/rbi/lib/openai/models/completion_choice.rbi index 4731b8da..5eaba069 100644 --- a/rbi/lib/openai/models/completion_choice.rbi +++ b/rbi/lib/openai/models/completion_choice.rbi @@ -34,8 +34,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(finish_reason:, index:, logprobs:, text:); end - + def self.new( + # The reason the model stopped generating tokens. This will be `stop` if the model + # hit a natural stop point or a provided stop sequence, `length` if the maximum + # number of tokens specified in the request was reached, or `content_filter` if + # content was omitted due to a flag from our content filters. + finish_reason:, + index:, + logprobs:, + text: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/completion_create_params.rbi b/rbi/lib/openai/models/completion_create_params.rbi index a0956081..058662fd 100644 --- a/rbi/lib/openai/models/completion_create_params.rbi +++ b/rbi/lib/openai/models/completion_create_params.rbi @@ -182,22 +182,110 @@ module OpenAI .returns(T.attached_class) end def self.new( + # ID of the model to use. You can use the + # [List models](https://platform.openai.com/docs/api-reference/models/list) API to + # see all of your available models, or see our + # [Model overview](https://platform.openai.com/docs/models) for descriptions of + # them. model:, + # The prompt(s) to generate completions for, encoded as a string, array of + # strings, array of tokens, or array of token arrays. + # + # Note that <|endoftext|> is the document separator that the model sees during + # training, so if a prompt is not specified the model will generate as if from the + # beginning of a new document. prompt:, + # Generates `best_of` completions server-side and returns the "best" (the one with + # the highest log probability per token). Results cannot be streamed. + # + # When used with `n`, `best_of` controls the number of candidate completions and + # `n` specifies how many to return – `best_of` must be greater than `n`. + # + # **Note:** Because this parameter generates many completions, it can quickly + # consume your token quota. Use carefully and ensure that you have reasonable + # settings for `max_tokens` and `stop`. best_of: nil, + # Echo back the prompt in addition to the completion echo: nil, + # Number between -2.0 and 2.0. Positive values penalize new tokens based on their + # existing frequency in the text so far, decreasing the model's likelihood to + # repeat the same line verbatim. + # + # [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) frequency_penalty: nil, + # Modify the likelihood of specified tokens appearing in the completion. + # + # Accepts a JSON object that maps tokens (specified by their token ID in the GPT + # tokenizer) to an associated bias value from -100 to 100. You can use this + # [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. + # Mathematically, the bias is added to the logits generated by the model prior to + # sampling. The exact effect will vary per model, but values between -1 and 1 + # should decrease or increase likelihood of selection; values like -100 or 100 + # should result in a ban or exclusive selection of the relevant token. + # + # As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token + # from being generated. logit_bias: nil, + # Include the log probabilities on the `logprobs` most likely output tokens, as + # well the chosen tokens. For example, if `logprobs` is 5, the API will return a + # list of the 5 most likely tokens. The API will always return the `logprob` of + # the sampled token, so there may be up to `logprobs+1` elements in the response. + # + # The maximum value for `logprobs` is 5. logprobs: nil, + # The maximum number of [tokens](/tokenizer) that can be generated in the + # completion. + # + # The token count of your prompt plus `max_tokens` cannot exceed the model's + # context length. + # [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) + # for counting tokens. max_tokens: nil, + # How many completions to generate for each prompt. + # + # **Note:** Because this parameter generates many completions, it can quickly + # consume your token quota. Use carefully and ensure that you have reasonable + # settings for `max_tokens` and `stop`. n: nil, + # Number between -2.0 and 2.0. Positive values penalize new tokens based on + # whether they appear in the text so far, increasing the model's likelihood to + # talk about new topics. + # + # [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) presence_penalty: nil, + # If specified, our system will make a best effort to sample deterministically, + # such that repeated requests with the same `seed` and parameters should return + # the same result. + # + # Determinism is not guaranteed, and you should refer to the `system_fingerprint` + # response parameter to monitor changes in the backend. seed: nil, + # Not supported with latest reasoning models `o3` and `o4-mini`. + # + # Up to 4 sequences where the API will stop generating further tokens. The + # returned text will not contain the stop sequence. stop: nil, + # Options for streaming response. Only set this when you set `stream: true`. stream_options: nil, + # The suffix that comes after a completion of inserted text. + # + # This parameter is only supported for `gpt-3.5-turbo-instruct`. suffix: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. + # + # We generally recommend altering this or `top_p` but not both. temperature: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or `temperature` but not both. top_p: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). user: nil, request_options: {} ); end diff --git a/rbi/lib/openai/models/completion_usage.rbi b/rbi/lib/openai/models/completion_usage.rbi index 2872756d..48f31d88 100644 --- a/rbi/lib/openai/models/completion_usage.rbi +++ b/rbi/lib/openai/models/completion_usage.rbi @@ -51,10 +51,15 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Number of tokens in the generated completion. completion_tokens:, + # Number of tokens in the prompt. prompt_tokens:, + # Total number of tokens used in the request (prompt + completion). total_tokens:, + # Breakdown of tokens used in a completion. completion_tokens_details: nil, + # Breakdown of tokens used in the prompt. prompt_tokens_details: nil ); end sig do @@ -115,13 +120,19 @@ module OpenAI .returns(T.attached_class) end def self.new( + # When using Predicted Outputs, the number of tokens in the prediction that + # appeared in the completion. accepted_prediction_tokens: nil, + # Audio input tokens generated by the model. audio_tokens: nil, + # Tokens generated by the model for reasoning. reasoning_tokens: nil, + # When using Predicted Outputs, the number of tokens in the prediction that did + # not appear in the completion. However, like reasoning tokens, these tokens are + # still counted in the total completion tokens for purposes of billing, output, + # and context window limits. rejected_prediction_tokens: nil - ) - end - + ); end sig do override .returns( @@ -153,8 +164,12 @@ module OpenAI # Breakdown of tokens used in the prompt. sig { params(audio_tokens: Integer, cached_tokens: Integer).returns(T.attached_class) } - def self.new(audio_tokens: nil, cached_tokens: nil); end - + def self.new( + # Audio input tokens present in the prompt. + audio_tokens: nil, + # Cached tokens present in the prompt. + cached_tokens: nil + ); end sig { override.returns({audio_tokens: Integer, cached_tokens: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/compound_filter.rbi b/rbi/lib/openai/models/compound_filter.rbi index 4bb4c09c..19966d7a 100644 --- a/rbi/lib/openai/models/compound_filter.rbi +++ b/rbi/lib/openai/models/compound_filter.rbi @@ -20,8 +20,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(filters:, type:); end - + def self.new( + # Array of filters to combine. Items can be `ComparisonFilter` or + # `CompoundFilter`. + filters:, + # Type of operation: `and` or `or`. + type: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/create_embedding_response.rbi b/rbi/lib/openai/models/create_embedding_response.rbi index 878d96ba..4ebe2aee 100644 --- a/rbi/lib/openai/models/create_embedding_response.rbi +++ b/rbi/lib/openai/models/create_embedding_response.rbi @@ -31,8 +31,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, model:, usage:, object: :list); end - + def self.new( + # The list of embeddings generated by the model. + data:, + # The name of the model used to generate the embedding. + model:, + # The usage information for the request. + usage:, + # The object type, which is always "list". + object: :list + ); end sig do override .returns( @@ -57,8 +65,12 @@ module OpenAI # The usage information for the request. sig { params(prompt_tokens: Integer, total_tokens: Integer).returns(T.attached_class) } - def self.new(prompt_tokens:, total_tokens:); end - + def self.new( + # The number of tokens used by the prompt. + prompt_tokens:, + # The total number of tokens used by the request. + total_tokens: + ); end sig { override.returns({prompt_tokens: Integer, total_tokens: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/embedding.rbi b/rbi/lib/openai/models/embedding.rbi index ac1fc9ab..9c78d508 100644 --- a/rbi/lib/openai/models/embedding.rbi +++ b/rbi/lib/openai/models/embedding.rbi @@ -19,8 +19,16 @@ module OpenAI # Represents an embedding vector returned by embedding endpoint. sig { params(embedding: T::Array[Float], index: Integer, object: Symbol).returns(T.attached_class) } - def self.new(embedding:, index:, object: :embedding); end - + def self.new( + # The embedding vector, which is a list of floats. The length of vector depends on + # the model as listed in the + # [embedding guide](https://platform.openai.com/docs/guides/embeddings). + embedding:, + # The index of the embedding in the list of embeddings. + index:, + # The object type, which is always "embedding". + object: :embedding + ); end sig { override.returns({embedding: T::Array[Float], index: Integer, object: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/embedding_create_params.rbi b/rbi/lib/openai/models/embedding_create_params.rbi index b19f81a0..22c4e6b8 100644 --- a/rbi/lib/openai/models/embedding_create_params.rbi +++ b/rbi/lib/openai/models/embedding_create_params.rbi @@ -61,8 +61,34 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input:, model:, dimensions: nil, encoding_format: nil, user: nil, request_options: {}); end - + def self.new( + # Input text to embed, encoded as a string or array of tokens. To embed multiple + # inputs in a single request, pass an array of strings or array of token arrays. + # The input must not exceed the max input tokens for the model (8192 tokens for + # `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 + # dimensions or less. + # [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) + # for counting tokens. Some models may also impose a limit on total number of + # tokens summed across inputs. + input:, + # ID of the model to use. You can use the + # [List models](https://platform.openai.com/docs/api-reference/models/list) API to + # see all of your available models, or see our + # [Model overview](https://platform.openai.com/docs/models) for descriptions of + # them. + model:, + # The number of dimensions the resulting output embeddings should have. Only + # supported in `text-embedding-3` and later models. + dimensions: nil, + # The format to return the embeddings in. Can be either `float` or + # [`base64`](https://pypi.org/project/pybase64/). + encoding_format: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + user: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/eval_create_params.rbi b/rbi/lib/openai/models/eval_create_params.rbi index 32befe9a..af1d1784 100644 --- a/rbi/lib/openai/models/eval_create_params.rbi +++ b/rbi/lib/openai/models/eval_create_params.rbi @@ -72,8 +72,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data_source_config:, testing_criteria:, metadata: nil, name: nil, request_options: {}); end - + def self.new( + # The configuration for the data source used for the evaluation runs. + data_source_config:, + # A list of graders for all eval runs in this group. + testing_criteria:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # The name of the evaluation. + name: nil, + request_options: {} + ); end sig do override .returns( @@ -130,8 +144,15 @@ module OpenAI params(item_schema: T::Hash[Symbol, T.anything], include_sample_schema: T::Boolean, type: Symbol) .returns(T.attached_class) end - def self.new(item_schema:, include_sample_schema: nil, type: :custom); end - + def self.new( + # The json schema for each row in the data source. + item_schema:, + # Whether the eval should expect you to populate the sample namespace (ie, by + # generating responses off of your data source) + include_sample_schema: nil, + # The type of data source. Always `custom`. + type: :custom + ); end sig do override .returns({ @@ -159,8 +180,12 @@ module OpenAI # completions query. This is usually metadata like `usecase=chatbot` or # `prompt-version=v2`, etc. sig { params(metadata: T::Hash[Symbol, T.anything], type: Symbol).returns(T.attached_class) } - def self.new(metadata: nil, type: :logs); end - + def self.new( + # Metadata filters for the logs data source. + metadata: nil, + # The type of data source. Always `logs`. + type: :logs + ); end sig { override.returns({type: Symbol, metadata: T::Hash[Symbol, T.anything]}) } def to_hash; end end @@ -233,8 +258,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input:, labels:, model:, name:, passing_labels:, type: :label_model); end - + def self.new( + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + input:, + # The labels to classify to each item in the evaluation. + labels:, + # The model to use for the evaluation. Must support structured outputs. + model:, + # The name of the grader. + name:, + # The labels that indicate a passing result. Must be a subset of labels. + passing_labels:, + # The object type, which is always `label_model`. + type: :label_model + ); end sig do override .returns( @@ -270,8 +308,12 @@ module OpenAI attr_accessor :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message (e.g. "system", "assistant", "user"). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -328,8 +370,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -361,8 +410,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -481,8 +534,18 @@ module OpenAI params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) .returns(T.attached_class) end - def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end - + def self.new( + # The name of the grader. + name:, + # The source code of the python script. + source:, + # The image tag to use for the python script. + image_tag: nil, + # The threshold for the score. + pass_threshold: nil, + # The object type, which is always `python`. + type: :python + ); end sig do override.returns( { @@ -549,16 +612,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The input text. This may include template strings. input:, + # The model to use for the evaluation. model:, + # The name of the grader. name:, + # The threshold for the score. pass_threshold: nil, + # The range of the score. Defaults to `[0, 1]`. range: nil, + # The sampling parameters for the model. sampling_params: nil, + # The object type, which is always `score_model`. type: :score_model - ) - end - + ); end sig do override .returns( @@ -618,8 +686,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -651,8 +726,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/eval_create_response.rbi b/rbi/lib/openai/models/eval_create_response.rbi index c812a4d5..d0304e79 100644 --- a/rbi/lib/openai/models/eval_create_response.rbi +++ b/rbi/lib/openai/models/eval_create_response.rbi @@ -83,9 +83,27 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) - end - + def self.new( + # Unique identifier for the evaluation. + id:, + # The Unix timestamp (in seconds) for when the eval was created. + created_at:, + # Configuration of data sources used in runs of the evaluation. + data_source_config:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata:, + # The name of the evaluation. + name:, + # A list of testing criteria. + testing_criteria:, + # The object type. + object: :eval + ); end sig do override .returns( @@ -160,8 +178,18 @@ module OpenAI params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) .returns(T.attached_class) end - def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end - + def self.new( + # The name of the grader. + name:, + # The source code of the python script. + source:, + # The image tag to use for the python script. + image_tag: nil, + # The threshold for the score. + pass_threshold: nil, + # The object type, which is always `python`. + type: :python + ); end sig do override.returns( { @@ -228,16 +256,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The input text. This may include template strings. input:, + # The model to use for the evaluation. model:, + # The name of the grader. name:, + # The threshold for the score. pass_threshold: nil, + # The range of the score. Defaults to `[0, 1]`. range: nil, + # The sampling parameters for the model. sampling_params: nil, + # The object type, which is always `score_model`. type: :score_model - ) - end - + ); end sig do override .returns( @@ -301,8 +334,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -334,8 +374,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/eval_custom_data_source_config.rbi b/rbi/lib/openai/models/eval_custom_data_source_config.rbi index c8d1dcea..2c76acf3 100644 --- a/rbi/lib/openai/models/eval_custom_data_source_config.rbi +++ b/rbi/lib/openai/models/eval_custom_data_source_config.rbi @@ -19,8 +19,13 @@ module OpenAI # - Used to define your testing criteria and # - What data is required when creating a run sig { params(schema: T::Hash[Symbol, T.anything], type: Symbol).returns(T.attached_class) } - def self.new(schema:, type: :custom); end - + def self.new( + # The json schema for the run data source items. Learn how to build JSON schemas + # [here](https://json-schema.org/). + schema:, + # The type of data source. Always `custom`. + type: :custom + ); end sig { override.returns({schema: T::Hash[Symbol, T.anything], type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/eval_label_model_grader.rbi b/rbi/lib/openai/models/eval_label_model_grader.rbi index 8e02688e..1a12db15 100644 --- a/rbi/lib/openai/models/eval_label_model_grader.rbi +++ b/rbi/lib/openai/models/eval_label_model_grader.rbi @@ -39,8 +39,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input:, labels:, model:, name:, passing_labels:, type: :label_model); end - + def self.new( + input:, + # The labels to assign to each item in the evaluation. + labels:, + # The model to use for the evaluation. Must support structured outputs. + model:, + # The name of the grader. + name:, + # The labels that indicate a passing result. Must be a subset of labels. + passing_labels:, + # The object type, which is always `label_model`. + type: :label_model + ); end sig do override .returns( @@ -99,8 +110,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -132,8 +150,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/eval_list_params.rbi b/rbi/lib/openai/models/eval_list_params.rbi index e0e69e2a..0ef48b7c 100644 --- a/rbi/lib/openai/models/eval_list_params.rbi +++ b/rbi/lib/openai/models/eval_list_params.rbi @@ -46,8 +46,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, order: nil, order_by: nil, request_options: {}); end - + def self.new( + # Identifier for the last eval from the previous pagination request. + after: nil, + # Number of evals to retrieve. + limit: nil, + # Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for + # descending order. + order: nil, + # Evals can be ordered by creation time or last updated time. Use `created_at` for + # creation time or `updated_at` for last updated time. + order_by: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/eval_list_response.rbi b/rbi/lib/openai/models/eval_list_response.rbi index 08a0827f..e1614678 100644 --- a/rbi/lib/openai/models/eval_list_response.rbi +++ b/rbi/lib/openai/models/eval_list_response.rbi @@ -83,9 +83,27 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) - end - + def self.new( + # Unique identifier for the evaluation. + id:, + # The Unix timestamp (in seconds) for when the eval was created. + created_at:, + # Configuration of data sources used in runs of the evaluation. + data_source_config:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata:, + # The name of the evaluation. + name:, + # A list of testing criteria. + testing_criteria:, + # The object type. + object: :eval + ); end sig do override .returns( @@ -160,8 +178,18 @@ module OpenAI params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) .returns(T.attached_class) end - def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end - + def self.new( + # The name of the grader. + name:, + # The source code of the python script. + source:, + # The image tag to use for the python script. + image_tag: nil, + # The threshold for the score. + pass_threshold: nil, + # The object type, which is always `python`. + type: :python + ); end sig do override.returns( { @@ -228,16 +256,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The input text. This may include template strings. input:, + # The model to use for the evaluation. model:, + # The name of the grader. name:, + # The threshold for the score. pass_threshold: nil, + # The range of the score. Defaults to `[0, 1]`. range: nil, + # The sampling parameters for the model. sampling_params: nil, + # The object type, which is always `score_model`. type: :score_model - ) - end - + ); end sig do override .returns( @@ -301,8 +334,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -334,8 +374,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/eval_retrieve_response.rbi b/rbi/lib/openai/models/eval_retrieve_response.rbi index a84f25d8..8e47cfe9 100644 --- a/rbi/lib/openai/models/eval_retrieve_response.rbi +++ b/rbi/lib/openai/models/eval_retrieve_response.rbi @@ -83,9 +83,27 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) - end - + def self.new( + # Unique identifier for the evaluation. + id:, + # The Unix timestamp (in seconds) for when the eval was created. + created_at:, + # Configuration of data sources used in runs of the evaluation. + data_source_config:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata:, + # The name of the evaluation. + name:, + # A list of testing criteria. + testing_criteria:, + # The object type. + object: :eval + ); end sig do override .returns( @@ -160,8 +178,18 @@ module OpenAI params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) .returns(T.attached_class) end - def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end - + def self.new( + # The name of the grader. + name:, + # The source code of the python script. + source:, + # The image tag to use for the python script. + image_tag: nil, + # The threshold for the score. + pass_threshold: nil, + # The object type, which is always `python`. + type: :python + ); end sig do override.returns( { @@ -233,16 +261,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The input text. This may include template strings. input:, + # The model to use for the evaluation. model:, + # The name of the grader. name:, + # The threshold for the score. pass_threshold: nil, + # The range of the score. Defaults to `[0, 1]`. range: nil, + # The sampling parameters for the model. sampling_params: nil, + # The object type, which is always `score_model`. type: :score_model - ) - end - + ); end sig do override .returns( @@ -309,8 +342,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -342,8 +382,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/eval_stored_completions_data_source_config.rbi b/rbi/lib/openai/models/eval_stored_completions_data_source_config.rbi index cfc531e0..2c6fd596 100644 --- a/rbi/lib/openai/models/eval_stored_completions_data_source_config.rbi +++ b/rbi/lib/openai/models/eval_stored_completions_data_source_config.rbi @@ -34,8 +34,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(schema:, metadata: nil, type: :stored_completions); end - + def self.new( + # The json schema for the run data source items. Learn how to build JSON schemas + # [here](https://json-schema.org/). + schema:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # The type of data source. Always `stored_completions`. + type: :stored_completions + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/eval_string_check_grader.rbi b/rbi/lib/openai/models/eval_string_check_grader.rbi index a7c9af35..cf0301de 100644 --- a/rbi/lib/openai/models/eval_string_check_grader.rbi +++ b/rbi/lib/openai/models/eval_string_check_grader.rbi @@ -35,8 +35,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input:, name:, operation:, reference:, type: :string_check); end - + def self.new( + # The input text. This may include template strings. + input:, + # The name of the grader. + name:, + # The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. + operation:, + # The reference text. This may include template strings. + reference:, + # The object type, which is always `string_check`. + type: :string_check + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/eval_text_similarity_grader.rbi b/rbi/lib/openai/models/eval_text_similarity_grader.rbi index f3675e7a..6b1c6e54 100644 --- a/rbi/lib/openai/models/eval_text_similarity_grader.rbi +++ b/rbi/lib/openai/models/eval_text_similarity_grader.rbi @@ -44,15 +44,20 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, + # `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. evaluation_metric:, + # The text being graded. input:, + # A float score where a value greater than or equal indicates a passing grade. pass_threshold:, + # The text being graded against. reference:, + # The name of the grader. name: nil, + # The type of grader. type: :text_similarity - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/eval_update_params.rbi b/rbi/lib/openai/models/eval_update_params.rbi index 86ef04e1..857900a1 100644 --- a/rbi/lib/openai/models/eval_update_params.rbi +++ b/rbi/lib/openai/models/eval_update_params.rbi @@ -30,8 +30,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(metadata: nil, name: nil, request_options: {}); end - + def self.new( + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # Rename the evaluation. + name: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/eval_update_response.rbi b/rbi/lib/openai/models/eval_update_response.rbi index 53a41e65..83a8e983 100644 --- a/rbi/lib/openai/models/eval_update_response.rbi +++ b/rbi/lib/openai/models/eval_update_response.rbi @@ -83,9 +83,27 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, created_at:, data_source_config:, metadata:, name:, testing_criteria:, object: :eval) - end - + def self.new( + # Unique identifier for the evaluation. + id:, + # The Unix timestamp (in seconds) for when the eval was created. + created_at:, + # Configuration of data sources used in runs of the evaluation. + data_source_config:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata:, + # The name of the evaluation. + name:, + # A list of testing criteria. + testing_criteria:, + # The object type. + object: :eval + ); end sig do override .returns( @@ -160,8 +178,18 @@ module OpenAI params(name: String, source: String, image_tag: String, pass_threshold: Float, type: Symbol) .returns(T.attached_class) end - def self.new(name:, source:, image_tag: nil, pass_threshold: nil, type: :python); end - + def self.new( + # The name of the grader. + name:, + # The source code of the python script. + source:, + # The image tag to use for the python script. + image_tag: nil, + # The threshold for the score. + pass_threshold: nil, + # The object type, which is always `python`. + type: :python + ); end sig do override.returns( { @@ -228,16 +256,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The input text. This may include template strings. input:, + # The model to use for the evaluation. model:, + # The name of the grader. name:, + # The threshold for the score. pass_threshold: nil, + # The range of the score. Defaults to `[0, 1]`. range: nil, + # The sampling parameters for the model. sampling_params: nil, + # The object type, which is always `score_model`. type: :score_model - ) - end - + ); end sig do override .returns( @@ -301,8 +334,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -334,8 +374,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi b/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi index 6e2ac631..6ac91b72 100644 --- a/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi +++ b/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi @@ -88,8 +88,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(source:, type:, input_messages: nil, model: nil, sampling_params: nil); end - + def self.new( + # A StoredCompletionsRunDataSource configuration describing a set of filters + source:, + # The type of run data source. Always `completions`. + type:, + input_messages: nil, + # The name of the model to use for generating completions (e.g. "o3-mini"). + model: nil, + sampling_params: nil + ); end sig do override .returns( @@ -136,8 +144,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :file_content); end - + def self.new( + # The content of the jsonl file. + content:, + # The type of jsonl source. Always `file_content`. + type: :file_content + ); end sig do override .returns( @@ -184,8 +196,12 @@ module OpenAI attr_accessor :type sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - + def self.new( + # The identifier of the file. + id:, + # The type of jsonl source. Always `file_id`. + type: :file_id + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end @@ -233,15 +249,24 @@ module OpenAI .returns(T.attached_class) end def self.new( + # An optional Unix timestamp to filter items created after this time. created_after: nil, + # An optional Unix timestamp to filter items created before this time. created_before: nil, + # An optional maximum number of items to return. limit: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # An optional model to filter by (e.g., 'gpt-4o'). model: nil, + # The type of source. Always `stored_completions`. type: :stored_completions - ) - end - + ); end sig do override .returns( @@ -317,8 +342,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(template:, type: :template); end - + def self.new( + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + template:, + # The type of input messages. Always `template`. + type: :template + ); end sig do override .returns( @@ -401,8 +431,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -434,8 +471,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -540,8 +581,12 @@ module OpenAI attr_accessor :type sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } - def self.new(item_reference:, type: :item_reference); end - + def self.new( + # A reference to a variable in the "item" namespace. Ie, "item.name" + item_reference:, + # The type of input messages. Always `item_reference`. + type: :item_reference + ); end sig { override.returns({item_reference: String, type: Symbol}) } def to_hash; end end @@ -588,8 +633,16 @@ module OpenAI params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) .returns(T.attached_class) end - def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end - + def self.new( + # The maximum number of tokens in the generated output. + max_completion_tokens: nil, + # A seed value to initialize the randomness, during sampling. + seed: nil, + # A higher temperature increases randomness in the outputs. + temperature: nil, + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + top_p: nil + ); end sig do override.returns( { diff --git a/rbi/lib/openai/models/evals/create_eval_jsonl_run_data_source.rbi b/rbi/lib/openai/models/evals/create_eval_jsonl_run_data_source.rbi index 12b3a3b6..66df840b 100644 --- a/rbi/lib/openai/models/evals/create_eval_jsonl_run_data_source.rbi +++ b/rbi/lib/openai/models/evals/create_eval_jsonl_run_data_source.rbi @@ -31,8 +31,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(source:, type: :jsonl); end - + def self.new( + source:, + # The type of data source. Always `jsonl`. + type: :jsonl + ); end sig do override .returns( @@ -71,8 +74,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :file_content); end - + def self.new( + # The content of the jsonl file. + content:, + # The type of jsonl source. Always `file_content`. + type: :file_content + ); end sig do override .returns( @@ -119,8 +126,12 @@ module OpenAI attr_accessor :type sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - + def self.new( + # The identifier of the file. + id:, + # The type of jsonl source. Always `file_id`. + type: :file_id + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/evals/eval_api_error.rbi b/rbi/lib/openai/models/evals/eval_api_error.rbi index cc6ac0e5..20859d95 100644 --- a/rbi/lib/openai/models/evals/eval_api_error.rbi +++ b/rbi/lib/openai/models/evals/eval_api_error.rbi @@ -14,8 +14,12 @@ module OpenAI # An object representing an error response from the Eval API. sig { params(code: String, message: String).returns(T.attached_class) } - def self.new(code:, message:); end - + def self.new( + # The error code. + code:, + # The error message. + message: + ); end sig { override.returns({code: String, message: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/evals/run_cancel_response.rbi b/rbi/lib/openai/models/evals/run_cancel_response.rbi index 35e93b1b..41ea134d 100644 --- a/rbi/lib/openai/models/evals/run_cancel_response.rbi +++ b/rbi/lib/openai/models/evals/run_cancel_response.rbi @@ -110,19 +110,38 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier for the evaluation run. id:, + # Unix timestamp (in seconds) when the evaluation run was created. created_at:, + # Information about the run's data source. data_source:, + # An object representing an error response from the Eval API. error:, + # The identifier of the associated evaluation. eval_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The model that is evaluated, if applicable. model:, + # The name of the evaluation run. name:, + # Usage statistics for each model during the evaluation run. per_model_usage:, + # Results per testing criteria applied during the evaluation run. per_testing_criteria_results:, + # The URL to the rendered evaluation run report on the UI dashboard. report_url:, + # Counters summarizing the outcomes of the evaluation run. result_counts:, + # The status of the evaluation run. status:, + # The type of the object. Always "eval.run". object: :"eval.run" ); end sig do @@ -241,9 +260,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) - end - + def self.new( + # A EvalResponsesSource object describing a run data source configuration. + source:, + input_messages: nil, + # The name of the model to use for generating completions (e.g. "o3-mini"). + model: nil, + sampling_params: nil, + # The type of run data source. Always `completions`. + type: :completions + ); end sig do override .returns( @@ -294,8 +320,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :file_content); end - + def self.new( + # The content of the jsonl file. + content:, + # The type of jsonl source. Always `file_content`. + type: :file_content + ); end sig do override .returns( @@ -343,8 +373,12 @@ module OpenAI attr_accessor :type sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - + def self.new( + # The identifier of the file. + id:, + # The type of jsonl source. Always `file_id`. + type: :file_id + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end @@ -425,17 +459,37 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. allow_parallel_tool_calls: nil, + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. created_after: nil, + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. created_before: nil, + # Whether the response has tool calls. This is a query parameter used to select + # responses. has_tool_calls: nil, + # Optional search string for instructions. This is a query parameter used to + # select responses. instructions_search: nil, + # Metadata filter for the responses. This is a query parameter used to select + # responses. metadata: nil, + # The name of the model to find responses for. This is a query parameter used to + # select responses. model: nil, + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. reasoning_effort: nil, + # Sampling temperature. This is a query parameter used to select responses. temperature: nil, + # Nucleus sampling parameter. This is a query parameter used to select responses. top_p: nil, + # List of user identifiers. This is a query parameter used to select responses. users: nil, + # The type of run data source. Always `responses`. type: :responses ); end sig do @@ -504,8 +558,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(template:, type: :template); end - + def self.new( + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + template:, + # The type of input messages. Always `template`. + type: :template + ); end sig do override .returns( @@ -540,8 +599,12 @@ module OpenAI attr_accessor :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message (e.g. "system", "assistant", "user"). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -604,8 +667,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -637,8 +707,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -743,8 +817,12 @@ module OpenAI attr_accessor :type sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } - def self.new(item_reference:, type: :item_reference); end - + def self.new( + # A reference to a variable in the "item" namespace. Ie, "item.name" + item_reference:, + # The type of input messages. Always `item_reference`. + type: :item_reference + ); end sig { override.returns({item_reference: String, type: Symbol}) } def to_hash; end end @@ -791,8 +869,16 @@ module OpenAI params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) .returns(T.attached_class) end - def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end - + def self.new( + # The maximum number of tokens in the generated output. + max_completion_tokens: nil, + # A seed value to initialize the randomness, during sampling. + seed: nil, + # A higher temperature increases randomness in the outputs. + temperature: nil, + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + top_p: nil + ); end sig do override.returns( { @@ -853,15 +939,19 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The number of tokens retrieved from cache. cached_tokens:, + # The number of completion tokens generated. completion_tokens:, + # The number of invocations. invocation_count:, + # The name of the model. model_name:, + # The number of prompt tokens used. prompt_tokens:, + # The total number of tokens used. total_tokens: - ) - end - + ); end sig do override .returns( @@ -892,8 +982,14 @@ module OpenAI attr_accessor :testing_criteria sig { params(failed: Integer, passed: Integer, testing_criteria: String).returns(T.attached_class) } - def self.new(failed:, passed:, testing_criteria:); end - + def self.new( + # Number of tests failed for this criteria. + failed:, + # Number of tests passed for this criteria. + passed:, + # A description of the testing criteria. + testing_criteria: + ); end sig { override.returns({failed: Integer, passed: Integer, testing_criteria: String}) } def to_hash; end end @@ -924,8 +1020,16 @@ module OpenAI total: Integer ).returns(T.attached_class) end - def self.new(errored:, failed:, passed:, total:); end - + def self.new( + # Number of output items that resulted in an error. + errored:, + # Number of output items that failed to pass the evaluation. + failed:, + # Number of output items that passed the evaluation. + passed:, + # Total number of executed output items. + total: + ); end sig { override.returns({errored: Integer, failed: Integer, passed: Integer, total: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/evals/run_create_params.rbi b/rbi/lib/openai/models/evals/run_create_params.rbi index c995c3ef..4a286695 100644 --- a/rbi/lib/openai/models/evals/run_create_params.rbi +++ b/rbi/lib/openai/models/evals/run_create_params.rbi @@ -49,8 +49,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data_source:, metadata: nil, name: nil, request_options: {}); end - + def self.new( + # Details about the run's data source. + data_source:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # The name of the run. + name: nil, + request_options: {} + ); end sig do override .returns( @@ -167,8 +179,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(source:, type:, input_messages: nil, model: nil, sampling_params: nil); end - + def self.new( + # A EvalResponsesSource object describing a run data source configuration. + source:, + # The type of run data source. Always `completions`. + type:, + input_messages: nil, + # The name of the model to use for generating completions (e.g. "o3-mini"). + model: nil, + sampling_params: nil + ); end sig do override .returns( @@ -221,8 +241,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :file_content); end - + def self.new( + # The content of the jsonl file. + content:, + # The type of jsonl source. Always `file_content`. + type: :file_content + ); end sig do override .returns( @@ -272,8 +296,12 @@ module OpenAI attr_accessor :type sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - + def self.new( + # The identifier of the file. + id:, + # The type of jsonl source. Always `file_id`. + type: :file_id + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end @@ -354,17 +382,37 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. allow_parallel_tool_calls: nil, + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. created_after: nil, + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. created_before: nil, + # Whether the response has tool calls. This is a query parameter used to select + # responses. has_tool_calls: nil, + # Optional search string for instructions. This is a query parameter used to + # select responses. instructions_search: nil, + # Metadata filter for the responses. This is a query parameter used to select + # responses. metadata: nil, + # The name of the model to find responses for. This is a query parameter used to + # select responses. model: nil, + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. reasoning_effort: nil, + # Sampling temperature. This is a query parameter used to select responses. temperature: nil, + # Nucleus sampling parameter. This is a query parameter used to select responses. top_p: nil, + # List of user identifiers. This is a query parameter used to select responses. users: nil, + # The type of run data source. Always `responses`. type: :responses ); end sig do @@ -456,8 +504,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(template:, type: :template); end - + def self.new( + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + template:, + # The type of input messages. Always `template`. + type: :template + ); end sig do override .returns( @@ -492,8 +545,12 @@ module OpenAI attr_accessor :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message (e.g. "system", "assistant", "user"). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -556,8 +613,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -589,8 +653,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -695,8 +763,12 @@ module OpenAI attr_accessor :type sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } - def self.new(item_reference:, type: :item_reference); end - + def self.new( + # A reference to a variable in the "item" namespace. Ie, "item.name" + item_reference:, + # The type of input messages. Always `item_reference`. + type: :item_reference + ); end sig { override.returns({item_reference: String, type: Symbol}) } def to_hash; end end @@ -743,8 +815,16 @@ module OpenAI params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) .returns(T.attached_class) end - def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end - + def self.new( + # The maximum number of tokens in the generated output. + max_completion_tokens: nil, + # A seed value to initialize the randomness, during sampling. + seed: nil, + # A higher temperature increases randomness in the outputs. + temperature: nil, + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + top_p: nil + ); end sig do override.returns( { diff --git a/rbi/lib/openai/models/evals/run_create_response.rbi b/rbi/lib/openai/models/evals/run_create_response.rbi index 40364127..cebc26ac 100644 --- a/rbi/lib/openai/models/evals/run_create_response.rbi +++ b/rbi/lib/openai/models/evals/run_create_response.rbi @@ -110,19 +110,38 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier for the evaluation run. id:, + # Unix timestamp (in seconds) when the evaluation run was created. created_at:, + # Information about the run's data source. data_source:, + # An object representing an error response from the Eval API. error:, + # The identifier of the associated evaluation. eval_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The model that is evaluated, if applicable. model:, + # The name of the evaluation run. name:, + # Usage statistics for each model during the evaluation run. per_model_usage:, + # Results per testing criteria applied during the evaluation run. per_testing_criteria_results:, + # The URL to the rendered evaluation run report on the UI dashboard. report_url:, + # Counters summarizing the outcomes of the evaluation run. result_counts:, + # The status of the evaluation run. status:, + # The type of the object. Always "eval.run". object: :"eval.run" ); end sig do @@ -241,9 +260,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) - end - + def self.new( + # A EvalResponsesSource object describing a run data source configuration. + source:, + input_messages: nil, + # The name of the model to use for generating completions (e.g. "o3-mini"). + model: nil, + sampling_params: nil, + # The type of run data source. Always `completions`. + type: :completions + ); end sig do override .returns( @@ -294,8 +320,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :file_content); end - + def self.new( + # The content of the jsonl file. + content:, + # The type of jsonl source. Always `file_content`. + type: :file_content + ); end sig do override .returns( @@ -343,8 +373,12 @@ module OpenAI attr_accessor :type sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - + def self.new( + # The identifier of the file. + id:, + # The type of jsonl source. Always `file_id`. + type: :file_id + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end @@ -425,17 +459,37 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. allow_parallel_tool_calls: nil, + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. created_after: nil, + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. created_before: nil, + # Whether the response has tool calls. This is a query parameter used to select + # responses. has_tool_calls: nil, + # Optional search string for instructions. This is a query parameter used to + # select responses. instructions_search: nil, + # Metadata filter for the responses. This is a query parameter used to select + # responses. metadata: nil, + # The name of the model to find responses for. This is a query parameter used to + # select responses. model: nil, + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. reasoning_effort: nil, + # Sampling temperature. This is a query parameter used to select responses. temperature: nil, + # Nucleus sampling parameter. This is a query parameter used to select responses. top_p: nil, + # List of user identifiers. This is a query parameter used to select responses. users: nil, + # The type of run data source. Always `responses`. type: :responses ); end sig do @@ -504,8 +558,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(template:, type: :template); end - + def self.new( + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + template:, + # The type of input messages. Always `template`. + type: :template + ); end sig do override .returns( @@ -540,8 +599,12 @@ module OpenAI attr_accessor :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message (e.g. "system", "assistant", "user"). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -604,8 +667,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -637,8 +707,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -743,8 +817,12 @@ module OpenAI attr_accessor :type sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } - def self.new(item_reference:, type: :item_reference); end - + def self.new( + # A reference to a variable in the "item" namespace. Ie, "item.name" + item_reference:, + # The type of input messages. Always `item_reference`. + type: :item_reference + ); end sig { override.returns({item_reference: String, type: Symbol}) } def to_hash; end end @@ -791,8 +869,16 @@ module OpenAI params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) .returns(T.attached_class) end - def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end - + def self.new( + # The maximum number of tokens in the generated output. + max_completion_tokens: nil, + # A seed value to initialize the randomness, during sampling. + seed: nil, + # A higher temperature increases randomness in the outputs. + temperature: nil, + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + top_p: nil + ); end sig do override.returns( { @@ -853,15 +939,19 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The number of tokens retrieved from cache. cached_tokens:, + # The number of completion tokens generated. completion_tokens:, + # The number of invocations. invocation_count:, + # The name of the model. model_name:, + # The number of prompt tokens used. prompt_tokens:, + # The total number of tokens used. total_tokens: - ) - end - + ); end sig do override .returns( @@ -892,8 +982,14 @@ module OpenAI attr_accessor :testing_criteria sig { params(failed: Integer, passed: Integer, testing_criteria: String).returns(T.attached_class) } - def self.new(failed:, passed:, testing_criteria:); end - + def self.new( + # Number of tests failed for this criteria. + failed:, + # Number of tests passed for this criteria. + passed:, + # A description of the testing criteria. + testing_criteria: + ); end sig { override.returns({failed: Integer, passed: Integer, testing_criteria: String}) } def to_hash; end end @@ -924,8 +1020,16 @@ module OpenAI total: Integer ).returns(T.attached_class) end - def self.new(errored:, failed:, passed:, total:); end - + def self.new( + # Number of output items that resulted in an error. + errored:, + # Number of output items that failed to pass the evaluation. + failed:, + # Number of output items that passed the evaluation. + passed:, + # Total number of executed output items. + total: + ); end sig { override.returns({errored: Integer, failed: Integer, passed: Integer, total: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/evals/run_list_params.rbi b/rbi/lib/openai/models/evals/run_list_params.rbi index c3cf6599..aa4151ed 100644 --- a/rbi/lib/openai/models/evals/run_list_params.rbi +++ b/rbi/lib/openai/models/evals/run_list_params.rbi @@ -47,8 +47,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, order: nil, status: nil, request_options: {}); end - + def self.new( + # Identifier for the last run from the previous pagination request. + after: nil, + # Number of runs to retrieve. + limit: nil, + # Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for + # descending order. Defaults to `asc`. + order: nil, + # Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` + # | `canceled`. + status: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/evals/run_list_response.rbi b/rbi/lib/openai/models/evals/run_list_response.rbi index f264782f..e00b1471 100644 --- a/rbi/lib/openai/models/evals/run_list_response.rbi +++ b/rbi/lib/openai/models/evals/run_list_response.rbi @@ -110,19 +110,38 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier for the evaluation run. id:, + # Unix timestamp (in seconds) when the evaluation run was created. created_at:, + # Information about the run's data source. data_source:, + # An object representing an error response from the Eval API. error:, + # The identifier of the associated evaluation. eval_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The model that is evaluated, if applicable. model:, + # The name of the evaluation run. name:, + # Usage statistics for each model during the evaluation run. per_model_usage:, + # Results per testing criteria applied during the evaluation run. per_testing_criteria_results:, + # The URL to the rendered evaluation run report on the UI dashboard. report_url:, + # Counters summarizing the outcomes of the evaluation run. result_counts:, + # The status of the evaluation run. status:, + # The type of the object. Always "eval.run". object: :"eval.run" ); end sig do @@ -241,9 +260,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) - end - + def self.new( + # A EvalResponsesSource object describing a run data source configuration. + source:, + input_messages: nil, + # The name of the model to use for generating completions (e.g. "o3-mini"). + model: nil, + sampling_params: nil, + # The type of run data source. Always `completions`. + type: :completions + ); end sig do override .returns( @@ -294,8 +320,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :file_content); end - + def self.new( + # The content of the jsonl file. + content:, + # The type of jsonl source. Always `file_content`. + type: :file_content + ); end sig do override .returns( @@ -343,8 +373,12 @@ module OpenAI attr_accessor :type sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - + def self.new( + # The identifier of the file. + id:, + # The type of jsonl source. Always `file_id`. + type: :file_id + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end @@ -425,17 +459,37 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. allow_parallel_tool_calls: nil, + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. created_after: nil, + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. created_before: nil, + # Whether the response has tool calls. This is a query parameter used to select + # responses. has_tool_calls: nil, + # Optional search string for instructions. This is a query parameter used to + # select responses. instructions_search: nil, + # Metadata filter for the responses. This is a query parameter used to select + # responses. metadata: nil, + # The name of the model to find responses for. This is a query parameter used to + # select responses. model: nil, + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. reasoning_effort: nil, + # Sampling temperature. This is a query parameter used to select responses. temperature: nil, + # Nucleus sampling parameter. This is a query parameter used to select responses. top_p: nil, + # List of user identifiers. This is a query parameter used to select responses. users: nil, + # The type of run data source. Always `responses`. type: :responses ); end sig do @@ -504,8 +558,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(template:, type: :template); end - + def self.new( + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + template:, + # The type of input messages. Always `template`. + type: :template + ); end sig do override .returns( @@ -540,8 +599,12 @@ module OpenAI attr_accessor :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message (e.g. "system", "assistant", "user"). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -604,8 +667,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -637,8 +707,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -743,8 +817,12 @@ module OpenAI attr_accessor :type sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } - def self.new(item_reference:, type: :item_reference); end - + def self.new( + # A reference to a variable in the "item" namespace. Ie, "item.name" + item_reference:, + # The type of input messages. Always `item_reference`. + type: :item_reference + ); end sig { override.returns({item_reference: String, type: Symbol}) } def to_hash; end end @@ -791,8 +869,16 @@ module OpenAI params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) .returns(T.attached_class) end - def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end - + def self.new( + # The maximum number of tokens in the generated output. + max_completion_tokens: nil, + # A seed value to initialize the randomness, during sampling. + seed: nil, + # A higher temperature increases randomness in the outputs. + temperature: nil, + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + top_p: nil + ); end sig do override.returns( { @@ -853,15 +939,19 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The number of tokens retrieved from cache. cached_tokens:, + # The number of completion tokens generated. completion_tokens:, + # The number of invocations. invocation_count:, + # The name of the model. model_name:, + # The number of prompt tokens used. prompt_tokens:, + # The total number of tokens used. total_tokens: - ) - end - + ); end sig do override .returns( @@ -892,8 +982,14 @@ module OpenAI attr_accessor :testing_criteria sig { params(failed: Integer, passed: Integer, testing_criteria: String).returns(T.attached_class) } - def self.new(failed:, passed:, testing_criteria:); end - + def self.new( + # Number of tests failed for this criteria. + failed:, + # Number of tests passed for this criteria. + passed:, + # A description of the testing criteria. + testing_criteria: + ); end sig { override.returns({failed: Integer, passed: Integer, testing_criteria: String}) } def to_hash; end end @@ -924,8 +1020,16 @@ module OpenAI total: Integer ).returns(T.attached_class) end - def self.new(errored:, failed:, passed:, total:); end - + def self.new( + # Number of output items that resulted in an error. + errored:, + # Number of output items that failed to pass the evaluation. + failed:, + # Number of output items that passed the evaluation. + passed:, + # Total number of executed output items. + total: + ); end sig { override.returns({errored: Integer, failed: Integer, passed: Integer, total: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/evals/run_retrieve_response.rbi b/rbi/lib/openai/models/evals/run_retrieve_response.rbi index 405a83cf..70df1bc9 100644 --- a/rbi/lib/openai/models/evals/run_retrieve_response.rbi +++ b/rbi/lib/openai/models/evals/run_retrieve_response.rbi @@ -110,19 +110,38 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier for the evaluation run. id:, + # Unix timestamp (in seconds) when the evaluation run was created. created_at:, + # Information about the run's data source. data_source:, + # An object representing an error response from the Eval API. error:, + # The identifier of the associated evaluation. eval_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The model that is evaluated, if applicable. model:, + # The name of the evaluation run. name:, + # Usage statistics for each model during the evaluation run. per_model_usage:, + # Results per testing criteria applied during the evaluation run. per_testing_criteria_results:, + # The URL to the rendered evaluation run report on the UI dashboard. report_url:, + # Counters summarizing the outcomes of the evaluation run. result_counts:, + # The status of the evaluation run. status:, + # The type of the object. Always "eval.run". object: :"eval.run" ); end sig do @@ -241,9 +260,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(source:, input_messages: nil, model: nil, sampling_params: nil, type: :completions) - end - + def self.new( + # A EvalResponsesSource object describing a run data source configuration. + source:, + input_messages: nil, + # The name of the model to use for generating completions (e.g. "o3-mini"). + model: nil, + sampling_params: nil, + # The type of run data source. Always `completions`. + type: :completions + ); end sig do override .returns( @@ -294,8 +320,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, type: :file_content); end - + def self.new( + # The content of the jsonl file. + content:, + # The type of jsonl source. Always `file_content`. + type: :file_content + ); end sig do override .returns( @@ -343,8 +373,12 @@ module OpenAI attr_accessor :type sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :file_id); end - + def self.new( + # The identifier of the file. + id:, + # The type of jsonl source. Always `file_id`. + type: :file_id + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end @@ -425,17 +459,37 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Whether to allow parallel tool calls. This is a query parameter used to select + # responses. allow_parallel_tool_calls: nil, + # Only include items created after this timestamp (inclusive). This is a query + # parameter used to select responses. created_after: nil, + # Only include items created before this timestamp (inclusive). This is a query + # parameter used to select responses. created_before: nil, + # Whether the response has tool calls. This is a query parameter used to select + # responses. has_tool_calls: nil, + # Optional search string for instructions. This is a query parameter used to + # select responses. instructions_search: nil, + # Metadata filter for the responses. This is a query parameter used to select + # responses. metadata: nil, + # The name of the model to find responses for. This is a query parameter used to + # select responses. model: nil, + # Optional reasoning effort parameter. This is a query parameter used to select + # responses. reasoning_effort: nil, + # Sampling temperature. This is a query parameter used to select responses. temperature: nil, + # Nucleus sampling parameter. This is a query parameter used to select responses. top_p: nil, + # List of user identifiers. This is a query parameter used to select responses. users: nil, + # The type of run data source. Always `responses`. type: :responses ); end sig do @@ -504,8 +558,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(template:, type: :template); end - + def self.new( + # A list of chat messages forming the prompt or context. May include variable + # references to the "item" namespace, ie {{item.name}}. + template:, + # The type of input messages. Always `template`. + type: :template + ); end sig do override .returns( @@ -540,8 +599,12 @@ module OpenAI attr_accessor :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message (e.g. "system", "assistant", "user"). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -604,8 +667,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text inputs to the model - can contain template strings. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( @@ -637,8 +707,12 @@ module OpenAI # A text output from the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :output_text); end - + def self.new( + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -743,8 +817,12 @@ module OpenAI attr_accessor :type sig { params(item_reference: String, type: Symbol).returns(T.attached_class) } - def self.new(item_reference:, type: :item_reference); end - + def self.new( + # A reference to a variable in the "item" namespace. Ie, "item.name" + item_reference:, + # The type of input messages. Always `item_reference`. + type: :item_reference + ); end sig { override.returns({item_reference: String, type: Symbol}) } def to_hash; end end @@ -791,8 +869,16 @@ module OpenAI params(max_completion_tokens: Integer, seed: Integer, temperature: Float, top_p: Float) .returns(T.attached_class) end - def self.new(max_completion_tokens: nil, seed: nil, temperature: nil, top_p: nil); end - + def self.new( + # The maximum number of tokens in the generated output. + max_completion_tokens: nil, + # A seed value to initialize the randomness, during sampling. + seed: nil, + # A higher temperature increases randomness in the outputs. + temperature: nil, + # An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + top_p: nil + ); end sig do override.returns( { @@ -853,15 +939,19 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The number of tokens retrieved from cache. cached_tokens:, + # The number of completion tokens generated. completion_tokens:, + # The number of invocations. invocation_count:, + # The name of the model. model_name:, + # The number of prompt tokens used. prompt_tokens:, + # The total number of tokens used. total_tokens: - ) - end - + ); end sig do override .returns( @@ -892,8 +982,14 @@ module OpenAI attr_accessor :testing_criteria sig { params(failed: Integer, passed: Integer, testing_criteria: String).returns(T.attached_class) } - def self.new(failed:, passed:, testing_criteria:); end - + def self.new( + # Number of tests failed for this criteria. + failed:, + # Number of tests passed for this criteria. + passed:, + # A description of the testing criteria. + testing_criteria: + ); end sig { override.returns({failed: Integer, passed: Integer, testing_criteria: String}) } def to_hash; end end @@ -924,8 +1020,16 @@ module OpenAI total: Integer ).returns(T.attached_class) end - def self.new(errored:, failed:, passed:, total:); end - + def self.new( + # Number of output items that resulted in an error. + errored:, + # Number of output items that failed to pass the evaluation. + failed:, + # Number of output items that passed the evaluation. + passed:, + # Total number of executed output items. + total: + ); end sig { override.returns({errored: Integer, failed: Integer, passed: Integer, total: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/evals/runs/output_item_list_params.rbi b/rbi/lib/openai/models/evals/runs/output_item_list_params.rbi index 1d9f802f..e6931f3d 100644 --- a/rbi/lib/openai/models/evals/runs/output_item_list_params.rbi +++ b/rbi/lib/openai/models/evals/runs/output_item_list_params.rbi @@ -52,8 +52,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(eval_id:, after: nil, limit: nil, order: nil, status: nil, request_options: {}); end - + def self.new( + eval_id:, + # Identifier for the last output item from the previous pagination request. + after: nil, + # Number of output items to retrieve. + limit: nil, + # Sort order for output items by timestamp. Use `asc` for ascending order or + # `desc` for descending order. Defaults to `asc`. + order: nil, + # Filter output items by status. Use `failed` to filter by failed output items or + # `pass` to filter by passed output items. + status: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/evals/runs/output_item_list_response.rbi b/rbi/lib/openai/models/evals/runs/output_item_list_response.rbi index ecb65334..027b0dd3 100644 --- a/rbi/lib/openai/models/evals/runs/output_item_list_response.rbi +++ b/rbi/lib/openai/models/evals/runs/output_item_list_response.rbi @@ -70,15 +70,25 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier for the evaluation run output item. id:, + # Unix timestamp (in seconds) when the evaluation run was created. created_at:, + # Details of the input data source item. datasource_item:, + # The identifier for the data source item. datasource_item_id:, + # The identifier of the evaluation group. eval_id:, + # A list of results from the evaluation run. results:, + # The identifier of the evaluation run associated with this output item. run_id:, + # A sample containing the input and output of the evaluation run. sample:, + # The status of the evaluation run. status:, + # The type of the object. Always "eval.run.output_item". object: :"eval.run.output_item" ); end sig do @@ -169,15 +179,25 @@ module OpenAI .returns(T.attached_class) end def self.new( + # An object representing an error response from the Eval API. error:, + # The reason why the sample generation was finished. finish_reason:, + # An array of input messages. input:, + # The maximum number of tokens allowed for completion. max_completion_tokens:, + # The model used for generating the sample. model:, + # An array of output messages. output:, + # The seed used for generating the sample. seed:, + # The sampling temperature used. temperature:, + # The top_p value used for sampling. top_p:, + # Token usage details for the sample. usage: ); end sig do @@ -210,8 +230,12 @@ module OpenAI # An input message. sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message sender (e.g., system, user, developer). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -232,8 +256,12 @@ module OpenAI attr_writer :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content: nil, role: nil); end - + def self.new( + # The content of the message. + content: nil, + # The role of the message (e.g. "system", "assistant", "user"). + role: nil + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -265,8 +293,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(cached_tokens:, completion_tokens:, prompt_tokens:, total_tokens:); end - + def self.new( + # The number of tokens retrieved from cache. + cached_tokens:, + # The number of completion tokens generated. + completion_tokens:, + # The number of prompt tokens used. + prompt_tokens:, + # The total number of tokens used. + total_tokens: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/evals/runs/output_item_retrieve_response.rbi b/rbi/lib/openai/models/evals/runs/output_item_retrieve_response.rbi index b538f6cd..69bee6f1 100644 --- a/rbi/lib/openai/models/evals/runs/output_item_retrieve_response.rbi +++ b/rbi/lib/openai/models/evals/runs/output_item_retrieve_response.rbi @@ -70,15 +70,25 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier for the evaluation run output item. id:, + # Unix timestamp (in seconds) when the evaluation run was created. created_at:, + # Details of the input data source item. datasource_item:, + # The identifier for the data source item. datasource_item_id:, + # The identifier of the evaluation group. eval_id:, + # A list of results from the evaluation run. results:, + # The identifier of the evaluation run associated with this output item. run_id:, + # A sample containing the input and output of the evaluation run. sample:, + # The status of the evaluation run. status:, + # The type of the object. Always "eval.run.output_item". object: :"eval.run.output_item" ); end sig do @@ -169,15 +179,25 @@ module OpenAI .returns(T.attached_class) end def self.new( + # An object representing an error response from the Eval API. error:, + # The reason why the sample generation was finished. finish_reason:, + # An array of input messages. input:, + # The maximum number of tokens allowed for completion. max_completion_tokens:, + # The model used for generating the sample. model:, + # An array of output messages. output:, + # The seed used for generating the sample. seed:, + # The sampling temperature used. temperature:, + # The top_p value used for sampling. top_p:, + # Token usage details for the sample. usage: ); end sig do @@ -210,8 +230,12 @@ module OpenAI # An input message. sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content:, role:); end - + def self.new( + # The content of the message. + content:, + # The role of the message sender (e.g., system, user, developer). + role: + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -232,8 +256,12 @@ module OpenAI attr_writer :role sig { params(content: String, role: String).returns(T.attached_class) } - def self.new(content: nil, role: nil); end - + def self.new( + # The content of the message. + content: nil, + # The role of the message (e.g. "system", "assistant", "user"). + role: nil + ); end sig { override.returns({content: String, role: String}) } def to_hash; end end @@ -265,8 +293,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(cached_tokens:, completion_tokens:, prompt_tokens:, total_tokens:); end - + def self.new( + # The number of tokens retrieved from cache. + cached_tokens:, + # The number of completion tokens generated. + completion_tokens:, + # The number of prompt tokens used. + prompt_tokens:, + # The total number of tokens used. + total_tokens: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/file_create_params.rbi b/rbi/lib/openai/models/file_create_params.rbi index c4a5174b..2580e280 100644 --- a/rbi/lib/openai/models/file_create_params.rbi +++ b/rbi/lib/openai/models/file_create_params.rbi @@ -25,8 +25,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file:, purpose:, request_options: {}); end - + def self.new( + # The File object (not file name) to be uploaded. + file:, + # The intended purpose of the uploaded file. One of: - `assistants`: Used in the + # Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for + # fine-tuning - `vision`: Images used for vision fine-tuning - `user_data`: + # Flexible file type for any purpose - `evals`: Used for eval data sets + purpose:, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/file_list_params.rbi b/rbi/lib/openai/models/file_list_params.rbi index 69d9b1a3..b33289b5 100644 --- a/rbi/lib/openai/models/file_list_params.rbi +++ b/rbi/lib/openai/models/file_list_params.rbi @@ -49,8 +49,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, order: nil, purpose: nil, request_options: {}); end - + def self.new( + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. + after: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 10,000, and the default is 10,000. + limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. + order: nil, + # Only return files with the given purpose. + purpose: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/file_object.rbi b/rbi/lib/openai/models/file_object.rbi index 82c4880a..af7989d6 100644 --- a/rbi/lib/openai/models/file_object.rbi +++ b/rbi/lib/openai/models/file_object.rbi @@ -65,14 +65,27 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The file identifier, which can be referenced in the API endpoints. id:, + # The size of the file, in bytes. bytes:, + # The Unix timestamp (in seconds) for when the file was created. created_at:, + # The name of the file. filename:, + # The intended purpose of the file. Supported values are `assistants`, + # `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` + # and `vision`. purpose:, + # Deprecated. The current status of the file, which can be either `uploaded`, + # `processed`, or `error`. status:, + # The Unix timestamp (in seconds) for when the file will expire. expires_at: nil, + # Deprecated. For details on why a fine-tuning training file failed validation, + # see the `error` field on `fine_tuning.job`. status_details: nil, + # The object type, which is always `file`. object: :file ); end sig do diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rbi b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rbi index 27d4ad09..b8e4f73d 100644 --- a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rbi @@ -19,8 +19,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(project_ids:, request_options: {}); end - + def self.new( + # The project identifiers to grant access to. + project_ids:, + request_options: {} + ); end sig { override.returns({project_ids: T::Array[String], request_options: OpenAI::RequestOptions}) } def to_hash; end end diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rbi b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rbi index 07d7d8b6..6dadadac 100644 --- a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rbi +++ b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rbi @@ -31,8 +31,16 @@ module OpenAI object: Symbol ).returns(T.attached_class) end - def self.new(id:, created_at:, project_id:, object: :"checkpoint.permission"); end - + def self.new( + # The permission identifier, which can be referenced in the API endpoints. + id:, + # The Unix timestamp (in seconds) for when the permission was created. + created_at:, + # The project identifier that the permission is for. + project_id:, + # The object type, which is always "checkpoint.permission". + object: :"checkpoint.permission" + ); end sig { override.returns({id: String, created_at: Integer, object: Symbol, project_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi index 9a510f8c..6bc5d73b 100644 --- a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi +++ b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi @@ -18,8 +18,14 @@ module OpenAI attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } - def self.new(id:, deleted:, object: :"checkpoint.permission"); end - + def self.new( + # The ID of the fine-tuned model checkpoint permission that was deleted. + id:, + # Whether the fine-tuned model checkpoint permission was successfully deleted. + deleted:, + # The object type, which is always "checkpoint.permission". + object: :"checkpoint.permission" + ); end sig { override.returns({id: String, deleted: T::Boolean, object: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi index 938c8a10..04da40a3 100644 --- a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi @@ -46,8 +46,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, order: nil, project_id: nil, request_options: {}); end - + def self.new( + # Identifier for the last permission ID from the previous pagination request. + after: nil, + # Number of permissions to retrieve. + limit: nil, + # The order in which to retrieve permissions. + order: nil, + # The ID of the project to get permissions for. + project_id: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi index dc137a5f..95aa5332 100644 --- a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi +++ b/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi @@ -78,8 +78,16 @@ module OpenAI object: Symbol ).returns(T.attached_class) end - def self.new(id:, created_at:, project_id:, object: :"checkpoint.permission"); end - + def self.new( + # The permission identifier, which can be referenced in the API endpoints. + id:, + # The Unix timestamp (in seconds) for when the permission was created. + created_at:, + # The project identifier that the permission is for. + project_id:, + # The object type, which is always "checkpoint.permission". + object: :"checkpoint.permission" + ); end sig { override.returns({id: String, created_at: Integer, object: Symbol, project_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi index 6e25d748..b9a0f929 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi @@ -145,24 +145,60 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The object identifier, which can be referenced in the API endpoints. id:, + # The Unix timestamp (in seconds) for when the fine-tuning job was created. created_at:, + # For fine-tuning jobs that have `failed`, this will contain more information on + # the cause of the failure. error:, + # The name of the fine-tuned model that is being created. The value will be null + # if the fine-tuning job is still running. fine_tuned_model:, + # The Unix timestamp (in seconds) for when the fine-tuning job was finished. The + # value will be null if the fine-tuning job is still running. finished_at:, + # The hyperparameters used for the fine-tuning job. This value will only be + # returned when running `supervised` jobs. hyperparameters:, + # The base model that is being fine-tuned. model:, + # The organization that owns the fine-tuning job. organization_id:, + # The compiled results file ID(s) for the fine-tuning job. You can retrieve the + # results with the + # [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). result_files:, + # The seed used for the fine-tuning job. seed:, + # The current status of the fine-tuning job, which can be either + # `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. status:, + # The total number of billable tokens processed by this fine-tuning job. The value + # will be null if the fine-tuning job is still running. trained_tokens:, + # The file ID used for training. You can retrieve the training data with the + # [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). training_file:, + # The file ID used for validation. You can retrieve the validation results with + # the + # [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). validation_file:, + # The Unix timestamp (in seconds) for when the fine-tuning job is estimated to + # finish. The value will be null if the fine-tuning job is not running. estimated_finish: nil, + # A list of integrations to enable for this fine-tuning job. integrations: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # The method used for fine-tuning. method_: nil, + # The object type, which is always "fine_tuning.job". object: :"fine_tuning.job" ); end sig do @@ -210,8 +246,15 @@ module OpenAI # For fine-tuning jobs that have `failed`, this will contain more information on # the cause of the failure. sig { params(code: String, message: String, param: T.nilable(String)).returns(T.attached_class) } - def self.new(code:, message:, param:); end - + def self.new( + # A machine-readable error code. + code:, + # A human-readable error message. + message:, + # The parameter that was invalid, usually `training_file` or `validation_file`. + # This field will be null if the failure was not parameter-specific. + param: + ); end sig { override.returns({code: String, message: String, param: T.nilable(String)}) } def to_hash; end end @@ -251,8 +294,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil); end - + def self.new( + # Number of examples in each batch. A larger batch size means that model + # parameters are updated less frequently, but with lower variance. + batch_size: nil, + # Scaling factor for the learning rate. A smaller learning rate may be useful to + # avoid overfitting. + learning_rate_multiplier: nil, + # The number of epochs to train the model for. An epoch refers to one full cycle + # through the training dataset. + n_epochs: nil + ); end sig do override .returns( @@ -349,8 +401,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(dpo: nil, supervised: nil, type: nil); end - + def self.new( + # Configuration for the DPO fine-tuning method. + dpo: nil, + # Configuration for the supervised fine-tuning method. + supervised: nil, + # The type of method. Is either `supervised` or `dpo`. + type: nil + ); end sig do override .returns( @@ -383,8 +441,10 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(hyperparameters: nil); end - + def self.new( + # The hyperparameters used for the fine-tuning job. + hyperparameters: nil + ); end sig do override .returns({hyperparameters: OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters}) @@ -434,8 +494,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(batch_size: nil, beta: nil, learning_rate_multiplier: nil, n_epochs: nil); end - + def self.new( + # Number of examples in each batch. A larger batch size means that model + # parameters are updated less frequently, but with lower variance. + batch_size: nil, + # The beta value for the DPO method. A higher beta value will increase the weight + # of the penalty between the policy and reference model. + beta: nil, + # Scaling factor for the learning rate. A smaller learning rate may be useful to + # avoid overfitting. + learning_rate_multiplier: nil, + # The number of epochs to train the model for. An epoch refers to one full cycle + # through the training dataset. + n_epochs: nil + ); end sig do override .returns( @@ -513,8 +585,10 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(hyperparameters: nil); end - + def self.new( + # The hyperparameters used for the fine-tuning job. + hyperparameters: nil + ); end sig do override .returns({hyperparameters: OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters}) @@ -555,8 +629,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil); end - + def self.new( + # Number of examples in each batch. A larger batch size means that model + # parameters are updated less frequently, but with lower variance. + batch_size: nil, + # Scaling factor for the learning rate. A smaller learning rate may be useful to + # avoid overfitting. + learning_rate_multiplier: nil, + # The number of epochs to train the model for. An epoch refers to one full cycle + # through the training dataset. + n_epochs: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi index ea515e0f..bae007c6 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi @@ -52,16 +52,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The object identifier. id:, + # The Unix timestamp (in seconds) for when the fine-tuning job was created. created_at:, + # The log level of the event. level:, + # The message of the event. message:, + # The data associated with the event. data: nil, + # The type of event. type: nil, + # The object type, which is always "fine_tuning.job.event". object: :"fine_tuning.job.event" - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi index ba0eda55..f177e1fc 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi @@ -36,8 +36,21 @@ module OpenAI params(project: String, entity: T.nilable(String), name: T.nilable(String), tags: T::Array[String]) .returns(T.attached_class) end - def self.new(project:, entity: nil, name: nil, tags: nil); end - + def self.new( + # The name of the project that the new run will be created under. + project:, + # The entity to use for the run. This allows you to set the team or username of + # the WandB user that you would like associated with the run. If not set, the + # default entity for the registered WandB API key is used. + entity: nil, + # A display name to set for the run. If not set, we will use the Job ID as the + # name. + name: nil, + # A list of tags to be attached to the newly created run. These tags are passed + # through directly to WandB. Some default tags are generated by OpenAI: + # "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". + tags: nil + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi index 5c771091..2b2e10d9 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi @@ -28,8 +28,15 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(wandb:, type: :wandb); end - + def self.new( + # The settings for your integration with Weights and Biases. This payload + # specifies the project that metrics will be sent to. Optionally, you can set an + # explicit display name for your run, add tags to your run, and set a default + # entity (team, username, etc) to be associated with your run. + wandb:, + # The type of the integration being enabled for the fine-tuning job + type: :wandb + ); end sig { override.returns({type: Symbol, wandb: OpenAI::Models::FineTuning::FineTuningJobWandbIntegration}) } def to_hash; end end diff --git a/rbi/lib/openai/models/fine_tuning/job_create_params.rbi b/rbi/lib/openai/models/fine_tuning/job_create_params.rbi index 13b9cfae..af70cdc3 100644 --- a/rbi/lib/openai/models/fine_tuning/job_create_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/job_create_params.rbi @@ -114,14 +114,63 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The name of the model to fine-tune. You can select one of the + # [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). model:, + # The ID of an uploaded file that contains training data. + # + # See [upload file](https://platform.openai.com/docs/api-reference/files/create) + # for how to upload a file. + # + # Your dataset must be formatted as a JSONL file. Additionally, you must upload + # your file with the purpose `fine-tune`. + # + # The contents of the file should differ depending on if the model uses the + # [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), + # [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) + # format, or if the fine-tuning method uses the + # [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) + # format. + # + # See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) + # for more details. training_file:, + # The hyperparameters used for the fine-tuning job. This value is now deprecated + # in favor of `method`, and should be passed in under the `method` parameter. hyperparameters: nil, + # A list of integrations to enable for your fine-tuning job. integrations: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # The method used for fine-tuning. method_: nil, + # The seed controls the reproducibility of the job. Passing in the same seed and + # job parameters should produce the same results, but may differ in rare cases. If + # a seed is not specified, one will be generated for you. seed: nil, + # A string of up to 64 characters that will be added to your fine-tuned model + # name. + # + # For example, a `suffix` of "custom-model-name" would produce a model name like + # `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. suffix: nil, + # The ID of an uploaded file that contains validation data. + # + # If you provide this file, the data is used to generate validation metrics + # periodically during fine-tuning. These metrics can be viewed in the fine-tuning + # results file. The same data should not be present in both train and validation + # files. + # + # Your dataset must be formatted as a JSONL file. You must upload your file with + # the purpose `fine-tune`. + # + # See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) + # for more details. validation_file: nil, request_options: {} ); end @@ -196,8 +245,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil); end - + def self.new( + # Number of examples in each batch. A larger batch size means that model + # parameters are updated less frequently, but with lower variance. + batch_size: nil, + # Scaling factor for the learning rate. A smaller learning rate may be useful to + # avoid overfitting. + learning_rate_multiplier: nil, + # The number of epochs to train the model for. An epoch refers to one full cycle + # through the training dataset. + n_epochs: nil + ); end sig do override .returns( @@ -266,8 +324,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(wandb:, type: :wandb); end - + def self.new( + # The settings for your integration with Weights and Biases. This payload + # specifies the project that metrics will be sent to. Optionally, you can set an + # explicit display name for your run, add tags to your run, and set a default + # entity (team, username, etc) to be associated with your run. + wandb:, + # The type of integration to enable. Currently, only "wandb" (Weights and Biases) + # is supported. + type: :wandb + ); end sig { override.returns({type: Symbol, wandb: OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb}) } def to_hash; end @@ -309,8 +375,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(project:, entity: nil, name: nil, tags: nil); end - + def self.new( + # The name of the project that the new run will be created under. + project:, + # The entity to use for the run. This allows you to set the team or username of + # the WandB user that you would like associated with the run. If not set, the + # default entity for the registered WandB API key is used. + entity: nil, + # A display name to set for the run. If not set, we will use the Job ID as the + # name. + name: nil, + # A list of tags to be attached to the newly created run. These tags are passed + # through directly to WandB. Some default tags are generated by OpenAI: + # "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". + tags: nil + ); end sig do override .returns({ @@ -363,8 +442,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(dpo: nil, supervised: nil, type: nil); end - + def self.new( + # Configuration for the DPO fine-tuning method. + dpo: nil, + # Configuration for the supervised fine-tuning method. + supervised: nil, + # The type of method. Is either `supervised` or `dpo`. + type: nil + ); end sig do override .returns( @@ -403,8 +488,10 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(hyperparameters: nil); end - + def self.new( + # The hyperparameters used for the fine-tuning job. + hyperparameters: nil + ); end sig do override .returns({hyperparameters: OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters}) @@ -454,8 +541,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(batch_size: nil, beta: nil, learning_rate_multiplier: nil, n_epochs: nil); end - + def self.new( + # Number of examples in each batch. A larger batch size means that model + # parameters are updated less frequently, but with lower variance. + batch_size: nil, + # The beta value for the DPO method. A higher beta value will increase the weight + # of the penalty between the policy and reference model. + beta: nil, + # Scaling factor for the learning rate. A smaller learning rate may be useful to + # avoid overfitting. + learning_rate_multiplier: nil, + # The number of epochs to train the model for. An epoch refers to one full cycle + # through the training dataset. + n_epochs: nil + ); end sig do override .returns( @@ -533,8 +632,10 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(hyperparameters: nil); end - + def self.new( + # The hyperparameters used for the fine-tuning job. + hyperparameters: nil + ); end sig do override .returns( @@ -577,8 +678,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(batch_size: nil, learning_rate_multiplier: nil, n_epochs: nil); end - + def self.new( + # Number of examples in each batch. A larger batch size means that model + # parameters are updated less frequently, but with lower variance. + batch_size: nil, + # Scaling factor for the learning rate. A smaller learning rate may be useful to + # avoid overfitting. + learning_rate_multiplier: nil, + # The number of epochs to train the model for. An epoch refers to one full cycle + # through the training dataset. + n_epochs: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi b/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi index 4c6e5963..9bfe0d0a 100644 --- a/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi @@ -29,8 +29,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, request_options: {}); end - + def self.new( + # Identifier for the last event from the previous pagination request. + after: nil, + # Number of events to retrieve. + limit: nil, + request_options: {} + ); end sig { override.returns({after: String, limit: Integer, request_options: OpenAI::RequestOptions}) } def to_hash; end end diff --git a/rbi/lib/openai/models/fine_tuning/job_list_params.rbi b/rbi/lib/openai/models/fine_tuning/job_list_params.rbi index 49bc0f41..21062f5c 100644 --- a/rbi/lib/openai/models/fine_tuning/job_list_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/job_list_params.rbi @@ -35,8 +35,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, metadata: nil, request_options: {}); end - + def self.new( + # Identifier for the last job from the previous pagination request. + after: nil, + # Number of fine-tuning jobs to retrieve. + limit: nil, + # Optional metadata filter. To filter, use the syntax `metadata[k]=v`. + # Alternatively, set `metadata=null` to indicate no metadata. + metadata: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi b/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi index fee17bda..27afbe12 100644 --- a/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi @@ -30,8 +30,13 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, limit: nil, request_options: {}); end - + def self.new( + # Identifier for the last checkpoint ID from the previous pagination request. + after: nil, + # Number of checkpoints to retrieve. + limit: nil, + request_options: {} + ); end sig { override.returns({after: String, limit: Integer, request_options: OpenAI::RequestOptions}) } def to_hash; end end diff --git a/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi b/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi index 7c253eca..527bf6e5 100644 --- a/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi +++ b/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi @@ -56,12 +56,19 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The checkpoint identifier, which can be referenced in the API endpoints. id:, + # The Unix timestamp (in seconds) for when the checkpoint was created. created_at:, + # The name of the fine-tuned checkpoint model that is created. fine_tuned_model_checkpoint:, + # The name of the fine-tuning job that this checkpoint was created from. fine_tuning_job_id:, + # Metrics at the step number during the fine-tuning job. metrics:, + # The step number that the checkpoint was created at. step_number:, + # The object type, which is always "fine_tuning.job.checkpoint". object: :"fine_tuning.job.checkpoint" ); end sig do diff --git a/rbi/lib/openai/models/function_definition.rbi b/rbi/lib/openai/models/function_definition.rbi index 0351f239..bed3cc2c 100644 --- a/rbi/lib/openai/models/function_definition.rbi +++ b/rbi/lib/openai/models/function_definition.rbi @@ -46,8 +46,28 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(name:, description: nil, parameters: nil, strict: nil); end - + def self.new( + # The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + # underscores and dashes, with a maximum length of 64. + name:, + # A description of what the function does, used by the model to choose when and + # how to call the function. + description: nil, + # The parameters the functions accepts, described as a JSON Schema object. See the + # [guide](https://platform.openai.com/docs/guides/function-calling) for examples, + # and the + # [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + # documentation about the format. + # + # Omitting `parameters` defines a function with an empty parameter list. + parameters: nil, + # Whether to enable strict schema adherence when generating the function call. If + # set to true, the model will follow the exact schema defined in the `parameters` + # field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn + # more about Structured Outputs in the + # [function calling guide](docs/guides/function-calling). + strict: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/image.rbi b/rbi/lib/openai/models/image.rbi index cf15fc93..fa3f7278 100644 --- a/rbi/lib/openai/models/image.rbi +++ b/rbi/lib/openai/models/image.rbi @@ -30,8 +30,18 @@ module OpenAI # Represents the content or the URL of an image generated by the OpenAI API. sig { params(b64_json: String, revised_prompt: String, url: String).returns(T.attached_class) } - def self.new(b64_json: nil, revised_prompt: nil, url: nil); end - + def self.new( + # The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, + # and only present if `response_format` is set to `b64_json` for `dall-e-2` and + # `dall-e-3`. + b64_json: nil, + # For `dall-e-3` only, the revised prompt that was used to generate the image. + revised_prompt: nil, + # When using `dall-e-2` or `dall-e-3`, the URL of the generated image if + # `response_format` is set to `url` (default value). Unsupported for + # `gpt-image-1`. + url: nil + ); end sig { override.returns({b64_json: String, revised_prompt: String, url: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/image_create_variation_params.rbi b/rbi/lib/openai/models/image_create_variation_params.rbi index c2d38787..96899fe5 100644 --- a/rbi/lib/openai/models/image_create_variation_params.rbi +++ b/rbi/lib/openai/models/image_create_variation_params.rbi @@ -53,16 +53,27 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The image to use as the basis for the variation(s). Must be a valid PNG file, + # less than 4MB, and square. image:, + # The model to use for image generation. Only `dall-e-2` is supported at this + # time. model: nil, + # The number of images to generate. Must be between 1 and 10. n: nil, + # The format in which the generated images are returned. Must be one of `url` or + # `b64_json`. URLs are only valid for 60 minutes after the image has been + # generated. response_format: nil, + # The size of the generated images. Must be one of `256x256`, `512x512`, or + # `1024x1024`. size: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). user: nil, request_options: {} - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/image_edit_params.rbi b/rbi/lib/openai/models/image_edit_params.rbi index 922d5db6..68d09cd7 100644 --- a/rbi/lib/openai/models/image_edit_params.rbi +++ b/rbi/lib/openai/models/image_edit_params.rbi @@ -82,14 +82,41 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The image(s) to edit. Must be a supported image file or an array of images. For + # `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square + # `png` file less than 4MB. image:, + # A text description of the desired image(s). The maximum length is 1000 + # characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. prompt:, + # An additional image whose fully transparent areas (e.g. where alpha is zero) + # indicate where `image` should be edited. If there are multiple images provided, + # the mask will be applied on the first image. Must be a valid PNG file, less than + # 4MB, and have the same dimensions as `image`. mask: nil, + # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are + # supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` + # is used. model: nil, + # The number of images to generate. Must be between 1 and 10. n: nil, + # The quality of the image that will be generated. `high`, `medium` and `low` are + # only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. + # Defaults to `auto`. quality: nil, + # The format in which the generated images are returned. Must be one of `url` or + # `b64_json`. URLs are only valid for 60 minutes after the image has been + # generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` + # will always return base64-encoded images. response_format: nil, + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. size: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). user: nil, request_options: {} ); end diff --git a/rbi/lib/openai/models/image_generate_params.rbi b/rbi/lib/openai/models/image_generate_params.rbi index 0ee05de0..3dd3c2e4 100644 --- a/rbi/lib/openai/models/image_generate_params.rbi +++ b/rbi/lib/openai/models/image_generate_params.rbi @@ -108,17 +108,61 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A text description of the desired image(s). The maximum length is 32000 + # characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters + # for `dall-e-3`. prompt:, + # Allows to set transparency for the background of the generated image(s). This + # parameter is only supported for `gpt-image-1`. Must be one of `transparent`, + # `opaque` or `auto` (default value). When `auto` is used, the model will + # automatically determine the best background for the image. + # + # If `transparent`, the output format needs to support transparency, so it should + # be set to either `png` (default value) or `webp`. background: nil, + # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or + # `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to + # `gpt-image-1` is used. model: nil, + # Control the content-moderation level for images generated by `gpt-image-1`. Must + # be either `low` for less restrictive filtering or `auto` (default value). moderation: nil, + # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only + # `n=1` is supported. n: nil, + # The compression level (0-100%) for the generated images. This parameter is only + # supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + # defaults to 100. output_compression: nil, + # The format in which the generated images are returned. This parameter is only + # supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. output_format: nil, + # The quality of the image that will be generated. + # + # - `auto` (default value) will automatically select the best quality for the + # given model. + # - `high`, `medium` and `low` are supported for `gpt-image-1`. + # - `hd` and `standard` are supported for `dall-e-3`. + # - `standard` is the only option for `dall-e-2`. quality: nil, + # The format in which generated images with `dall-e-2` and `dall-e-3` are + # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes + # after the image has been generated. This parameter isn't supported for + # `gpt-image-1` which will always return base64-encoded images. response_format: nil, + # The size of the generated images. Must be one of `1024x1024`, `1536x1024` + # (landscape), `1024x1536` (portrait), or `auto` (default value) for + # `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and + # one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. size: nil, + # The style of the generated images. This parameter is only supported for + # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean + # towards generating hyper-real and dramatic images. Natural causes the model to + # produce more natural, less hyper-real looking images. style: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). user: nil, request_options: {} ); end diff --git a/rbi/lib/openai/models/images_response.rbi b/rbi/lib/openai/models/images_response.rbi index be9cfe0e..cdfcd65f 100644 --- a/rbi/lib/openai/models/images_response.rbi +++ b/rbi/lib/openai/models/images_response.rbi @@ -30,8 +30,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(created:, data: nil, usage: nil); end - + def self.new( + # The Unix timestamp (in seconds) of when the image was created. + created:, + # The list of generated images. + data: nil, + # For `gpt-image-1` only, the token usage information for the image generation. + usage: nil + ); end sig do override .returns( @@ -75,8 +81,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input_tokens:, input_tokens_details:, output_tokens:, total_tokens:); end - + def self.new( + # The number of tokens (images and text) in the input prompt. + input_tokens:, + # The input tokens detailed information for the image generation. + input_tokens_details:, + # The number of image tokens in the output image. + output_tokens:, + # The total number of tokens (images and text) used for the image generation. + total_tokens: + ); end sig do override .returns( @@ -101,8 +115,12 @@ module OpenAI # The input tokens detailed information for the image generation. sig { params(image_tokens: Integer, text_tokens: Integer).returns(T.attached_class) } - def self.new(image_tokens:, text_tokens:); end - + def self.new( + # The number of image tokens in the input prompt. + image_tokens:, + # The number of text tokens in the input prompt. + text_tokens: + ); end sig { override.returns({image_tokens: Integer, text_tokens: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/model.rbi b/rbi/lib/openai/models/model.rbi index b7dfa10a..06ccb9b5 100644 --- a/rbi/lib/openai/models/model.rbi +++ b/rbi/lib/openai/models/model.rbi @@ -21,8 +21,16 @@ module OpenAI # Describes an OpenAI model offering that can be used with the API. sig { params(id: String, created: Integer, owned_by: String, object: Symbol).returns(T.attached_class) } - def self.new(id:, created:, owned_by:, object: :model); end - + def self.new( + # The model identifier, which can be referenced in the API endpoints. + id:, + # The Unix timestamp (in seconds) when the model was created. + created:, + # The organization that owns the model. + owned_by:, + # The object type, which is always "model". + object: :model + ); end sig { override.returns({id: String, created: Integer, object: Symbol, owned_by: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/moderation.rbi b/rbi/lib/openai/models/moderation.rbi index 7c63a9f8..8f8c32af 100644 --- a/rbi/lib/openai/models/moderation.rbi +++ b/rbi/lib/openai/models/moderation.rbi @@ -42,8 +42,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(categories:, category_applied_input_types:, category_scores:, flagged:); end - + def self.new( + # A list of the categories, and whether they are flagged or not. + categories:, + # A list of the categories along with the input type(s) that the score applies to. + category_applied_input_types:, + # A list of the categories along with their scores as predicted by model. + category_scores:, + # Whether any of the below categories are flagged. + flagged: + ); end sig do override .returns( @@ -147,18 +155,48 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Content that expresses, incites, or promotes harassing language towards any + # target. harassment:, + # Harassment content that also includes violence or serious harm towards any + # target. harassment_threatening:, + # Content that expresses, incites, or promotes hate based on race, gender, + # ethnicity, religion, nationality, sexual orientation, disability status, or + # caste. Hateful content aimed at non-protected groups (e.g., chess players) is + # harassment. hate:, + # Hateful content that also includes violence or serious harm towards the targeted + # group based on race, gender, ethnicity, religion, nationality, sexual + # orientation, disability status, or caste. hate_threatening:, + # Content that includes instructions or advice that facilitate the planning or + # execution of wrongdoing, or that gives advice or instruction on how to commit + # illicit acts. For example, "how to shoplift" would fit this category. illicit:, + # Content that includes instructions or advice that facilitate the planning or + # execution of wrongdoing that also includes violence, or that gives advice or + # instruction on the procurement of any weapon. illicit_violent:, + # Content that promotes, encourages, or depicts acts of self-harm, such as + # suicide, cutting, and eating disorders. self_harm:, + # Content that encourages performing acts of self-harm, such as suicide, cutting, + # and eating disorders, or that gives instructions or advice on how to commit such + # acts. self_harm_instructions:, + # Content where the speaker expresses that they are engaging or intend to engage + # in acts of self-harm, such as suicide, cutting, and eating disorders. self_harm_intent:, + # Content meant to arouse sexual excitement, such as the description of sexual + # activity, or that promotes sexual services (excluding sex education and + # wellness). sexual:, + # Sexual content that includes an individual who is under 18 years old. sexual_minors:, + # Content that depicts death, violence, or physical injury. violence:, + # Content that depicts death, violence, or physical injury in graphic detail. violence_graphic: ); end sig do @@ -265,18 +303,31 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The applied input type(s) for the category 'harassment'. harassment:, + # The applied input type(s) for the category 'harassment/threatening'. harassment_threatening:, + # The applied input type(s) for the category 'hate'. hate:, + # The applied input type(s) for the category 'hate/threatening'. hate_threatening:, + # The applied input type(s) for the category 'illicit'. illicit:, + # The applied input type(s) for the category 'illicit/violent'. illicit_violent:, + # The applied input type(s) for the category 'self-harm'. self_harm:, + # The applied input type(s) for the category 'self-harm/instructions'. self_harm_instructions:, + # The applied input type(s) for the category 'self-harm/intent'. self_harm_intent:, + # The applied input type(s) for the category 'sexual'. sexual:, + # The applied input type(s) for the category 'sexual/minors'. sexual_minors:, + # The applied input type(s) for the category 'violence'. violence:, + # The applied input type(s) for the category 'violence/graphic'. violence_graphic: ); end sig do @@ -582,18 +633,31 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The score for the category 'harassment'. harassment:, + # The score for the category 'harassment/threatening'. harassment_threatening:, + # The score for the category 'hate'. hate:, + # The score for the category 'hate/threatening'. hate_threatening:, + # The score for the category 'illicit'. illicit:, + # The score for the category 'illicit/violent'. illicit_violent:, + # The score for the category 'self-harm'. self_harm:, + # The score for the category 'self-harm/instructions'. self_harm_instructions:, + # The score for the category 'self-harm/intent'. self_harm_intent:, + # The score for the category 'sexual'. sexual:, + # The score for the category 'sexual/minors'. sexual_minors:, + # The score for the category 'violence'. violence:, + # The score for the category 'violence/graphic'. violence_graphic: ); end sig do diff --git a/rbi/lib/openai/models/moderation_create_params.rbi b/rbi/lib/openai/models/moderation_create_params.rbi index 707f700c..527e104f 100644 --- a/rbi/lib/openai/models/moderation_create_params.rbi +++ b/rbi/lib/openai/models/moderation_create_params.rbi @@ -47,8 +47,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(input:, model: nil, request_options: {}); end - + def self.new( + # Input (or inputs) to classify. Can be a single string, an array of strings, or + # an array of multi-modal input objects similar to other models. + input:, + # The content moderation model you would like to use. Learn more in + # [the moderation guide](https://platform.openai.com/docs/guides/moderation), and + # learn about available models + # [here](https://platform.openai.com/docs/models#moderation). + model: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/moderation_create_response.rbi b/rbi/lib/openai/models/moderation_create_response.rbi index 34f57350..7e78a995 100644 --- a/rbi/lib/openai/models/moderation_create_response.rbi +++ b/rbi/lib/openai/models/moderation_create_response.rbi @@ -24,8 +24,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, model:, results:); end - + def self.new( + # The unique identifier for the moderation request. + id:, + # The model used to generate the moderation results. + model:, + # A list of moderation objects. + results: + ); end sig { override.returns({id: String, model: String, results: T::Array[OpenAI::Models::Moderation]}) } def to_hash; end end diff --git a/rbi/lib/openai/models/moderation_image_url_input.rbi b/rbi/lib/openai/models/moderation_image_url_input.rbi index fd241d15..091d5263 100644 --- a/rbi/lib/openai/models/moderation_image_url_input.rbi +++ b/rbi/lib/openai/models/moderation_image_url_input.rbi @@ -24,8 +24,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(image_url:, type: :image_url); end - + def self.new( + # Contains either an image URL or a data URL for a base64 encoded image. + image_url:, + # Always `image_url`. + type: :image_url + ); end sig { override.returns({image_url: OpenAI::Models::ModerationImageURLInput::ImageURL, type: Symbol}) } def to_hash; end @@ -36,8 +40,10 @@ module OpenAI # Contains either an image URL or a data URL for a base64 encoded image. sig { params(url: String).returns(T.attached_class) } - def self.new(url:); end - + def self.new( + # Either a URL of the image or the base64 encoded image data. + url: + ); end sig { override.returns({url: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/moderation_text_input.rbi b/rbi/lib/openai/models/moderation_text_input.rbi index cdb7c967..462e88ed 100644 --- a/rbi/lib/openai/models/moderation_text_input.rbi +++ b/rbi/lib/openai/models/moderation_text_input.rbi @@ -13,8 +13,12 @@ module OpenAI # An object describing text to classify. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :text); end - + def self.new( + # A string of text to classify. + text:, + # Always `text`. + type: :text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi b/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi index 0d6d06b0..5af14eda 100644 --- a/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi +++ b/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi @@ -11,8 +11,10 @@ module OpenAI # because the file was indexed before the `chunking_strategy` concept was # introduced in the API. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :other); end - + def self.new( + # Always `other`. + type: :other + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/reasoning.rbi b/rbi/lib/openai/models/reasoning.rbi index 1223bf2d..a54b00f4 100644 --- a/rbi/lib/openai/models/reasoning.rbi +++ b/rbi/lib/openai/models/reasoning.rbi @@ -38,8 +38,25 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(effort: nil, generate_summary: nil, summary: nil); end - + def self.new( + # **o-series models only** + # + # Constrains effort on reasoning for + # [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently + # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can + # result in faster responses and fewer tokens used on reasoning in a response. + effort: nil, + # **Deprecated:** use `summary` instead. + # + # A summary of the reasoning performed by the model. This can be useful for + # debugging and understanding the model's reasoning process. One of `auto`, + # `concise`, or `detailed`. + generate_summary: nil, + # A summary of the reasoning performed by the model. This can be useful for + # debugging and understanding the model's reasoning process. One of `auto`, + # `concise`, or `detailed`. + summary: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/response_format_json_object.rbi b/rbi/lib/openai/models/response_format_json_object.rbi index caf63a9c..cb28d04a 100644 --- a/rbi/lib/openai/models/response_format_json_object.rbi +++ b/rbi/lib/openai/models/response_format_json_object.rbi @@ -11,8 +11,10 @@ module OpenAI # `json_schema` is recommended for models that support it. Note that the model # will not generate JSON without a system or user message instructing it to do so. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :json_object); end - + def self.new( + # The type of response format being defined. Always `json_object`. + type: :json_object + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/response_format_json_schema.rbi b/rbi/lib/openai/models/response_format_json_schema.rbi index 26bae2de..db50b7cd 100644 --- a/rbi/lib/openai/models/response_format_json_schema.rbi +++ b/rbi/lib/openai/models/response_format_json_schema.rbi @@ -29,8 +29,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(json_schema:, type: :json_schema); end - + def self.new( + # Structured Outputs configuration options, including a JSON Schema. + json_schema:, + # The type of response format being defined. Always `json_schema`. + type: :json_schema + ); end sig { override.returns({json_schema: OpenAI::Models::ResponseFormatJSONSchema::JSONSchema, type: Symbol}) } def to_hash; end @@ -74,8 +78,23 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(name:, description: nil, schema: nil, strict: nil); end - + def self.new( + # The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores + # and dashes, with a maximum length of 64. + name:, + # A description of what the response format is for, used by the model to determine + # how to respond in the format. + description: nil, + # The schema for the response format, described as a JSON Schema object. Learn how + # to build JSON schemas [here](https://json-schema.org/). + schema: nil, + # Whether to enable strict schema adherence when generating the output. If set to + # true, the model will always follow the exact schema defined in the `schema` + # field. Only a subset of JSON Schema is supported when `strict` is `true`. To + # learn more, read the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + strict: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/response_format_text.rbi b/rbi/lib/openai/models/response_format_text.rbi index ec7b0d03..f47d8756 100644 --- a/rbi/lib/openai/models/response_format_text.rbi +++ b/rbi/lib/openai/models/response_format_text.rbi @@ -9,8 +9,10 @@ module OpenAI # Default response format. Used to generate text responses. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :text); end - + def self.new( + # The type of response format being defined. Always `text`. + type: :text + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/computer_tool.rbi b/rbi/lib/openai/models/responses/computer_tool.rbi index 50bedd4b..0223a583 100644 --- a/rbi/lib/openai/models/responses/computer_tool.rbi +++ b/rbi/lib/openai/models/responses/computer_tool.rbi @@ -31,8 +31,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(display_height:, display_width:, environment:, type: :computer_use_preview); end - + def self.new( + # The height of the computer display. + display_height:, + # The width of the computer display. + display_width:, + # The type of computer environment to control. + environment:, + # The type of the computer use tool. Always `computer_use_preview`. + type: :computer_use_preview + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/easy_input_message.rbi b/rbi/lib/openai/models/responses/easy_input_message.rbi index 8efd6fd4..698ad76f 100644 --- a/rbi/lib/openai/models/responses/easy_input_message.rbi +++ b/rbi/lib/openai/models/responses/easy_input_message.rbi @@ -57,8 +57,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, type: nil); end - + def self.new( + # Text, image, or audio input to the model, used to generate a response. Can also + # contain previous assistant responses. + content:, + # The role of the message input. One of `user`, `assistant`, `system`, or + # `developer`. + role:, + # The type of the message input. Always `message`. + type: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/file_search_tool.rbi b/rbi/lib/openai/models/responses/file_search_tool.rbi index 6d579cea..12834382 100644 --- a/rbi/lib/openai/models/responses/file_search_tool.rbi +++ b/rbi/lib/openai/models/responses/file_search_tool.rbi @@ -58,14 +58,18 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The IDs of the vector stores to search. vector_store_ids:, + # A filter to apply based on file attributes. filters: nil, + # The maximum number of results to return. This number should be between 1 and 50 + # inclusive. max_num_results: nil, + # Ranking options for search. ranking_options: nil, + # The type of the file search tool. Always `file_search`. type: :file_search - ) - end - + ); end sig do override .returns( @@ -113,8 +117,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(ranker: nil, score_threshold: nil); end - + def self.new( + # The ranker to use for the file search. + ranker: nil, + # The score threshold for the file search, a number between 0 and 1. Numbers + # closer to 1 will attempt to return only the most relevant results, but may + # return fewer results. + score_threshold: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/function_tool.rbi b/rbi/lib/openai/models/responses/function_tool.rbi index 5d1008c2..5fa541bd 100644 --- a/rbi/lib/openai/models/responses/function_tool.rbi +++ b/rbi/lib/openai/models/responses/function_tool.rbi @@ -38,8 +38,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(name:, parameters:, strict:, description: nil, type: :function); end - + def self.new( + # The name of the function to call. + name:, + # A JSON schema object describing the parameters of the function. + parameters:, + # Whether to enforce strict parameter validation. Default `true`. + strict:, + # A description of the function. Used by the model to determine whether or not to + # call the function. + description: nil, + # The type of the function tool. Always `function`. + type: :function + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/input_item_list_params.rbi b/rbi/lib/openai/models/responses/input_item_list_params.rbi index 9699e037..3ea133cb 100644 --- a/rbi/lib/openai/models/responses/input_item_list_params.rbi +++ b/rbi/lib/openai/models/responses/input_item_list_params.rbi @@ -58,8 +58,24 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}); end - + def self.new( + # An item ID to list items after, used in pagination. + after: nil, + # An item ID to list items before, used in pagination. + before: nil, + # Additional fields to include in the response. See the `include` parameter for + # Response creation above for more information. + include: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. + limit: nil, + # The order to return the input items in. Default is `asc`. + # + # - `asc`: Return the input items in ascending order. + # - `desc`: Return the input items in descending order. + order: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response.rbi b/rbi/lib/openai/models/responses/response.rbi index 5e5dacba..189001b8 100644 --- a/rbi/lib/openai/models/responses/response.rbi +++ b/rbi/lib/openai/models/responses/response.rbi @@ -297,28 +297,130 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Unique identifier for this Response. id:, + # Unix timestamp (in seconds) of when this Response was created. created_at:, + # An error object returned when the model fails to generate a Response. error:, + # Details about why the response is incomplete. incomplete_details:, + # Inserts a system (or developer) message as the first item in the model's + # context. + # + # When using along with `previous_response_id`, the instructions from a previous + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. instructions:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a + # wide range of models with different capabilities, performance characteristics, + # and price points. Refer to the + # [model guide](https://platform.openai.com/docs/models) to browse and compare + # available models. model:, + # An array of content items generated by the model. + # + # - The length and order of items in the `output` array is dependent on the + # model's response. + # - Rather than accessing the first item in the `output` array and assuming it's + # an `assistant` message with the content generated by the model, you might + # consider using the `output_text` property where supported in SDKs. output:, + # Whether to allow the model to run tool calls in parallel. parallel_tool_calls:, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. We generally recommend altering this or `top_p` but + # not both. temperature:, + # How the model should select which tool (or tools) to use when generating a + # response. See the `tools` parameter to see how to specify which tools the model + # can call. tool_choice:, + # An array of tools the model may call while generating a response. You can + # specify which tool to use by setting the `tool_choice` parameter. + # + # The two categories of tools you can provide the model are: + # + # - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + # capabilities, like + # [web search](https://platform.openai.com/docs/guides/tools-web-search) or + # [file search](https://platform.openai.com/docs/guides/tools-file-search). + # Learn more about + # [built-in tools](https://platform.openai.com/docs/guides/tools). + # - **Function calls (custom tools)**: Functions that are defined by you, enabling + # the model to call your own code. Learn more about + # [function calling](https://platform.openai.com/docs/guides/function-calling). tools:, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or `temperature` but not both. top_p:, + # An upper bound for the number of tokens that can be generated for a response, + # including visible output tokens and + # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). max_output_tokens: nil, + # The unique ID of the previous response to the model. Use this to create + # multi-turn conversations. Learn more about + # [conversation state](https://platform.openai.com/docs/guides/conversation-state). previous_response_id: nil, + # **o-series models only** + # + # Configuration options for + # [reasoning models](https://platform.openai.com/docs/guides/reasoning). reasoning: nil, + # Specifies the latency tier to use for processing the request. This parameter is + # relevant for customers subscribed to the scale tier service: + # + # - If set to 'auto', and the Project is Scale tier enabled, the system will + # utilize scale tier credits until they are exhausted. + # - If set to 'auto', and the Project is not Scale tier enabled, the request will + # be processed using the default service tier with a lower uptime SLA and no + # latency guarentee. + # - If set to 'default', the request will be processed using the default service + # tier with a lower uptime SLA and no latency guarentee. + # - If set to 'flex', the request will be processed with the Flex Processing + # service tier. + # [Learn more](https://platform.openai.com/docs/guides/flex-processing). + # - When not set, the default behavior is 'auto'. + # + # When this parameter is set, the response body will include the `service_tier` + # utilized. service_tier: nil, + # The status of the response generation. One of `completed`, `failed`, + # `in_progress`, or `incomplete`. status: nil, + # Configuration options for a text response from the model. Can be plain text or + # structured JSON data. Learn more: + # + # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + # - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) text: nil, + # The truncation strategy to use for the model response. + # + # - `auto`: If the context of this response and previous ones exceeds the model's + # context window size, the model will truncate the response to fit the context + # window by dropping input items in the middle of the conversation. + # - `disabled` (default): If a model response will exceed the context window size + # for a model, the request will fail with a 400 error. truncation: nil, + # Represents token usage details including input tokens, output tokens, a + # breakdown of output tokens, and the total tokens used. usage: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). user: nil, + # The object type of this resource - always set to `response`. object: :response ); end sig do @@ -390,8 +492,10 @@ module OpenAI params(reason: OpenAI::Models::Responses::Response::IncompleteDetails::Reason::OrSymbol) .returns(T.attached_class) end - def self.new(reason: nil); end - + def self.new( + # The reason why the response is incomplete. + reason: nil + ); end sig { override.returns({reason: OpenAI::Models::Responses::Response::IncompleteDetails::Reason::TaggedSymbol}) } def to_hash; end diff --git a/rbi/lib/openai/models/responses/response_audio_delta_event.rbi b/rbi/lib/openai/models/responses/response_audio_delta_event.rbi index 386c8365..b2e4f0e0 100644 --- a/rbi/lib/openai/models/responses/response_audio_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_delta_event.rbi @@ -14,8 +14,12 @@ module OpenAI # Emitted when there is a partial audio response. sig { params(delta: String, type: Symbol).returns(T.attached_class) } - def self.new(delta:, type: :"response.audio.delta"); end - + def self.new( + # A chunk of Base64 encoded response audio bytes. + delta:, + # The type of the event. Always `response.audio.delta`. + type: :"response.audio.delta" + ); end sig { override.returns({delta: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_audio_done_event.rbi b/rbi/lib/openai/models/responses/response_audio_done_event.rbi index 40f5901f..9df7735c 100644 --- a/rbi/lib/openai/models/responses/response_audio_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_done_event.rbi @@ -10,8 +10,10 @@ module OpenAI # Emitted when the audio response is complete. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :"response.audio.done"); end - + def self.new( + # The type of the event. Always `response.audio.done`. + type: :"response.audio.done" + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi b/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi index c121b3b9..7ea46461 100644 --- a/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi @@ -14,8 +14,12 @@ module OpenAI # Emitted when there is a partial transcript of audio. sig { params(delta: String, type: Symbol).returns(T.attached_class) } - def self.new(delta:, type: :"response.audio.transcript.delta"); end - + def self.new( + # The partial transcript of the audio response. + delta:, + # The type of the event. Always `response.audio.transcript.delta`. + type: :"response.audio.transcript.delta" + ); end sig { override.returns({delta: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi b/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi index 983f0e0a..ec7e9f09 100644 --- a/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi @@ -10,8 +10,10 @@ module OpenAI # Emitted when the full audio transcript is completed. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :"response.audio.transcript.done"); end - + def self.new( + # The type of the event. Always `response.audio.transcript.done`. + type: :"response.audio.transcript.done" + ); end sig { override.returns({type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi index e19943db..4c36e297 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when a partial code snippet is added by the code interpreter. sig { params(delta: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(delta:, output_index:, type: :"response.code_interpreter_call.code.delta"); end - + def self.new( + # The partial code snippet added by the code interpreter. + delta:, + # The index of the output item that the code interpreter call is in progress. + output_index:, + # The type of the event. Always `response.code_interpreter_call.code.delta`. + type: :"response.code_interpreter_call.code.delta" + ); end sig { override.returns({delta: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi index 5d6af463..bc7dd462 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when code snippet output is finalized by the code interpreter. sig { params(code: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(code:, output_index:, type: :"response.code_interpreter_call.code.done"); end - + def self.new( + # The final code snippet output by the code interpreter. + code:, + # The index of the output item that the code interpreter call is in progress. + output_index:, + # The type of the event. Always `response.code_interpreter_call.code.done`. + type: :"response.code_interpreter_call.code.done" + ); end sig { override.returns({code: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi index 28acb52b..05dc4800 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi @@ -34,12 +34,13 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A tool call to run code. code_interpreter_call:, + # The index of the output item that the code interpreter call is in progress. output_index:, + # The type of the event. Always `response.code_interpreter_call.completed`. type: :"response.code_interpreter_call.completed" - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi index c0a220d0..2627f40b 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi @@ -34,12 +34,13 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A tool call to run code. code_interpreter_call:, + # The index of the output item that the code interpreter call is in progress. output_index:, + # The type of the event. Always `response.code_interpreter_call.in_progress`. type: :"response.code_interpreter_call.in_progress" - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi index e0fe0abb..ee7e0050 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi @@ -34,12 +34,13 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A tool call to run code. code_interpreter_call:, + # The index of the output item that the code interpreter call is in progress. output_index:, + # The type of the event. Always `response.code_interpreter_call.interpreting`. type: :"response.code_interpreter_call.interpreting" - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi index 9c9e05b1..2568aca1 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi @@ -50,8 +50,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, code:, results:, status:, type: :code_interpreter_call); end - + def self.new( + # The unique ID of the code interpreter tool call. + id:, + # The code to run. + code:, + # The results of the code interpreter tool call. + results:, + # The status of the code interpreter tool call. + status:, + # The type of the code interpreter tool call. Always `code_interpreter_call`. + type: :code_interpreter_call + ); end sig do override .returns( @@ -86,8 +96,12 @@ module OpenAI # The output of a code interpreter tool call that is text. sig { params(logs: String, type: Symbol).returns(T.attached_class) } - def self.new(logs:, type: :logs); end - + def self.new( + # The logs of the code interpreter tool call. + logs:, + # The type of the code interpreter text output. Always `logs`. + type: :logs + ); end sig { override.returns({logs: String, type: Symbol}) } def to_hash; end end @@ -113,8 +127,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(files:, type: :files); end - + def self.new( + files:, + # The type of the code interpreter file output. Always `files`. + type: :files + ); end sig do override .returns( @@ -136,8 +153,12 @@ module OpenAI attr_accessor :mime_type sig { params(file_id: String, mime_type: String).returns(T.attached_class) } - def self.new(file_id:, mime_type:); end - + def self.new( + # The ID of the file. + file_id:, + # The MIME type of the file. + mime_type: + ); end sig { override.returns({file_id: String, mime_type: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_completed_event.rbi b/rbi/lib/openai/models/responses/response_completed_event.rbi index 26105306..bf715172 100644 --- a/rbi/lib/openai/models/responses/response_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_completed_event.rbi @@ -20,8 +20,12 @@ module OpenAI params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(response:, type: :"response.completed"); end - + def self.new( + # Properties of the completed response. + response:, + # The type of the event. Always `response.completed`. + type: :"response.completed" + ); end sig { override.returns({response: OpenAI::Models::Responses::Response, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call.rbi b/rbi/lib/openai/models/responses/response_computer_tool_call.rbi index d899a4bc..37023dcb 100644 --- a/rbi/lib/openai/models/responses/response_computer_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_computer_tool_call.rbi @@ -68,8 +68,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, action:, call_id:, pending_safety_checks:, status:, type:); end - + def self.new( + # The unique ID of the computer call. + id:, + # A click action. + action:, + # An identifier used when responding to the tool call with output. + call_id:, + # The pending safety checks for the computer call. + pending_safety_checks:, + # The status of the item. One of `in_progress`, `completed`, or `incomplete`. + # Populated when items are returned via API. + status:, + # The type of the computer call. Always `computer_call`. + type: + ); end sig do override .returns( @@ -128,8 +141,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(button:, x:, y_:, type: :click); end - + def self.new( + # Indicates which mouse button was pressed during the click. One of `left`, + # `right`, `wheel`, `back`, or `forward`. + button:, + # The x-coordinate where the click occurred. + x:, + # The y-coordinate where the click occurred. + y_:, + # Specifies the event type. For a click action, this property is always set to + # `click`. + type: :click + ); end sig do override .returns( @@ -189,8 +212,15 @@ module OpenAI # A double click action. sig { params(x: Integer, y_: Integer, type: Symbol).returns(T.attached_class) } - def self.new(x:, y_:, type: :double_click); end - + def self.new( + # The x-coordinate where the double click occurred. + x:, + # The y-coordinate where the double click occurred. + y_:, + # Specifies the event type. For a double click action, this property is always set + # to `double_click`. + type: :double_click + ); end sig { override.returns({type: Symbol, x: Integer, y_: Integer}) } def to_hash; end end @@ -221,8 +251,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(path:, type: :drag); end - + def self.new( + # An array of coordinates representing the path of the drag action. Coordinates + # will appear as an array of objects, eg + # + # ``` + # [ + # { x: 100, y: 200 }, + # { x: 200, y: 300 } + # ] + # ``` + path:, + # Specifies the event type. For a drag action, this property is always set to + # `drag`. + type: :drag + ); end sig do override .returns( @@ -242,8 +285,12 @@ module OpenAI # A series of x/y coordinate pairs in the drag path. sig { params(x: Integer, y_: Integer).returns(T.attached_class) } - def self.new(x:, y_:); end - + def self.new( + # The x-coordinate. + x:, + # The y-coordinate. + y_: + ); end sig { override.returns({x: Integer, y_: Integer}) } def to_hash; end end @@ -262,8 +309,14 @@ module OpenAI # A collection of keypresses the model would like to perform. sig { params(keys: T::Array[String], type: Symbol).returns(T.attached_class) } - def self.new(keys:, type: :keypress); end - + def self.new( + # The combination of keys the model is requesting to be pressed. This is an array + # of strings, each representing a key. + keys:, + # Specifies the event type. For a keypress action, this property is always set to + # `keypress`. + type: :keypress + ); end sig { override.returns({keys: T::Array[String], type: Symbol}) } def to_hash; end end @@ -284,8 +337,15 @@ module OpenAI # A mouse move action. sig { params(x: Integer, y_: Integer, type: Symbol).returns(T.attached_class) } - def self.new(x:, y_:, type: :move); end - + def self.new( + # The x-coordinate to move to. + x:, + # The y-coordinate to move to. + y_:, + # Specifies the event type. For a move action, this property is always set to + # `move`. + type: :move + ); end sig { override.returns({type: Symbol, x: Integer, y_: Integer}) } def to_hash; end end @@ -298,8 +358,11 @@ module OpenAI # A screenshot action. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :screenshot); end - + def self.new( + # Specifies the event type. For a screenshot action, this property is always set + # to `screenshot`. + type: :screenshot + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -331,8 +394,19 @@ module OpenAI params(scroll_x: Integer, scroll_y: Integer, x: Integer, y_: Integer, type: Symbol) .returns(T.attached_class) end - def self.new(scroll_x:, scroll_y:, x:, y_:, type: :scroll); end - + def self.new( + # The horizontal scroll distance. + scroll_x:, + # The vertical scroll distance. + scroll_y:, + # The x-coordinate where the scroll occurred. + x:, + # The y-coordinate where the scroll occurred. + y_:, + # Specifies the event type. For a scroll action, this property is always set to + # `scroll`. + type: :scroll + ); end sig do override.returns({scroll_x: Integer, scroll_y: Integer, type: Symbol, x: Integer, y_: Integer}) end @@ -351,8 +425,13 @@ module OpenAI # An action to type in text. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :type); end - + def self.new( + # The text to type. + text:, + # Specifies the event type. For a type action, this property is always set to + # `type`. + type: :type + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end @@ -365,8 +444,11 @@ module OpenAI # A wait action. sig { params(type: Symbol).returns(T.attached_class) } - def self.new(type: :wait); end - + def self.new( + # Specifies the event type. For a wait action, this property is always set to + # `wait`. + type: :wait + ); end sig { override.returns({type: Symbol}) } def to_hash; end end @@ -395,8 +477,14 @@ module OpenAI # A pending safety check for the computer call. sig { params(id: String, code: String, message: String).returns(T.attached_class) } - def self.new(id:, code:, message:); end - + def self.new( + # The ID of the pending safety check. + id:, + # The type of the pending safety check. + code:, + # Details about the pending safety check. + message: + ); end sig { override.returns({id: String, code: String, message: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi b/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi index cbf376cc..c8e4b2bf 100644 --- a/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi +++ b/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi @@ -77,15 +77,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The unique ID of the computer call tool output. id:, + # The ID of the computer tool call that produced the output. call_id:, + # A computer screenshot image used with the computer use tool. output:, + # The safety checks reported by the API that have been acknowledged by the + # developer. acknowledged_safety_checks: nil, + # The status of the message input. One of `in_progress`, `completed`, or + # `incomplete`. Populated when input items are returned via API. status: nil, + # The type of the computer tool call output. Always `computer_call_output`. type: :computer_call_output - ) - end - + ); end sig do override .returns( @@ -116,8 +122,14 @@ module OpenAI # A pending safety check for the computer call. sig { params(id: String, code: String, message: String).returns(T.attached_class) } - def self.new(id:, code:, message:); end - + def self.new( + # The ID of the pending safety check. + id:, + # The type of the pending safety check. + code:, + # Details about the pending safety check. + message: + ); end sig { override.returns({id: String, code: String, message: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi b/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi index c95e0378..b0d1e196 100644 --- a/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi +++ b/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi @@ -25,8 +25,15 @@ module OpenAI # A computer screenshot image used with the computer use tool. sig { params(file_id: String, image_url: String, type: Symbol).returns(T.attached_class) } - def self.new(file_id: nil, image_url: nil, type: :computer_screenshot); end - + def self.new( + # The identifier of an uploaded file that contains the screenshot. + file_id: nil, + # The URL of the screenshot image. + image_url: nil, + # Specifies the event type. For a computer screenshot, this property is always set + # to `computer_screenshot`. + type: :computer_screenshot + ); end sig { override.returns({type: Symbol, file_id: String, image_url: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_content_part_added_event.rbi b/rbi/lib/openai/models/responses/response_content_part_added_event.rbi index 5ec11d97..46fa7693 100644 --- a/rbi/lib/openai/models/responses/response_content_part_added_event.rbi +++ b/rbi/lib/openai/models/responses/response_content_part_added_event.rbi @@ -43,9 +43,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content_index:, item_id:, output_index:, part:, type: :"response.content_part.added") - end - + def self.new( + # The index of the content part that was added. + content_index:, + # The ID of the output item that the content part was added to. + item_id:, + # The index of the output item that the content part was added to. + output_index:, + # The content part that was added. + part:, + # The type of the event. Always `response.content_part.added`. + type: :"response.content_part.added" + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_content_part_done_event.rbi b/rbi/lib/openai/models/responses/response_content_part_done_event.rbi index 35915ce9..c1519e4f 100644 --- a/rbi/lib/openai/models/responses/response_content_part_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_content_part_done_event.rbi @@ -43,8 +43,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content_index:, item_id:, output_index:, part:, type: :"response.content_part.done"); end - + def self.new( + # The index of the content part that is done. + content_index:, + # The ID of the output item that the content part was added to. + item_id:, + # The index of the output item that the content part was added to. + output_index:, + # The content part that is done. + part:, + # The type of the event. Always `response.content_part.done`. + type: :"response.content_part.done" + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_create_params.rbi b/rbi/lib/openai/models/responses/response_create_params.rbi index 64664281..3dd10986 100644 --- a/rbi/lib/openai/models/responses/response_create_params.rbi +++ b/rbi/lib/openai/models/responses/response_create_params.rbi @@ -315,23 +315,127 @@ module OpenAI .returns(T.attached_class) end def self.new( + # Text, image, or file inputs to the model, used to generate a response. + # + # Learn more: + # + # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + # - [Image inputs](https://platform.openai.com/docs/guides/images) + # - [File inputs](https://platform.openai.com/docs/guides/pdf-files) + # - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) + # - [Function calling](https://platform.openai.com/docs/guides/function-calling) input:, + # Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a + # wide range of models with different capabilities, performance characteristics, + # and price points. Refer to the + # [model guide](https://platform.openai.com/docs/models) to browse and compare + # available models. model:, + # Specify additional output data to include in the model response. Currently + # supported values are: + # + # - `file_search_call.results`: Include the search results of the file search tool + # call. + # - `message.input_image.image_url`: Include image urls from the input message. + # - `computer_call_output.output.image_url`: Include image urls from the computer + # call output. include: nil, + # Inserts a system (or developer) message as the first item in the model's + # context. + # + # When using along with `previous_response_id`, the instructions from a previous + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. instructions: nil, + # An upper bound for the number of tokens that can be generated for a response, + # including visible output tokens and + # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). max_output_tokens: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # Whether to allow the model to run tool calls in parallel. parallel_tool_calls: nil, + # The unique ID of the previous response to the model. Use this to create + # multi-turn conversations. Learn more about + # [conversation state](https://platform.openai.com/docs/guides/conversation-state). previous_response_id: nil, + # **o-series models only** + # + # Configuration options for + # [reasoning models](https://platform.openai.com/docs/guides/reasoning). reasoning: nil, + # Specifies the latency tier to use for processing the request. This parameter is + # relevant for customers subscribed to the scale tier service: + # + # - If set to 'auto', and the Project is Scale tier enabled, the system will + # utilize scale tier credits until they are exhausted. + # - If set to 'auto', and the Project is not Scale tier enabled, the request will + # be processed using the default service tier with a lower uptime SLA and no + # latency guarentee. + # - If set to 'default', the request will be processed using the default service + # tier with a lower uptime SLA and no latency guarentee. + # - If set to 'flex', the request will be processed with the Flex Processing + # service tier. + # [Learn more](https://platform.openai.com/docs/guides/flex-processing). + # - When not set, the default behavior is 'auto'. + # + # When this parameter is set, the response body will include the `service_tier` + # utilized. service_tier: nil, + # Whether to store the generated model response for later retrieval via API. store: nil, + # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + # make the output more random, while lower values like 0.2 will make it more + # focused and deterministic. We generally recommend altering this or `top_p` but + # not both. temperature: nil, + # Configuration options for a text response from the model. Can be plain text or + # structured JSON data. Learn more: + # + # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + # - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) text: nil, + # How the model should select which tool (or tools) to use when generating a + # response. See the `tools` parameter to see how to specify which tools the model + # can call. tool_choice: nil, + # An array of tools the model may call while generating a response. You can + # specify which tool to use by setting the `tool_choice` parameter. + # + # The two categories of tools you can provide the model are: + # + # - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + # capabilities, like + # [web search](https://platform.openai.com/docs/guides/tools-web-search) or + # [file search](https://platform.openai.com/docs/guides/tools-file-search). + # Learn more about + # [built-in tools](https://platform.openai.com/docs/guides/tools). + # - **Function calls (custom tools)**: Functions that are defined by you, enabling + # the model to call your own code. Learn more about + # [function calling](https://platform.openai.com/docs/guides/function-calling). tools: nil, + # An alternative to sampling with temperature, called nucleus sampling, where the + # model considers the results of the tokens with top_p probability mass. So 0.1 + # means only the tokens comprising the top 10% probability mass are considered. + # + # We generally recommend altering this or `temperature` but not both. top_p: nil, + # The truncation strategy to use for the model response. + # + # - `auto`: If the context of this response and previous ones exceeds the model's + # context window size, the model will truncate the response to fit the context + # window by dropping input items in the middle of the conversation. + # - `disabled` (default): If a model response will exceed the context window size + # for a model, the request will fail with a 400 error. truncation: nil, + # A unique identifier representing your end-user, which can help OpenAI to monitor + # and detect abuse. + # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). user: nil, request_options: {} ); end diff --git a/rbi/lib/openai/models/responses/response_created_event.rbi b/rbi/lib/openai/models/responses/response_created_event.rbi index 58605657..33664af0 100644 --- a/rbi/lib/openai/models/responses/response_created_event.rbi +++ b/rbi/lib/openai/models/responses/response_created_event.rbi @@ -20,8 +20,12 @@ module OpenAI params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(response:, type: :"response.created"); end - + def self.new( + # The response that was created. + response:, + # The type of the event. Always `response.created`. + type: :"response.created" + ); end sig { override.returns({response: OpenAI::Models::Responses::Response, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_error.rbi b/rbi/lib/openai/models/responses/response_error.rbi index 3beca9b7..796293af 100644 --- a/rbi/lib/openai/models/responses/response_error.rbi +++ b/rbi/lib/openai/models/responses/response_error.rbi @@ -17,8 +17,12 @@ module OpenAI params(code: OpenAI::Models::Responses::ResponseError::Code::OrSymbol, message: String) .returns(T.attached_class) end - def self.new(code:, message:); end - + def self.new( + # The error code for the response. + code:, + # A human-readable description of the error. + message: + ); end sig { override.returns({code: OpenAI::Models::Responses::ResponseError::Code::TaggedSymbol, message: String}) } def to_hash; end diff --git a/rbi/lib/openai/models/responses/response_error_event.rbi b/rbi/lib/openai/models/responses/response_error_event.rbi index c81fa537..24a190a8 100644 --- a/rbi/lib/openai/models/responses/response_error_event.rbi +++ b/rbi/lib/openai/models/responses/response_error_event.rbi @@ -25,8 +25,16 @@ module OpenAI params(code: T.nilable(String), message: String, param: T.nilable(String), type: Symbol) .returns(T.attached_class) end - def self.new(code:, message:, param:, type: :error); end - + def self.new( + # The error code. + code:, + # The error message. + message:, + # The error parameter. + param:, + # The type of the event. Always `error`. + type: :error + ); end sig do override.returns({code: T.nilable(String), message: String, param: T.nilable(String), type: Symbol}) end diff --git a/rbi/lib/openai/models/responses/response_failed_event.rbi b/rbi/lib/openai/models/responses/response_failed_event.rbi index 7cafac40..ad3251e9 100644 --- a/rbi/lib/openai/models/responses/response_failed_event.rbi +++ b/rbi/lib/openai/models/responses/response_failed_event.rbi @@ -20,8 +20,12 @@ module OpenAI params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(response:, type: :"response.failed"); end - + def self.new( + # The response that failed. + response:, + # The type of the event. Always `response.failed`. + type: :"response.failed" + ); end sig { override.returns({response: OpenAI::Models::Responses::Response, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi b/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi index 289e0742..7ac06ad1 100644 --- a/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when a file search call is completed (results found). sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(item_id:, output_index:, type: :"response.file_search_call.completed"); end - + def self.new( + # The ID of the output item that the file search call is initiated. + item_id:, + # The index of the output item that the file search call is initiated. + output_index:, + # The type of the event. Always `response.file_search_call.completed`. + type: :"response.file_search_call.completed" + ); end sig { override.returns({item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi index 04d00647..99274ded 100644 --- a/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when a file search call is initiated. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(item_id:, output_index:, type: :"response.file_search_call.in_progress"); end - + def self.new( + # The ID of the output item that the file search call is initiated. + item_id:, + # The index of the output item that the file search call is initiated. + output_index:, + # The type of the event. Always `response.file_search_call.in_progress`. + type: :"response.file_search_call.in_progress" + ); end sig { override.returns({item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi b/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi index a6de609a..605b332b 100644 --- a/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when a file search is currently searching. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(item_id:, output_index:, type: :"response.file_search_call.searching"); end - + def self.new( + # The ID of the output item that the file search call is initiated. + item_id:, + # The index of the output item that the file search call is searching. + output_index:, + # The type of the event. Always `response.file_search_call.searching`. + type: :"response.file_search_call.searching" + ); end sig { override.returns({item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi b/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi index edeca91a..94b16558 100644 --- a/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi @@ -40,8 +40,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, queries:, status:, results: nil, type: :file_search_call); end - + def self.new( + # The unique ID of the file search tool call. + id:, + # The queries used to search for files. + queries:, + # The status of the file search tool call. One of `in_progress`, `searching`, + # `incomplete` or `failed`, + status:, + # The results of the file search tool call. + results: nil, + # The type of the file search tool call. Always `file_search_call`. + type: :file_search_call + ); end sig do override .returns( @@ -126,8 +137,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(attributes: nil, file_id: nil, filename: nil, score: nil, text: nil); end - + def self.new( + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. Keys are strings with a maximum + # length of 64 characters. Values are strings with a maximum length of 512 + # characters, booleans, or numbers. + attributes: nil, + # The unique ID of the file. + file_id: nil, + # The name of the file. + filename: nil, + # The relevance score of the file - a value between 0 and 1. + score: nil, + # The text that was retrieved from the file. + text: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi b/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi index 25a553e6..1b94b7c2 100644 --- a/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi +++ b/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi @@ -47,8 +47,25 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(name:, schema:, description: nil, strict: nil, type: :json_schema); end - + def self.new( + # The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores + # and dashes, with a maximum length of 64. + name:, + # The schema for the response format, described as a JSON Schema object. Learn how + # to build JSON schemas [here](https://json-schema.org/). + schema:, + # A description of what the response format is for, used by the model to determine + # how to respond in the format. + description: nil, + # Whether to enable strict schema adherence when generating the output. If set to + # true, the model will always follow the exact schema defined in the `schema` + # field. Only a subset of JSON Schema is supported when `strict` is `true`. To + # learn more, read the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + strict: nil, + # The type of response format being defined. Always `json_schema`. + type: :json_schema + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi b/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi index 11ac7ab7..801e2df6 100644 --- a/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi @@ -29,8 +29,16 @@ module OpenAI type: Symbol ).returns(T.attached_class) end - def self.new(delta:, item_id:, output_index:, type: :"response.function_call_arguments.delta"); end - + def self.new( + # The function-call arguments delta that is added. + delta:, + # The ID of the output item that the function-call arguments delta is added to. + item_id:, + # The index of the output item that the function-call arguments delta is added to. + output_index:, + # The type of the event. Always `response.function_call_arguments.delta`. + type: :"response.function_call_arguments.delta" + ); end sig { override.returns({delta: String, item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi b/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi index ebafa372..0886a45d 100644 --- a/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi @@ -28,8 +28,15 @@ module OpenAI type: Symbol ).returns(T.attached_class) end - def self.new(arguments:, item_id:, output_index:, type: :"response.function_call_arguments.done"); end - + def self.new( + # The function-call arguments. + arguments:, + # The ID of the item. + item_id:, + # The index of the output item. + output_index:, + type: :"response.function_call_arguments.done" + ); end sig { override.returns({arguments: String, item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_function_tool_call.rbi b/rbi/lib/openai/models/responses/response_function_tool_call.rbi index 5f89a8cf..0862724c 100644 --- a/rbi/lib/openai/models/responses/response_function_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_function_tool_call.rbi @@ -49,8 +49,21 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(arguments:, call_id:, name:, id: nil, status: nil, type: :function_call); end - + def self.new( + # A JSON string of the arguments to pass to the function. + arguments:, + # The unique ID of the function tool call generated by the model. + call_id:, + # The name of the function to run. + name:, + # The unique ID of the function tool call. + id: nil, + # The status of the item. One of `in_progress`, `completed`, or `incomplete`. + # Populated when items are returned via API. + status: nil, + # The type of the function tool call. Always `function_call`. + type: :function_call + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi b/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi index 7ed35c37..cfa76b9c 100644 --- a/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi +++ b/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi @@ -12,8 +12,10 @@ module OpenAI # [function calling guide](https://platform.openai.com/docs/guides/function-calling) # for more information. sig { params(id: String).returns(T.attached_class) } - def self.new(id:); end - + def self.new( + # The unique ID of the function tool call. + id: + ); end sig { override.returns({id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi b/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi index df902df8..64da7c58 100644 --- a/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi +++ b/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi @@ -38,8 +38,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, call_id:, output:, status: nil, type: :function_call_output); end - + def self.new( + # The unique ID of the function call tool output. + id:, + # The unique ID of the function tool call generated by the model. + call_id:, + # A JSON string of the output of the function tool call. + output:, + # The status of the item. One of `in_progress`, `completed`, or `incomplete`. + # Populated when items are returned via API. + status: nil, + # The type of the function tool call output. Always `function_call_output`. + type: :function_call_output + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_function_web_search.rbi b/rbi/lib/openai/models/responses/response_function_web_search.rbi index 4c9bd2bd..1c892bf4 100644 --- a/rbi/lib/openai/models/responses/response_function_web_search.rbi +++ b/rbi/lib/openai/models/responses/response_function_web_search.rbi @@ -27,8 +27,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, status:, type: :web_search_call); end - + def self.new( + # The unique ID of the web search tool call. + id:, + # The status of the web search tool call. + status:, + # The type of the web search tool call. Always `web_search_call`. + type: :web_search_call + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_in_progress_event.rbi index 37252dc3..7ef933f7 100644 --- a/rbi/lib/openai/models/responses/response_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_in_progress_event.rbi @@ -20,8 +20,12 @@ module OpenAI params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(response:, type: :"response.in_progress"); end - + def self.new( + # The response that is in progress. + response:, + # The type of the event. Always `response.in_progress`. + type: :"response.in_progress" + ); end sig { override.returns({response: OpenAI::Models::Responses::Response, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_incomplete_event.rbi b/rbi/lib/openai/models/responses/response_incomplete_event.rbi index 12fe7ff5..079d5434 100644 --- a/rbi/lib/openai/models/responses/response_incomplete_event.rbi +++ b/rbi/lib/openai/models/responses/response_incomplete_event.rbi @@ -20,8 +20,12 @@ module OpenAI params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(response:, type: :"response.incomplete"); end - + def self.new( + # The response that was incomplete. + response:, + # The type of the event. Always `response.incomplete`. + type: :"response.incomplete" + ); end sig { override.returns({response: OpenAI::Models::Responses::Response, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_input_audio.rbi b/rbi/lib/openai/models/responses/response_input_audio.rbi index ff2d0075..9244a048 100644 --- a/rbi/lib/openai/models/responses/response_input_audio.rbi +++ b/rbi/lib/openai/models/responses/response_input_audio.rbi @@ -25,8 +25,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, format_:, type: :input_audio); end - + def self.new( + # Base64-encoded audio data. + data:, + # The format of the audio data. Currently supported formats are `mp3` and `wav`. + format_:, + # The type of the input item. Always `input_audio`. + type: :input_audio + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_input_file.rbi b/rbi/lib/openai/models/responses/response_input_file.rbi index 5d46ed32..74a535c7 100644 --- a/rbi/lib/openai/models/responses/response_input_file.rbi +++ b/rbi/lib/openai/models/responses/response_input_file.rbi @@ -33,8 +33,16 @@ module OpenAI sig do params(file_data: String, file_id: String, filename: String, type: Symbol).returns(T.attached_class) end - def self.new(file_data: nil, file_id: nil, filename: nil, type: :input_file); end - + def self.new( + # The content of the file to be sent to the model. + file_data: nil, + # The ID of the file to be sent to the model. + file_id: nil, + # The name of the file to be sent to the model. + filename: nil, + # The type of the input item. Always `input_file`. + type: :input_file + ); end sig { override.returns({type: Symbol, file_data: String, file_id: String, filename: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_input_image.rbi b/rbi/lib/openai/models/responses/response_input_image.rbi index 2cf0bfec..d058b10d 100644 --- a/rbi/lib/openai/models/responses/response_input_image.rbi +++ b/rbi/lib/openai/models/responses/response_input_image.rbi @@ -33,8 +33,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(detail:, file_id: nil, image_url: nil, type: :input_image); end - + def self.new( + # The detail level of the image to be sent to the model. One of `high`, `low`, or + # `auto`. Defaults to `auto`. + detail:, + # The ID of the file to be sent to the model. + file_id: nil, + # The URL of the image to be sent to the model. A fully qualified URL or base64 + # encoded image in a data URL. + image_url: nil, + # The type of the input item. Always `input_image`. + type: :input_image + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_input_item.rbi b/rbi/lib/openai/models/responses/response_input_item.rbi index 7187822f..6595bbdb 100644 --- a/rbi/lib/openai/models/responses/response_input_item.rbi +++ b/rbi/lib/openai/models/responses/response_input_item.rbi @@ -65,8 +65,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content:, role:, status: nil, type: nil); end - + def self.new( + # A list of one or many input items to the model, containing different content + # types. + content:, + # The role of the message input. One of `user`, `system`, or `developer`. + role:, + # The status of item. One of `in_progress`, `completed`, or `incomplete`. + # Populated when items are returned via API. + status: nil, + # The type of the message input. Always set to `message`. + type: nil + ); end sig do override .returns( @@ -215,15 +225,21 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The ID of the computer tool call that produced the output. call_id:, + # A computer screenshot image used with the computer use tool. output:, + # The ID of the computer tool call output. id: nil, + # The safety checks reported by the API that have been acknowledged by the + # developer. acknowledged_safety_checks: nil, + # The status of the message input. One of `in_progress`, `completed`, or + # `incomplete`. Populated when input items are returned via API. status: nil, + # The type of the computer tool call output. Always `computer_call_output`. type: :computer_call_output - ) - end - + ); end sig do override .returns( @@ -254,8 +270,14 @@ module OpenAI # A pending safety check for the computer call. sig { params(id: String, code: String, message: String).returns(T.attached_class) } - def self.new(id:, code:, message:); end - + def self.new( + # The ID of the pending safety check. + id:, + # The type of the pending safety check. + code:, + # Details about the pending safety check. + message: + ); end sig { override.returns({id: String, code: String, message: String}) } def to_hash; end end @@ -327,8 +349,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(call_id:, output:, id: nil, status: nil, type: :function_call_output); end - + def self.new( + # The unique ID of the function tool call generated by the model. + call_id:, + # A JSON string of the output of the function tool call. + output:, + # The unique ID of the function tool call output. Populated when this item is + # returned via API. + id: nil, + # The status of the item. One of `in_progress`, `completed`, or `incomplete`. + # Populated when items are returned via API. + status: nil, + # The type of the function tool call output. Always `function_call_output`. + type: :function_call_output + ); end sig do override .returns( @@ -381,8 +415,12 @@ module OpenAI # An internal identifier for an item to reference. sig { params(id: String, type: Symbol).returns(T.attached_class) } - def self.new(id:, type: :item_reference); end - + def self.new( + # The ID of the item to reference. + id:, + # The type of item to reference. Always `item_reference`. + type: :item_reference + ); end sig { override.returns({id: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_input_message_item.rbi b/rbi/lib/openai/models/responses/response_input_message_item.rbi index dbae6d9b..9c426966 100644 --- a/rbi/lib/openai/models/responses/response_input_message_item.rbi +++ b/rbi/lib/openai/models/responses/response_input_message_item.rbi @@ -59,8 +59,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, content:, role:, status: nil, type: nil); end - + def self.new( + # The unique ID of the message input. + id:, + # A list of one or many input items to the model, containing different content + # types. + content:, + # The role of the message input. One of `user`, `system`, or `developer`. + role:, + # The status of item. One of `in_progress`, `completed`, or `incomplete`. + # Populated when items are returned via API. + status: nil, + # The type of the message input. Always set to `message`. + type: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_input_text.rbi b/rbi/lib/openai/models/responses/response_input_text.rbi index d3df7cc9..6ecb1f55 100644 --- a/rbi/lib/openai/models/responses/response_input_text.rbi +++ b/rbi/lib/openai/models/responses/response_input_text.rbi @@ -14,8 +14,12 @@ module OpenAI # A text input to the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :input_text); end - + def self.new( + # The text input to the model. + text:, + # The type of the input item. Always `input_text`. + type: :input_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_item_list.rbi b/rbi/lib/openai/models/responses/response_item_list.rbi index a041edfb..60f9ee2b 100644 --- a/rbi/lib/openai/models/responses/response_item_list.rbi +++ b/rbi/lib/openai/models/responses/response_item_list.rbi @@ -62,8 +62,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, first_id:, has_more:, last_id:, object: :list); end - + def self.new( + # A list of items used to generate this response. + data:, + # The ID of the first item in the list. + first_id:, + # Whether there are more items available. + has_more:, + # The ID of the last item in the list. + last_id:, + # The type of object returned, must be `list`. + object: :list + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_output_audio.rbi b/rbi/lib/openai/models/responses/response_output_audio.rbi index 010d71b6..ccca474a 100644 --- a/rbi/lib/openai/models/responses/response_output_audio.rbi +++ b/rbi/lib/openai/models/responses/response_output_audio.rbi @@ -18,8 +18,14 @@ module OpenAI # An audio output from the model. sig { params(data: String, transcript: String, type: Symbol).returns(T.attached_class) } - def self.new(data:, transcript:, type: :output_audio); end - + def self.new( + # Base64-encoded audio data from the model. + data:, + # The transcript of the audio data from the model. + transcript:, + # The type of the output audio. Always `output_audio`. + type: :output_audio + ); end sig { override.returns({data: String, transcript: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_output_item_added_event.rbi b/rbi/lib/openai/models/responses/response_output_item_added_event.rbi index 230e21d0..6318ea2f 100644 --- a/rbi/lib/openai/models/responses/response_output_item_added_event.rbi +++ b/rbi/lib/openai/models/responses/response_output_item_added_event.rbi @@ -44,8 +44,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(item:, output_index:, type: :"response.output_item.added"); end - + def self.new( + # The output item that was added. + item:, + # The index of the output item that was added. + output_index:, + # The type of the event. Always `response.output_item.added`. + type: :"response.output_item.added" + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_output_item_done_event.rbi b/rbi/lib/openai/models/responses/response_output_item_done_event.rbi index 94747df6..2ec17e88 100644 --- a/rbi/lib/openai/models/responses/response_output_item_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_output_item_done_event.rbi @@ -44,8 +44,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(item:, output_index:, type: :"response.output_item.done"); end - + def self.new( + # The output item that was marked done. + item:, + # The index of the output item that was marked done. + output_index:, + # The type of the event. Always `response.output_item.done`. + type: :"response.output_item.done" + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_output_message.rbi b/rbi/lib/openai/models/responses/response_output_message.rbi index e9c25f07..67f1cfc9 100644 --- a/rbi/lib/openai/models/responses/response_output_message.rbi +++ b/rbi/lib/openai/models/responses/response_output_message.rbi @@ -46,8 +46,19 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, content:, status:, role: :assistant, type: :message); end - + def self.new( + # The unique ID of the output message. + id:, + # The content of the output message. + content:, + # The status of the message input. One of `in_progress`, `completed`, or + # `incomplete`. Populated when input items are returned via API. + status:, + # The role of the output message. Always `assistant`. + role: :assistant, + # The type of the output message. Always `message`. + type: :message + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_output_refusal.rbi b/rbi/lib/openai/models/responses/response_output_refusal.rbi index ece03c37..16a800dd 100644 --- a/rbi/lib/openai/models/responses/response_output_refusal.rbi +++ b/rbi/lib/openai/models/responses/response_output_refusal.rbi @@ -14,8 +14,12 @@ module OpenAI # A refusal from the model. sig { params(refusal: String, type: Symbol).returns(T.attached_class) } - def self.new(refusal:, type: :refusal); end - + def self.new( + # The refusal explanationfrom the model. + refusal:, + # The type of the refusal. Always `refusal`. + type: :refusal + ); end sig { override.returns({refusal: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_output_text.rbi b/rbi/lib/openai/models/responses/response_output_text.rbi index 4d499086..e0267bd2 100644 --- a/rbi/lib/openai/models/responses/response_output_text.rbi +++ b/rbi/lib/openai/models/responses/response_output_text.rbi @@ -42,8 +42,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(annotations:, text:, type: :output_text); end - + def self.new( + # The annotations of the text output. + annotations:, + # The text output from the model. + text:, + # The type of the output text. Always `output_text`. + type: :output_text + ); end sig do override .returns( @@ -81,8 +87,14 @@ module OpenAI # A citation to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(file_id:, index:, type: :file_citation); end - + def self.new( + # The ID of the file. + file_id:, + # The index of the file in the list of files. + index:, + # The type of the file citation. Always `file_citation`. + type: :file_citation + ); end sig { override.returns({file_id: String, index: Integer, type: Symbol}) } def to_hash; end end @@ -113,8 +125,18 @@ module OpenAI params(end_index: Integer, start_index: Integer, title: String, url: String, type: Symbol) .returns(T.attached_class) end - def self.new(end_index:, start_index:, title:, url:, type: :url_citation); end - + def self.new( + # The index of the last character of the URL citation in the message. + end_index:, + # The index of the first character of the URL citation in the message. + start_index:, + # The title of the web resource. + title:, + # The URL of the web resource. + url:, + # The type of the URL citation. Always `url_citation`. + type: :url_citation + ); end sig do override.returns( { @@ -144,8 +166,14 @@ module OpenAI # A path to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(file_id:, index:, type: :file_path); end - + def self.new( + # The ID of the file. + file_id:, + # The index of the file in the list of files. + index:, + # The type of the file path. Always `file_path`. + type: :file_path + ); end sig { override.returns({file_id: String, index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_reasoning_item.rbi b/rbi/lib/openai/models/responses/response_reasoning_item.rbi index ecd2a673..7b83bf50 100644 --- a/rbi/lib/openai/models/responses/response_reasoning_item.rbi +++ b/rbi/lib/openai/models/responses/response_reasoning_item.rbi @@ -35,8 +35,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(id:, summary:, status: nil, type: :reasoning); end - + def self.new( + # The unique identifier of the reasoning content. + id:, + # Reasoning text contents. + summary:, + # The status of the item. One of `in_progress`, `completed`, or `incomplete`. + # Populated when items are returned via API. + status: nil, + # The type of the object. Always `reasoning`. + type: :reasoning + ); end sig do override .returns( @@ -60,8 +69,12 @@ module OpenAI attr_accessor :type sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :summary_text); end - + def self.new( + # A short summary of the reasoning used by the model when generating the response. + text:, + # The type of the object. Always `summary_text`. + type: :summary_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi index 2a08cbdb..22c28d0f 100644 --- a/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi @@ -44,14 +44,17 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The ID of the item this summary part is associated with. item_id:, + # The index of the output item this summary part is associated with. output_index:, + # The summary part that was added. part:, + # The index of the summary part within the reasoning summary. summary_index:, + # The type of the event. Always `response.reasoning_summary_part.added`. type: :"response.reasoning_summary_part.added" - ) - end - + ); end sig do override .returns( @@ -77,8 +80,12 @@ module OpenAI # The summary part that was added. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :summary_text); end - + def self.new( + # The text of the summary part. + text:, + # The type of the summary part. Always `summary_text`. + type: :summary_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi index 074c9319..93ac8fbb 100644 --- a/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi @@ -44,14 +44,17 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The ID of the item this summary part is associated with. item_id:, + # The index of the output item this summary part is associated with. output_index:, + # The completed summary part. part:, + # The index of the summary part within the reasoning summary. summary_index:, + # The type of the event. Always `response.reasoning_summary_part.done`. type: :"response.reasoning_summary_part.done" - ) - end - + ); end sig do override .returns( @@ -77,8 +80,12 @@ module OpenAI # The completed summary part. sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new(text:, type: :summary_text); end - + def self.new( + # The text of the summary part. + text:, + # The type of the summary part. Always `summary_text`. + type: :summary_text + ); end sig { override.returns({text: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi index e659c052..0b471aed 100644 --- a/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi @@ -30,14 +30,17 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The text delta that was added to the summary. delta:, + # The ID of the item this summary text delta is associated with. item_id:, + # The index of the output item this summary text delta is associated with. output_index:, + # The index of the summary part within the reasoning summary. summary_index:, + # The type of the event. Always `response.reasoning_summary_text.delta`. type: :"response.reasoning_summary_text.delta" - ) - end - + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi b/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi index dea35ce6..6ff8c695 100644 --- a/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi @@ -30,14 +30,17 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The ID of the item this summary text is associated with. item_id:, + # The index of the output item this summary text is associated with. output_index:, + # The index of the summary part within the reasoning summary. summary_index:, + # The full text of the completed reasoning summary. text:, + # The type of the event. Always `response.reasoning_summary_text.done`. type: :"response.reasoning_summary_text.done" - ) - end - + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi b/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi index ec2c268f..204d391f 100644 --- a/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi @@ -29,8 +29,18 @@ module OpenAI params(content_index: Integer, delta: String, item_id: String, output_index: Integer, type: Symbol) .returns(T.attached_class) end - def self.new(content_index:, delta:, item_id:, output_index:, type: :"response.refusal.delta"); end - + def self.new( + # The index of the content part that the refusal text is added to. + content_index:, + # The refusal text that is added. + delta:, + # The ID of the output item that the refusal text is added to. + item_id:, + # The index of the output item that the refusal text is added to. + output_index:, + # The type of the event. Always `response.refusal.delta`. + type: :"response.refusal.delta" + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/responses/response_refusal_done_event.rbi b/rbi/lib/openai/models/responses/response_refusal_done_event.rbi index 9f7db249..5bc2d764 100644 --- a/rbi/lib/openai/models/responses/response_refusal_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_refusal_done_event.rbi @@ -35,8 +35,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(content_index:, item_id:, output_index:, refusal:, type: :"response.refusal.done"); end - + def self.new( + # The index of the content part that the refusal text is finalized. + content_index:, + # The ID of the output item that the refusal text is finalized. + item_id:, + # The index of the output item that the refusal text is finalized. + output_index:, + # The refusal text that is finalized. + refusal:, + # The type of the event. Always `response.refusal.done`. + type: :"response.refusal.done" + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/responses/response_retrieve_params.rbi b/rbi/lib/openai/models/responses/response_retrieve_params.rbi index 39ea7e1c..876e71b5 100644 --- a/rbi/lib/openai/models/responses/response_retrieve_params.rbi +++ b/rbi/lib/openai/models/responses/response_retrieve_params.rbi @@ -22,8 +22,12 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(include: nil, request_options: {}); end - + def self.new( + # Additional fields to include in the response. See the `include` parameter for + # Response creation above for more information. + include: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi b/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi index 16c54b75..91bc1793 100644 --- a/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi @@ -54,11 +54,17 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A citation to a file. annotation:, + # The index of the annotation that was added. annotation_index:, + # The index of the content part that the text annotation was added to. content_index:, + # The ID of the output item that the text annotation was added to. item_id:, + # The index of the output item that the text annotation was added to. output_index:, + # The type of the event. Always `response.output_text.annotation.added`. type: :"response.output_text.annotation.added" ); end sig do @@ -99,8 +105,14 @@ module OpenAI # A citation to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(file_id:, index:, type: :file_citation); end - + def self.new( + # The ID of the file. + file_id:, + # The index of the file in the list of files. + index:, + # The type of the file citation. Always `file_citation`. + type: :file_citation + ); end sig { override.returns({file_id: String, index: Integer, type: Symbol}) } def to_hash; end end @@ -131,8 +143,18 @@ module OpenAI params(end_index: Integer, start_index: Integer, title: String, url: String, type: Symbol) .returns(T.attached_class) end - def self.new(end_index:, start_index:, title:, url:, type: :url_citation); end - + def self.new( + # The index of the last character of the URL citation in the message. + end_index:, + # The index of the first character of the URL citation in the message. + start_index:, + # The title of the web resource. + title:, + # The URL of the web resource. + url:, + # The type of the URL citation. Always `url_citation`. + type: :url_citation + ); end sig do override.returns( { @@ -162,8 +184,14 @@ module OpenAI # A path to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(file_id:, index:, type: :file_path); end - + def self.new( + # The ID of the file. + file_id:, + # The index of the file in the list of files. + index:, + # The type of the file path. Always `file_path`. + type: :file_path + ); end sig { override.returns({file_id: String, index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_text_config.rbi b/rbi/lib/openai/models/responses/response_text_config.rbi index 68a82916..2f1c517e 100644 --- a/rbi/lib/openai/models/responses/response_text_config.rbi +++ b/rbi/lib/openai/models/responses/response_text_config.rbi @@ -59,8 +59,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(format_: nil); end - + def self.new( + # An object specifying the format that the model must output. + # + # Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + # ensures the model will match your supplied JSON schema. Learn more in the + # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + # + # The default format is `{ "type": "text" }` with no additional options. + # + # **Not recommended for gpt-4o and newer models:** + # + # Setting to `{ "type": "json_object" }` enables the older JSON mode, which + # ensures the message the model generates is valid JSON. Using `json_schema` is + # preferred for models that support it. + format_: nil + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/responses/response_text_delta_event.rbi b/rbi/lib/openai/models/responses/response_text_delta_event.rbi index 7880e8f9..29ea7431 100644 --- a/rbi/lib/openai/models/responses/response_text_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_text_delta_event.rbi @@ -29,9 +29,18 @@ module OpenAI params(content_index: Integer, delta: String, item_id: String, output_index: Integer, type: Symbol) .returns(T.attached_class) end - def self.new(content_index:, delta:, item_id:, output_index:, type: :"response.output_text.delta") - end - + def self.new( + # The index of the content part that the text delta was added to. + content_index:, + # The text delta that was added. + delta:, + # The ID of the output item that the text delta was added to. + item_id:, + # The index of the output item that the text delta was added to. + output_index:, + # The type of the event. Always `response.output_text.delta`. + type: :"response.output_text.delta" + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/responses/response_text_done_event.rbi b/rbi/lib/openai/models/responses/response_text_done_event.rbi index 52fa9bef..40459549 100644 --- a/rbi/lib/openai/models/responses/response_text_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_text_done_event.rbi @@ -29,8 +29,18 @@ module OpenAI params(content_index: Integer, item_id: String, output_index: Integer, text: String, type: Symbol) .returns(T.attached_class) end - def self.new(content_index:, item_id:, output_index:, text:, type: :"response.output_text.done"); end - + def self.new( + # The index of the content part that the text content is finalized. + content_index:, + # The ID of the output item that the text content is finalized. + item_id:, + # The index of the output item that the text content is finalized. + output_index:, + # The text content that is finalized. + text:, + # The type of the event. Always `response.output_text.done`. + type: :"response.output_text.done" + ); end sig do override .returns({ diff --git a/rbi/lib/openai/models/responses/response_usage.rbi b/rbi/lib/openai/models/responses/response_usage.rbi index 852d91c4..f435b178 100644 --- a/rbi/lib/openai/models/responses/response_usage.rbi +++ b/rbi/lib/openai/models/responses/response_usage.rbi @@ -53,14 +53,17 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The number of input tokens. input_tokens:, + # A detailed breakdown of the input tokens. input_tokens_details:, + # The number of output tokens. output_tokens:, + # A detailed breakdown of the output tokens. output_tokens_details:, + # The total number of tokens used. total_tokens: - ) - end - + ); end sig do override .returns( @@ -83,8 +86,11 @@ module OpenAI # A detailed breakdown of the input tokens. sig { params(cached_tokens: Integer).returns(T.attached_class) } - def self.new(cached_tokens:); end - + def self.new( + # The number of tokens that were retrieved from the cache. + # [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + cached_tokens: + ); end sig { override.returns({cached_tokens: Integer}) } def to_hash; end end @@ -96,8 +102,10 @@ module OpenAI # A detailed breakdown of the output tokens. sig { params(reasoning_tokens: Integer).returns(T.attached_class) } - def self.new(reasoning_tokens:); end - + def self.new( + # The number of reasoning tokens. + reasoning_tokens: + ); end sig { override.returns({reasoning_tokens: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi b/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi index fab93564..1f479679 100644 --- a/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when a web search call is completed. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(item_id:, output_index:, type: :"response.web_search_call.completed"); end - + def self.new( + # Unique ID for the output item associated with the web search call. + item_id:, + # The index of the output item that the web search call is associated with. + output_index:, + # The type of the event. Always `response.web_search_call.completed`. + type: :"response.web_search_call.completed" + ); end sig { override.returns({item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi index b98665f8..f8c355d5 100644 --- a/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when a web search call is initiated. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(item_id:, output_index:, type: :"response.web_search_call.in_progress"); end - + def self.new( + # Unique ID for the output item associated with the web search call. + item_id:, + # The index of the output item that the web search call is associated with. + output_index:, + # The type of the event. Always `response.web_search_call.in_progress`. + type: :"response.web_search_call.in_progress" + ); end sig { override.returns({item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi b/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi index 0ad8d67e..0cffcfae 100644 --- a/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi +++ b/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi @@ -18,8 +18,14 @@ module OpenAI # Emitted when a web search call is executing. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } - def self.new(item_id:, output_index:, type: :"response.web_search_call.searching"); end - + def self.new( + # Unique ID for the output item associated with the web search call. + item_id:, + # The index of the output item that the web search call is associated with. + output_index:, + # The type of the event. Always `response.web_search_call.searching`. + type: :"response.web_search_call.searching" + ); end sig { override.returns({item_id: String, output_index: Integer, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/tool_choice_function.rbi b/rbi/lib/openai/models/responses/tool_choice_function.rbi index d0753332..98de2eb9 100644 --- a/rbi/lib/openai/models/responses/tool_choice_function.rbi +++ b/rbi/lib/openai/models/responses/tool_choice_function.rbi @@ -14,8 +14,12 @@ module OpenAI # Use this option to force the model to call a specific function. sig { params(name: String, type: Symbol).returns(T.attached_class) } - def self.new(name:, type: :function); end - + def self.new( + # The name of the function to call. + name:, + # For function calling, the type is always `function`. + type: :function + ); end sig { override.returns({name: String, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/responses/tool_choice_types.rbi b/rbi/lib/openai/models/responses/tool_choice_types.rbi index 1b8ed0b6..943a8c1f 100644 --- a/rbi/lib/openai/models/responses/tool_choice_types.rbi +++ b/rbi/lib/openai/models/responses/tool_choice_types.rbi @@ -18,8 +18,17 @@ module OpenAI # Indicates that the model should use a built-in tool to generate a response. # [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). sig { params(type: OpenAI::Models::Responses::ToolChoiceTypes::Type::OrSymbol).returns(T.attached_class) } - def self.new(type:); end - + def self.new( + # The type of hosted tool the model should to use. Learn more about + # [built-in tools](https://platform.openai.com/docs/guides/tools). + # + # Allowed values are: + # + # - `file_search` + # - `web_search_preview` + # - `computer_use_preview` + type: + ); end sig { override.returns({type: OpenAI::Models::Responses::ToolChoiceTypes::Type::OrSymbol}) } def to_hash; end diff --git a/rbi/lib/openai/models/responses/web_search_tool.rbi b/rbi/lib/openai/models/responses/web_search_tool.rbi index 9b23c93c..fa6955fd 100644 --- a/rbi/lib/openai/models/responses/web_search_tool.rbi +++ b/rbi/lib/openai/models/responses/web_search_tool.rbi @@ -41,8 +41,17 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(type:, search_context_size: nil, user_location: nil); end - + def self.new( + # The type of the web search tool. One of: + # + # - `web_search_preview` + # - `web_search_preview_2025_03_11` + type:, + # High level guidance for the amount of context window space to use for the + # search. One of `low`, `medium`, or `high`. `medium` is the default. + search_context_size: nil, + user_location: nil + ); end sig do override .returns( @@ -130,8 +139,20 @@ module OpenAI params(city: String, country: String, region: String, timezone: String, type: Symbol) .returns(T.attached_class) end - def self.new(city: nil, country: nil, region: nil, timezone: nil, type: :approximate); end - + def self.new( + # Free text input for the city of the user, e.g. `San Francisco`. + city: nil, + # The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of + # the user, e.g. `US`. + country: nil, + # Free text input for the region of the user, e.g. `California`. + region: nil, + # The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the + # user, e.g. `America/Los_Angeles`. + timezone: nil, + # The type of location approximation. Always `approximate`. + type: :approximate + ); end sig do override.returns({type: Symbol, city: String, country: String, region: String, timezone: String}) end diff --git a/rbi/lib/openai/models/static_file_chunking_strategy.rbi b/rbi/lib/openai/models/static_file_chunking_strategy.rbi index ce9bb8d5..ae5b7298 100644 --- a/rbi/lib/openai/models/static_file_chunking_strategy.rbi +++ b/rbi/lib/openai/models/static_file_chunking_strategy.rbi @@ -15,8 +15,15 @@ module OpenAI attr_accessor :max_chunk_size_tokens sig { params(chunk_overlap_tokens: Integer, max_chunk_size_tokens: Integer).returns(T.attached_class) } - def self.new(chunk_overlap_tokens:, max_chunk_size_tokens:); end - + def self.new( + # The number of tokens that overlap between chunks. The default value is `400`. + # + # Note that the overlap must not exceed half of `max_chunk_size_tokens`. + chunk_overlap_tokens:, + # The maximum number of tokens in each chunk. The default value is `800`. The + # minimum value is `100` and the maximum value is `4096`. + max_chunk_size_tokens: + ); end sig { override.returns({chunk_overlap_tokens: Integer, max_chunk_size_tokens: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi b/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi index a5f3133a..2a978597 100644 --- a/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi +++ b/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi @@ -17,8 +17,11 @@ module OpenAI params(static: T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(static:, type: :static); end - + def self.new( + static:, + # Always `static`. + type: :static + ); end sig { override.returns({static: OpenAI::Models::StaticFileChunkingStrategy, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi b/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi index 49f61a35..ba278994 100644 --- a/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi +++ b/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi @@ -18,8 +18,11 @@ module OpenAI params(static: T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Internal::AnyHash), type: Symbol) .returns(T.attached_class) end - def self.new(static:, type: :static); end - + def self.new( + static:, + # Always `static`. + type: :static + ); end sig { override.returns({static: OpenAI::Models::StaticFileChunkingStrategy, type: Symbol}) } def to_hash; end end diff --git a/rbi/lib/openai/models/upload.rbi b/rbi/lib/openai/models/upload.rbi index 083dbd10..f0483771 100644 --- a/rbi/lib/openai/models/upload.rbi +++ b/rbi/lib/openai/models/upload.rbi @@ -60,18 +60,27 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The Upload unique identifier, which can be referenced in API endpoints. id:, + # The intended number of bytes to be uploaded. bytes:, + # The Unix timestamp (in seconds) for when the Upload was created. created_at:, + # The Unix timestamp (in seconds) for when the Upload will expire. expires_at:, + # The name of the file to be uploaded. filename:, + # The intended purpose of the file. + # [Please refer here](https://platform.openai.com/docs/api-reference/files/object#files/object-purpose) + # for acceptable values. purpose:, + # The status of the Upload. status:, + # The `File` object represents a document that has been uploaded to OpenAI. file: nil, + # The object type, which is always "upload". object: :upload - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/upload_complete_params.rbi b/rbi/lib/openai/models/upload_complete_params.rbi index 344ab351..71c0c76b 100644 --- a/rbi/lib/openai/models/upload_complete_params.rbi +++ b/rbi/lib/openai/models/upload_complete_params.rbi @@ -26,8 +26,14 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(part_ids:, md5: nil, request_options: {}); end - + def self.new( + # The ordered list of Part IDs. + part_ids:, + # The optional md5 checksum for the file contents to verify if the bytes uploaded + # matches what you expect. + md5: nil, + request_options: {} + ); end sig do override.returns({part_ids: T::Array[String], md5: String, request_options: OpenAI::RequestOptions}) end diff --git a/rbi/lib/openai/models/upload_create_params.rbi b/rbi/lib/openai/models/upload_create_params.rbi index 74c1e762..cd69d21c 100644 --- a/rbi/lib/openai/models/upload_create_params.rbi +++ b/rbi/lib/openai/models/upload_create_params.rbi @@ -38,8 +38,23 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(bytes:, filename:, mime_type:, purpose:, request_options: {}); end - + def self.new( + # The number of bytes in the file you are uploading. + bytes:, + # The name of the file to upload. + filename:, + # The MIME type of the file. + # + # This must fall within the supported MIME types for your file purpose. See the + # supported MIME types for assistants and vision. + mime_type:, + # The intended purpose of the uploaded file. + # + # See the + # [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). + purpose:, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/uploads/part_create_params.rbi b/rbi/lib/openai/models/uploads/part_create_params.rbi index 3915001e..1a62a478 100644 --- a/rbi/lib/openai/models/uploads/part_create_params.rbi +++ b/rbi/lib/openai/models/uploads/part_create_params.rbi @@ -18,8 +18,11 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(data:, request_options: {}); end - + def self.new( + # The chunk of bytes for this Part. + data:, + request_options: {} + ); end sig { override.returns({data: T.any(Pathname, StringIO), request_options: OpenAI::RequestOptions}) } def to_hash; end end diff --git a/rbi/lib/openai/models/uploads/upload_part.rbi b/rbi/lib/openai/models/uploads/upload_part.rbi index a6d037e0..17a8849b 100644 --- a/rbi/lib/openai/models/uploads/upload_part.rbi +++ b/rbi/lib/openai/models/uploads/upload_part.rbi @@ -24,8 +24,16 @@ module OpenAI sig do params(id: String, created_at: Integer, upload_id: String, object: Symbol).returns(T.attached_class) end - def self.new(id:, created_at:, upload_id:, object: :"upload.part"); end - + def self.new( + # The upload Part unique identifier, which can be referenced in API endpoints. + id:, + # The Unix timestamp (in seconds) for when the Part was created. + created_at:, + # The ID of the Upload object that this Part was added to. + upload_id:, + # The object type, which is always `upload.part`. + object: :"upload.part" + ); end sig { override.returns({id: String, created_at: Integer, object: Symbol, upload_id: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/vector_store.rbi b/rbi/lib/openai/models/vector_store.rbi index dd704e90..eefaf648 100644 --- a/rbi/lib/openai/models/vector_store.rbi +++ b/rbi/lib/openai/models/vector_store.rbi @@ -78,16 +78,33 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The identifier, which can be referenced in API endpoints. id:, + # The Unix timestamp (in seconds) for when the vector store was created. created_at:, file_counts:, + # The Unix timestamp (in seconds) for when the vector store was last active. last_active_at:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata:, + # The name of the vector store. name:, + # The status of the vector store, which can be either `expired`, `in_progress`, or + # `completed`. A status of `completed` indicates that the vector store is ready + # for use. status:, + # The total number of bytes used by the files in the vector store. usage_bytes:, + # The expiration policy for a vector store. expires_after: nil, + # The Unix timestamp (in seconds) for when the vector store will expire. expires_at: nil, + # The object type, which is always `vector_store`. object: :vector_store ); end sig do @@ -141,8 +158,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(cancelled:, completed:, failed:, in_progress:, total:); end - + def self.new( + # The number of files that were cancelled. + cancelled:, + # The number of files that have been successfully processed. + completed:, + # The number of files that have failed to process. + failed:, + # The number of files that are currently being processed. + in_progress:, + # The total number of files. + total: + ); end sig do override .returns({ @@ -185,8 +212,13 @@ module OpenAI # The expiration policy for a vector store. sig { params(days: Integer, anchor: Symbol).returns(T.attached_class) } - def self.new(days:, anchor: :last_active_at); end - + def self.new( + # The number of days after the anchor time that the vector store will expire. + days:, + # Anchor timestamp after which the expiration policy applies. Supported anchors: + # `last_active_at`. + anchor: :last_active_at + ); end sig { override.returns({anchor: Symbol, days: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/vector_store_create_params.rbi b/rbi/lib/openai/models/vector_store_create_params.rbi index c6256c21..ea4b49c5 100644 --- a/rbi/lib/openai/models/vector_store_create_params.rbi +++ b/rbi/lib/openai/models/vector_store_create_params.rbi @@ -85,15 +85,26 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # strategy. Only applicable if `file_ids` is non-empty. chunking_strategy: nil, + # The expiration policy for a vector store. expires_after: nil, + # A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that + # the vector store should use. Useful for tools like `file_search` that can access + # files. file_ids: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. metadata: nil, + # The name of the vector store. name: nil, request_options: {} - ) - end - + ); end sig do override .returns( @@ -124,8 +135,13 @@ module OpenAI # The expiration policy for a vector store. sig { params(days: Integer, anchor: Symbol).returns(T.attached_class) } - def self.new(days:, anchor: :last_active_at); end - + def self.new( + # The number of days after the anchor time that the vector store will expire. + days:, + # Anchor timestamp after which the expiration policy applies. Supported anchors: + # `last_active_at`. + anchor: :last_active_at + ); end sig { override.returns({anchor: Symbol, days: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/vector_store_list_params.rbi b/rbi/lib/openai/models/vector_store_list_params.rbi index 802bf5c5..5a6218c2 100644 --- a/rbi/lib/openai/models/vector_store_list_params.rbi +++ b/rbi/lib/openai/models/vector_store_list_params.rbi @@ -52,8 +52,25 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, before: nil, limit: nil, order: nil, request_options: {}); end - + def self.new( + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. + after: nil, + # A cursor for use in pagination. `before` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # starting with obj_foo, your subsequent call can include before=obj_foo in order + # to fetch the previous page of the list. + before: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. + limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. + order: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_store_search_params.rbi b/rbi/lib/openai/models/vector_store_search_params.rbi index 47525fb1..e187c6b1 100644 --- a/rbi/lib/openai/models/vector_store_search_params.rbi +++ b/rbi/lib/openai/models/vector_store_search_params.rbi @@ -61,15 +61,19 @@ module OpenAI .returns(T.attached_class) end def self.new( + # A query string for a search query:, + # A filter to apply based on file attributes. filters: nil, + # The maximum number of results to return. This number should be between 1 and 50 + # inclusive. max_num_results: nil, + # Ranking options for search. ranking_options: nil, + # Whether to rewrite the natural language query for vector search. rewrite_query: nil, request_options: {} - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_store_search_response.rbi b/rbi/lib/openai/models/vector_store_search_response.rbi index fdfceacf..26ac1ca1 100644 --- a/rbi/lib/openai/models/vector_store_search_response.rbi +++ b/rbi/lib/openai/models/vector_store_search_response.rbi @@ -37,8 +37,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(attributes:, content:, file_id:, filename:, score:); end - + def self.new( + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. Keys are strings with a maximum + # length of 64 characters. Values are strings with a maximum length of 512 + # characters, booleans, or numbers. + attributes:, + # Content chunks from the file. + content:, + # The ID of the vector store file. + file_id:, + # The name of the vector store file. + filename:, + # The similarity score for the result. + score: + ); end sig do override .returns( @@ -73,8 +87,12 @@ module OpenAI params(text: String, type: OpenAI::Models::VectorStoreSearchResponse::Content::Type::OrSymbol) .returns(T.attached_class) end - def self.new(text:, type:); end - + def self.new( + # The text content returned from search. + text:, + # The type of content. + type: + ); end sig do override .returns({text: String, type: OpenAI::Models::VectorStoreSearchResponse::Content::Type::TaggedSymbol}) diff --git a/rbi/lib/openai/models/vector_store_update_params.rbi b/rbi/lib/openai/models/vector_store_update_params.rbi index b40311aa..5955b4ed 100644 --- a/rbi/lib/openai/models/vector_store_update_params.rbi +++ b/rbi/lib/openai/models/vector_store_update_params.rbi @@ -40,8 +40,20 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(expires_after: nil, metadata: nil, name: nil, request_options: {}); end - + def self.new( + # The expiration policy for a vector store. + expires_after: nil, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. + # + # Keys are strings with a maximum length of 64 characters. Values are strings with + # a maximum length of 512 characters. + metadata: nil, + # The name of the vector store. + name: nil, + request_options: {} + ); end sig do override .returns( @@ -67,8 +79,13 @@ module OpenAI # The expiration policy for a vector store. sig { params(days: Integer, anchor: Symbol).returns(T.attached_class) } - def self.new(days:, anchor: :last_active_at); end - + def self.new( + # The number of days after the anchor time that the vector store will expire. + days:, + # Anchor timestamp after which the expiration policy applies. Supported anchors: + # `last_active_at`. + anchor: :last_active_at + ); end sig { override.returns({anchor: Symbol, days: Integer}) } def to_hash; end end diff --git a/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi b/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi index f64e4470..9fbb2a61 100644 --- a/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi @@ -60,8 +60,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_ids:, attributes: nil, chunking_strategy: nil, request_options: {}); end - + def self.new( + # A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that + # the vector store should use. Useful for tools like `file_search` that can access + # files. + file_ids:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. Keys are strings with a maximum + # length of 64 characters. Values are strings with a maximum length of 512 + # characters, booleans, or numbers. + attributes: nil, + # The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # strategy. Only applicable if `file_ids` is non-empty. + chunking_strategy: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi b/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi index 041e3c17..d5544112 100644 --- a/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi @@ -67,15 +67,26 @@ module OpenAI end def self.new( vector_store_id:, + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. after: nil, + # A cursor for use in pagination. `before` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # starting with obj_foo, your subsequent call can include before=obj_foo in order + # to fetch the previous page of the list. before: nil, + # Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. filter: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. order: nil, request_options: {} - ) - end - + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_stores/file_content_response.rbi b/rbi/lib/openai/models/vector_stores/file_content_response.rbi index d7f8b8d3..658c26b7 100644 --- a/rbi/lib/openai/models/vector_stores/file_content_response.rbi +++ b/rbi/lib/openai/models/vector_stores/file_content_response.rbi @@ -19,8 +19,12 @@ module OpenAI attr_writer :type sig { params(text: String, type: String).returns(T.attached_class) } - def self.new(text: nil, type: nil); end - + def self.new( + # The text content + text: nil, + # The content type (currently only `"text"`) + type: nil + ); end sig { override.returns({text: String, type: String}) } def to_hash; end end diff --git a/rbi/lib/openai/models/vector_stores/file_create_params.rbi b/rbi/lib/openai/models/vector_stores/file_create_params.rbi index 774e6c2e..17f31378 100644 --- a/rbi/lib/openai/models/vector_stores/file_create_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_create_params.rbi @@ -60,8 +60,22 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(file_id:, attributes: nil, chunking_strategy: nil, request_options: {}); end - + def self.new( + # A [File](https://platform.openai.com/docs/api-reference/files) ID that the + # vector store should use. Useful for tools like `file_search` that can access + # files. + file_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. Keys are strings with a maximum + # length of 64 characters. Values are strings with a maximum length of 512 + # characters, booleans, or numbers. + attributes: nil, + # The chunking strategy used to chunk the file(s). If not set, will use the `auto` + # strategy. Only applicable if `file_ids` is non-empty. + chunking_strategy: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_stores/file_list_params.rbi b/rbi/lib/openai/models/vector_stores/file_list_params.rbi index 0ef2cb3a..5e252bbb 100644 --- a/rbi/lib/openai/models/vector_stores/file_list_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_list_params.rbi @@ -61,8 +61,27 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(after: nil, before: nil, filter: nil, limit: nil, order: nil, request_options: {}); end - + def self.new( + # A cursor for use in pagination. `after` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # ending with obj_foo, your subsequent call can include after=obj_foo in order to + # fetch the next page of the list. + after: nil, + # A cursor for use in pagination. `before` is an object ID that defines your place + # in the list. For instance, if you make a list request and receive 100 objects, + # starting with obj_foo, your subsequent call can include before=obj_foo in order + # to fetch the previous page of the list. + before: nil, + # Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + filter: nil, + # A limit on the number of objects to be returned. Limit can range between 1 and + # 100, and the default is 20. + limit: nil, + # Sort order by the `created_at` timestamp of the objects. `asc` for ascending + # order and `desc` for descending order. + order: nil, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_stores/file_update_params.rbi b/rbi/lib/openai/models/vector_stores/file_update_params.rbi index 41edb9ab..1d18d667 100644 --- a/rbi/lib/openai/models/vector_stores/file_update_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_update_params.rbi @@ -26,8 +26,16 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(vector_store_id:, attributes:, request_options: {}); end - + def self.new( + vector_store_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. Keys are strings with a maximum + # length of 64 characters. Values are strings with a maximum length of 512 + # characters, booleans, or numbers. + attributes:, + request_options: {} + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file.rbi b/rbi/lib/openai/models/vector_stores/vector_store_file.rbi index 72356d37..168da5d5 100644 --- a/rbi/lib/openai/models/vector_stores/vector_store_file.rbi +++ b/rbi/lib/openai/models/vector_stores/vector_store_file.rbi @@ -97,14 +97,34 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The identifier, which can be referenced in API endpoints. id:, + # The Unix timestamp (in seconds) for when the vector store file was created. created_at:, + # The last error associated with this vector store file. Will be `null` if there + # are no errors. last_error:, + # The status of the vector store file, which can be either `in_progress`, + # `completed`, `cancelled`, or `failed`. The status `completed` indicates that the + # vector store file is ready for use. status:, + # The total vector store usage in bytes. Note that this may be different from the + # original file size. usage_bytes:, + # The ID of the + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # that the [File](https://platform.openai.com/docs/api-reference/files) is + # attached to. vector_store_id:, + # Set of 16 key-value pairs that can be attached to an object. This can be useful + # for storing additional information about the object in a structured format, and + # querying for objects via API or the dashboard. Keys are strings with a maximum + # length of 64 characters. Values are strings with a maximum length of 512 + # characters, booleans, or numbers. attributes: nil, + # The strategy used to chunk the file. chunking_strategy: nil, + # The object type, which is always `vector_store.file`. object: :"vector_store.file" ); end sig do @@ -140,8 +160,12 @@ module OpenAI params(code: OpenAI::Models::VectorStores::VectorStoreFile::LastError::Code::OrSymbol, message: String) .returns(T.attached_class) end - def self.new(code:, message:); end - + def self.new( + # One of `server_error` or `rate_limit_exceeded`. + code:, + # A human-readable description of the error. + message: + ); end sig do override .returns( diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi b/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi index 4b1e6a60..18461980 100644 --- a/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi +++ b/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi @@ -53,15 +53,23 @@ module OpenAI .returns(T.attached_class) end def self.new( + # The identifier, which can be referenced in API endpoints. id:, + # The Unix timestamp (in seconds) for when the vector store files batch was + # created. created_at:, file_counts:, + # The status of the vector store files batch, which can be either `in_progress`, + # `completed`, `cancelled` or `failed`. status:, + # The ID of the + # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) + # that the [File](https://platform.openai.com/docs/api-reference/files) is + # attached to. vector_store_id:, + # The object type, which is always `vector_store.file_batch`. object: :"vector_store.files_batch" - ) - end - + ); end sig do override .returns( @@ -108,8 +116,18 @@ module OpenAI ) .returns(T.attached_class) end - def self.new(cancelled:, completed:, failed:, in_progress:, total:); end - + def self.new( + # The number of files that where cancelled. + cancelled:, + # The number of files that have been processed. + completed:, + # The number of files that have failed to process. + failed:, + # The number of files that are currently being processed. + in_progress:, + # The total number of files. + total: + ); end sig do override .returns({ From ece942cb2c7982ed73e20321318a0f8634c22023 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 18:59:25 +0000 Subject: [PATCH 14/33] feat: support specifying content-type with FilePart class --- lib/openai.rb | 3 +- lib/openai/file_part.rb | 55 +++++++++++ lib/openai/internal/type/converter.rb | 2 +- .../type/{io_like.rb => file_input.rb} | 12 ++- lib/openai/internal/util.rb | 96 ++++++++++--------- .../audio/transcription_create_params.rb | 6 +- .../models/audio/translation_create_params.rb | 6 +- lib/openai/models/file_create_params.rb | 6 +- .../models/image_create_variation_params.rb | 6 +- lib/openai/models/image_edit_params.rb | 14 +-- .../models/uploads/part_create_params.rb | 6 +- lib/openai/resources/audio/transcriptions.rb | 4 +- lib/openai/resources/audio/translations.rb | 2 +- lib/openai/resources/files.rb | 2 +- lib/openai/resources/images.rb | 6 +- lib/openai/resources/uploads/parts.rb | 2 +- rbi/lib/openai/file_part.rbi | 34 +++++++ .../type/{io_like.rbi => file_input.rbi} | 8 +- rbi/lib/openai/internal/util.rbi | 28 +++--- .../audio/transcription_create_params.rbi | 6 +- .../audio/translation_create_params.rbi | 6 +- rbi/lib/openai/models/file_create_params.rbi | 6 +- .../models/image_create_variation_params.rbi | 6 +- rbi/lib/openai/models/image_edit_params.rbi | 38 ++++++-- .../models/uploads/part_create_params.rbi | 12 ++- .../openai/resources/audio/transcriptions.rbi | 4 +- .../openai/resources/audio/translations.rbi | 2 +- rbi/lib/openai/resources/files.rbi | 2 +- rbi/lib/openai/resources/images.rbi | 12 ++- rbi/lib/openai/resources/uploads/parts.rbi | 2 +- sig/openai/file_part.rbs | 21 ++++ .../type/{io_like.rbs => file_input.rbs} | 2 +- sig/openai/internal/util.rbs | 17 ++-- .../audio/transcription_create_params.rbs | 6 +- .../audio/translation_create_params.rbs | 6 +- sig/openai/models/file_create_params.rbs | 9 +- .../models/image_create_variation_params.rbs | 6 +- sig/openai/models/image_edit_params.rbs | 19 ++-- .../models/uploads/part_create_params.rbs | 6 +- sig/openai/resources/audio/transcriptions.rbs | 4 +- sig/openai/resources/audio/translations.rbs | 2 +- sig/openai/resources/files.rbs | 2 +- sig/openai/resources/images.rbs | 4 +- sig/openai/resources/uploads/parts.rbs | 2 +- test/openai/internal/type/base_model_test.rb | 2 +- test/openai/internal/util_test.rb | 14 ++- 46 files changed, 342 insertions(+), 174 deletions(-) create mode 100644 lib/openai/file_part.rb rename lib/openai/internal/type/{io_like.rb => file_input.rb} (84%) create mode 100644 rbi/lib/openai/file_part.rbi rename rbi/lib/openai/internal/type/{io_like.rbi => file_input.rbi} (83%) create mode 100644 sig/openai/file_part.rbs rename sig/openai/internal/type/{io_like.rbs => file_input.rbs} (96%) diff --git a/lib/openai.rb b/lib/openai.rb index 5bd82a3c..0883b56f 100644 --- a/lib/openai.rb +++ b/lib/openai.rb @@ -31,7 +31,7 @@ require_relative "openai/internal/type/converter" require_relative "openai/internal/type/unknown" require_relative "openai/internal/type/boolean" -require_relative "openai/internal/type/io_like" +require_relative "openai/internal/type/file_input" require_relative "openai/internal/type/enum" require_relative "openai/internal/type/union" require_relative "openai/internal/type/array_of" @@ -42,6 +42,7 @@ require_relative "openai/internal/type/request_parameters" require_relative "openai/internal" require_relative "openai/request_options" +require_relative "openai/file_part" require_relative "openai/errors" require_relative "openai/internal/transport/base_client" require_relative "openai/internal/transport/pooled_net_requester" diff --git a/lib/openai/file_part.rb b/lib/openai/file_part.rb new file mode 100644 index 00000000..f17371ec --- /dev/null +++ b/lib/openai/file_part.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module OpenAI + class FilePart + # @return [Pathname, StringIO, IO, String] + attr_reader :content + + # @return [String, nil] + attr_reader :content_type + + # @return [String, nil] + attr_reader :filename + + # @api private + # + # @return [String] + private def read + case contents + in Pathname + contents.read(binmode: true) + in StringIO + contents.string + in IO + contents.read + in String + contents + end + end + + # @param a [Object] + # + # @return [String] + def to_json(*a) = read.to_json(*a) + + # @param a [Object] + # + # @return [String] + def to_yaml(*a) = read.to_yaml(*a) + + # @param content [Pathname, StringIO, IO, String] + # @param filename [String, nil] + # @param content_type [String, nil] + def initialize(content, filename: nil, content_type: nil) + @content = content + @filename = + case content + in Pathname + filename.nil? ? content.basename.to_path : File.basename(filename) + else + filename.nil? ? nil : File.basename(filename) + end + @content_type = content_type + end + end +end diff --git a/lib/openai/internal/type/converter.rb b/lib/openai/internal/type/converter.rb index 1cd4385d..0b58d3b0 100644 --- a/lib/openai/internal/type/converter.rb +++ b/lib/openai/internal/type/converter.rb @@ -43,7 +43,7 @@ def dump(value, state:) value.string in Pathname | IO state[:can_retry] = false if value.is_a?(IO) - OpenAI::Internal::Util::SerializationAdapter.new(value) + OpenAI::FilePart.new(value) else value end diff --git a/lib/openai/internal/type/io_like.rb b/lib/openai/internal/type/file_input.rb similarity index 84% rename from lib/openai/internal/type/io_like.rb rename to lib/openai/internal/type/file_input.rb index 568418be..892a1761 100644 --- a/lib/openai/internal/type/io_like.rb +++ b/lib/openai/internal/type/file_input.rb @@ -7,8 +7,12 @@ module Type # # @abstract # - # Either `Pathname` or `StringIO`. - class IOLike + # Either `Pathname` or `StringIO`, or `IO`, or + # `OpenAI::Internal::Type::FileInput`. + # + # Note: when `IO` is used, all retries are disabled, since many IO` streams are + # not rewindable. + class FileInput extend OpenAI::Internal::Type::Converter private_class_method :new @@ -20,7 +24,7 @@ class IOLike # @return [Boolean] def self.===(other) case other - in StringIO | Pathname | IO + in Pathname | StringIO | IO | String | OpenAI::FilePart true else false @@ -32,7 +36,7 @@ def self.===(other) # @param other [Object] # # @return [Boolean] - def self.==(other) = other.is_a?(Class) && other <= OpenAI::Internal::Type::IOLike + def self.==(other) = other.is_a?(Class) && other <= OpenAI::Internal::Type::FileInput class << self # @api private diff --git a/lib/openai/internal/util.rb b/lib/openai/internal/util.rb index fa6aec64..7b82110b 100644 --- a/lib/openai/internal/util.rb +++ b/lib/openai/internal/util.rb @@ -348,27 +348,6 @@ def normalized_headers(*headers) end end - # @api private - class SerializationAdapter - # @return [Pathname, IO] - attr_reader :inner - - # @param a [Object] - # - # @return [String] - def to_json(*a) = (inner.is_a?(IO) ? inner.read : inner.read(binmode: true)).to_json(*a) - - # @param a [Object] - # - # @return [String] - def to_yaml(*a) = (inner.is_a?(IO) ? inner.read : inner.read(binmode: true)).to_yaml(*a) - - # @api private - # - # @param inner [Pathname, IO] - def initialize(inner) = @inner = inner - end - # @api private # # An adapter that satisfies the IO interface required by `::IO.copy_stream` @@ -480,42 +459,35 @@ class << self # @api private # # @param y [Enumerator::Yielder] - # @param boundary [String] - # @param key [Symbol, String] # @param val [Object] # @param closing [Array] - private def write_multipart_chunk(y, boundary:, key:, val:, closing:) - val = val.inner if val.is_a?(OpenAI::Internal::Util::SerializationAdapter) + # @param content_type [String, nil] + private def write_multipart_content(y, val:, closing:, content_type: nil) + content_type ||= "application/octet-stream" - y << "--#{boundary}\r\n" - y << "Content-Disposition: form-data" - unless key.nil? - name = ERB::Util.url_encode(key.to_s) - y << "; name=\"#{name}\"" - end - case val - in Pathname | IO - filename = ERB::Util.url_encode(File.basename(val.to_path)) - y << "; filename=\"#{filename}\"" - else - end - y << "\r\n" case val + in OpenAI::FilePart + return write_multipart_content( + y, + val: val.content, + closing: closing, + content_type: val.content_type + ) in Pathname - y << "Content-Type: application/octet-stream\r\n\r\n" + y << "Content-Type: #{content_type}\r\n\r\n" io = val.open(binmode: true) closing << io.method(:close) IO.copy_stream(io, y) in IO - y << "Content-Type: application/octet-stream\r\n\r\n" + y << "Content-Type: #{content_type}\r\n\r\n" IO.copy_stream(val, y) in StringIO - y << "Content-Type: application/octet-stream\r\n\r\n" + y << "Content-Type: #{content_type}\r\n\r\n" y << val.string in String - y << "Content-Type: application/octet-stream\r\n\r\n" + y << "Content-Type: #{content_type}\r\n\r\n" y << val.to_s - in _ if primitive?(val) + in -> { primitive?(_1) } y << "Content-Type: text/plain\r\n\r\n" y << val.to_s else @@ -525,6 +497,36 @@ class << self y << "\r\n" end + # @api private + # + # @param y [Enumerator::Yielder] + # @param boundary [String] + # @param key [Symbol, String] + # @param val [Object] + # @param closing [Array] + private def write_multipart_chunk(y, boundary:, key:, val:, closing:) + y << "--#{boundary}\r\n" + y << "Content-Disposition: form-data" + + unless key.nil? + name = ERB::Util.url_encode(key.to_s) + y << "; name=\"#{name}\"" + end + + case val + in OpenAI::FilePart unless val.filename.nil? + filename = ERB::Util.url_encode(val.filename) + y << "; filename=\"#{filename}\"" + in Pathname | IO + filename = ERB::Util.url_encode(File.basename(val.to_path)) + y << "; filename=\"#{filename}\"" + else + end + y << "\r\n" + + write_multipart_content(y, val: val, closing: closing) + end + # @api private # # @param body [Object] @@ -565,14 +567,12 @@ class << self # @return [Object] def encode_content(headers, body) content_type = headers["content-type"] - body = body.inner if body.is_a?(OpenAI::Internal::Util::SerializationAdapter) - case [content_type, body] in [OpenAI::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }] [headers, JSON.fast_generate(body)] - in [OpenAI::Internal::Util::JSONL_CONTENT, Enumerable] unless body.is_a?(StringIO) || body.is_a?(IO) + in [OpenAI::Internal::Util::JSONL_CONTENT, Enumerable] unless body.is_a?(OpenAI::Internal::Type::FileInput) [headers, body.lazy.map { JSON.fast_generate(_1) }] - in [%r{^multipart/form-data}, Hash | Pathname | StringIO | IO] + in [%r{^multipart/form-data}, Hash | OpenAI::Internal::Type::FileInput] boundary, strio = encode_multipart_streaming(body) headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} [headers, strio] @@ -580,6 +580,8 @@ def encode_content(headers, body) [headers, body.to_s] in [_, StringIO] [headers, body.string] + in [_, OpenAI::FilePart] + [headers, body.content] else [headers, body] end diff --git a/lib/openai/models/audio/transcription_create_params.rb b/lib/openai/models/audio/transcription_create_params.rb index ccb71b14..c9efed38 100644 --- a/lib/openai/models/audio/transcription_create_params.rb +++ b/lib/openai/models/audio/transcription_create_params.rb @@ -14,8 +14,8 @@ class TranscriptionCreateParams < OpenAI::Internal::Type::BaseModel # The audio file object (not file name) to transcribe, in one of these formats: # flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. # - # @return [Pathname, StringIO] - required :file, OpenAI::Internal::Type::IOLike + # @return [Pathname, StringIO, IO, OpenAI::FilePart] + required :file, OpenAI::Internal::Type::FileInput # @!attribute model # ID of the model to use. The options are `gpt-4o-transcribe`, @@ -86,7 +86,7 @@ class TranscriptionCreateParams < OpenAI::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {OpenAI::Models::Audio::TranscriptionCreateParams} for more details. # - # @param file [Pathname, StringIO] The audio file object (not file name) to transcribe, in one of these formats: fl + # @param file [Pathname, StringIO, IO, OpenAI::FilePart] The audio file object (not file name) to transcribe, in one of these formats: fl # ... # # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc diff --git a/lib/openai/models/audio/translation_create_params.rb b/lib/openai/models/audio/translation_create_params.rb index a933aaa9..d5ab1b8d 100644 --- a/lib/openai/models/audio/translation_create_params.rb +++ b/lib/openai/models/audio/translation_create_params.rb @@ -12,8 +12,8 @@ class TranslationCreateParams < OpenAI::Internal::Type::BaseModel # The audio file object (not file name) translate, in one of these formats: flac, # mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. # - # @return [Pathname, StringIO] - required :file, OpenAI::Internal::Type::IOLike + # @return [Pathname, StringIO, IO, OpenAI::FilePart] + required :file, OpenAI::Internal::Type::FileInput # @!attribute model # ID of the model to use. Only `whisper-1` (which is powered by our open source @@ -52,7 +52,7 @@ class TranslationCreateParams < OpenAI::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {OpenAI::Models::Audio::TranslationCreateParams} for more details. # - # @param file [Pathname, StringIO] The audio file object (not file name) translate, in one of these formats: flac, + # @param file [Pathname, StringIO, IO, OpenAI::FilePart] The audio file object (not file name) translate, in one of these formats: flac, # ... # # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. Only `whisper-1` (which is powered by our open source Wh diff --git a/lib/openai/models/file_create_params.rb b/lib/openai/models/file_create_params.rb index 94e5f46f..d5062f4d 100644 --- a/lib/openai/models/file_create_params.rb +++ b/lib/openai/models/file_create_params.rb @@ -10,8 +10,8 @@ class FileCreateParams < OpenAI::Internal::Type::BaseModel # @!attribute file # The File object (not file name) to be uploaded. # - # @return [Pathname, StringIO] - required :file, OpenAI::Internal::Type::IOLike + # @return [Pathname, StringIO, IO, OpenAI::FilePart] + required :file, OpenAI::Internal::Type::FileInput # @!attribute purpose # The intended purpose of the uploaded file. One of: - `assistants`: Used in the @@ -26,7 +26,7 @@ class FileCreateParams < OpenAI::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {OpenAI::Models::FileCreateParams} for more details. # - # @param file [Pathname, StringIO] The File object (not file name) to be uploaded. ... + # @param file [Pathname, StringIO, IO, OpenAI::FilePart] The File object (not file name) to be uploaded. ... # # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of: - `assistants`: Used in the A # ... diff --git a/lib/openai/models/image_create_variation_params.rb b/lib/openai/models/image_create_variation_params.rb index d3b45a32..6dc339d5 100644 --- a/lib/openai/models/image_create_variation_params.rb +++ b/lib/openai/models/image_create_variation_params.rb @@ -11,8 +11,8 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel # The image to use as the basis for the variation(s). Must be a valid PNG file, # less than 4MB, and square. # - # @return [Pathname, StringIO] - required :image, OpenAI::Internal::Type::IOLike + # @return [Pathname, StringIO, IO, OpenAI::FilePart] + required :image, OpenAI::Internal::Type::FileInput # @!attribute model # The model to use for image generation. Only `dall-e-2` is supported at this @@ -56,7 +56,7 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {OpenAI::Models::ImageCreateVariationParams} for more details. # - # @param image [Pathname, StringIO] The image to use as the basis for the variation(s). Must be a valid PNG file, le + # @param image [Pathname, StringIO, IO, OpenAI::FilePart] The image to use as the basis for the variation(s). Must be a valid PNG file, le # ... # # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` is supported at this time diff --git a/lib/openai/models/image_edit_params.rb b/lib/openai/models/image_edit_params.rb index 45591d12..33526447 100644 --- a/lib/openai/models/image_edit_params.rb +++ b/lib/openai/models/image_edit_params.rb @@ -13,7 +13,7 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square # `png` file less than 4MB. # - # @return [Pathname, StringIO, Array] + # @return [Pathname, StringIO, IO, OpenAI::FilePart, Array] required :image, union: -> { OpenAI::Models::ImageEditParams::Image } # @!attribute prompt @@ -29,8 +29,8 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # the mask will be applied on the first image. Must be a valid PNG file, less than # 4MB, and have the same dimensions as `image`. # - # @return [Pathname, StringIO, nil] - optional :mask, OpenAI::Internal::Type::IOLike + # @return [Pathname, StringIO, IO, OpenAI::FilePart, nil] + optional :mask, OpenAI::Internal::Type::FileInput # @!attribute model # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are @@ -83,13 +83,13 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {OpenAI::Models::ImageEditParams} for more details. # - # @param image [Pathname, StringIO, Array] The image(s) to edit. Must be a supported image file or an array of images. For + # @param image [Pathname, StringIO, IO, OpenAI::FilePart, Array] The image(s) to edit. Must be a supported image file or an array of images. For # ... # # @param prompt [String] A text description of the desired image(s). The maximum length is 1000 character # ... # - # @param mask [Pathname, StringIO] An additional image whose fully transparent areas (e.g. where alpha is zero) ind + # @param mask [Pathname, StringIO, IO, OpenAI::FilePart] An additional image whose fully transparent areas (e.g. where alpha is zero) ind # ... # # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are sup @@ -118,14 +118,14 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel module Image extend OpenAI::Internal::Type::Union - variant OpenAI::Internal::Type::IOLike + variant OpenAI::Internal::Type::FileInput variant -> { OpenAI::Models::ImageEditParams::Image::StringArray } # @!method self.variants # @return [Array(StringIO, Array)] - StringArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::IOLike] + StringArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::FileInput] end # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are diff --git a/lib/openai/models/uploads/part_create_params.rb b/lib/openai/models/uploads/part_create_params.rb index d4e1d7bf..df8520b6 100644 --- a/lib/openai/models/uploads/part_create_params.rb +++ b/lib/openai/models/uploads/part_create_params.rb @@ -11,14 +11,14 @@ class PartCreateParams < OpenAI::Internal::Type::BaseModel # @!attribute data # The chunk of bytes for this Part. # - # @return [Pathname, StringIO] - required :data, OpenAI::Internal::Type::IOLike + # @return [Pathname, StringIO, IO, OpenAI::FilePart] + required :data, OpenAI::Internal::Type::FileInput # @!method initialize(data:, request_options: {}) # Some parameter documentations has been truncated, see # {OpenAI::Models::Uploads::PartCreateParams} for more details. # - # @param data [Pathname, StringIO] The chunk of bytes for this Part. ... + # @param data [Pathname, StringIO, IO, OpenAI::FilePart] The chunk of bytes for this Part. ... # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/openai/resources/audio/transcriptions.rb b/lib/openai/resources/audio/transcriptions.rb index d7f5de3e..a3fc4454 100644 --- a/lib/openai/resources/audio/transcriptions.rb +++ b/lib/openai/resources/audio/transcriptions.rb @@ -14,7 +14,7 @@ class Transcriptions # # @overload create(file:, model:, include: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) # - # @param file [Pathname, StringIO] The audio file object (not file name) to transcribe, in one of these formats: fl + # @param file [Pathname, StringIO, IO, OpenAI::FilePart] The audio file object (not file name) to transcribe, in one of these formats: fl # ... # # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc @@ -68,7 +68,7 @@ def create(params) # # @overload create_streaming(file:, model:, include: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) # - # @param file [Pathname, StringIO] The audio file object (not file name) to transcribe, in one of these formats: fl + # @param file [Pathname, StringIO, IO, OpenAI::FilePart] The audio file object (not file name) to transcribe, in one of these formats: fl # ... # # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc diff --git a/lib/openai/resources/audio/translations.rb b/lib/openai/resources/audio/translations.rb index d52be7ea..0a43a53a 100644 --- a/lib/openai/resources/audio/translations.rb +++ b/lib/openai/resources/audio/translations.rb @@ -11,7 +11,7 @@ class Translations # # @overload create(file:, model:, prompt: nil, response_format: nil, temperature: nil, request_options: {}) # - # @param file [Pathname, StringIO] The audio file object (not file name) translate, in one of these formats: flac, + # @param file [Pathname, StringIO, IO, OpenAI::FilePart] The audio file object (not file name) translate, in one of these formats: flac, # ... # # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. Only `whisper-1` (which is powered by our open source Wh diff --git a/lib/openai/resources/files.rb b/lib/openai/resources/files.rb index 726182c0..77ba2646 100644 --- a/lib/openai/resources/files.rb +++ b/lib/openai/resources/files.rb @@ -30,7 +30,7 @@ class Files # # @overload create(file:, purpose:, request_options: {}) # - # @param file [Pathname, StringIO] The File object (not file name) to be uploaded. ... + # @param file [Pathname, StringIO, IO, OpenAI::FilePart] The File object (not file name) to be uploaded. ... # # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of: - `assistants`: Used in the A # ... diff --git a/lib/openai/resources/images.rb b/lib/openai/resources/images.rb index e5f8f465..f34671b0 100644 --- a/lib/openai/resources/images.rb +++ b/lib/openai/resources/images.rb @@ -10,7 +10,7 @@ class Images # # @overload create_variation(image:, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) # - # @param image [Pathname, StringIO] The image to use as the basis for the variation(s). Must be a valid PNG file, le + # @param image [Pathname, StringIO, IO, OpenAI::FilePart] The image to use as the basis for the variation(s). Must be a valid PNG file, le # ... # # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` is supported at this time @@ -52,13 +52,13 @@ def create_variation(params) # # @overload edit(image:, prompt:, mask: nil, model: nil, n: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {}) # - # @param image [Pathname, StringIO, Array] The image(s) to edit. Must be a supported image file or an array of images. For + # @param image [Pathname, StringIO, IO, OpenAI::FilePart, Array] The image(s) to edit. Must be a supported image file or an array of images. For # ... # # @param prompt [String] A text description of the desired image(s). The maximum length is 1000 character # ... # - # @param mask [Pathname, StringIO] An additional image whose fully transparent areas (e.g. where alpha is zero) ind + # @param mask [Pathname, StringIO, IO, OpenAI::FilePart] An additional image whose fully transparent areas (e.g. where alpha is zero) ind # ... # # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are sup diff --git a/lib/openai/resources/uploads/parts.rb b/lib/openai/resources/uploads/parts.rb index b0e572a1..3d7e4770 100644 --- a/lib/openai/resources/uploads/parts.rb +++ b/lib/openai/resources/uploads/parts.rb @@ -23,7 +23,7 @@ class Parts # # @param upload_id [String] The ID of the Upload. ... # - # @param data [Pathname, StringIO] The chunk of bytes for this Part. ... + # @param data [Pathname, StringIO, IO, OpenAI::FilePart] The chunk of bytes for this Part. ... # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/rbi/lib/openai/file_part.rbi b/rbi/lib/openai/file_part.rbi new file mode 100644 index 00000000..20c06b85 --- /dev/null +++ b/rbi/lib/openai/file_part.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module OpenAI + class FilePart + sig { returns(T.any(Pathname, StringIO, IO, String)) } + attr_reader :content + + sig { returns(T.nilable(String)) } + attr_reader :content_type + + sig { returns(T.nilable(String)) } + attr_reader :filename + + # @api private + sig { returns(String) } + private def read; end + + sig { params(a: T.anything).returns(String) } + def to_json(*a); end + + sig { params(a: T.anything).returns(String) } + def to_yaml(*a); end + + sig do + params( + content: T.any(Pathname, StringIO, IO, String), + filename: T.nilable(String), + content_type: T.nilable(String) + ) + .returns(T.attached_class) + end + def self.new(content, filename: nil, content_type: nil); end + end +end diff --git a/rbi/lib/openai/internal/type/io_like.rbi b/rbi/lib/openai/internal/type/file_input.rbi similarity index 83% rename from rbi/lib/openai/internal/type/io_like.rbi rename to rbi/lib/openai/internal/type/file_input.rbi index 321a5563..5271aa5e 100644 --- a/rbi/lib/openai/internal/type/io_like.rbi +++ b/rbi/lib/openai/internal/type/file_input.rbi @@ -5,8 +5,12 @@ module OpenAI module Type # @api private # - # Either `Pathname` or `StringIO`. - class IOLike + # Either `Pathname` or `StringIO`, or `IO`, or + # `OpenAI::Internal::Type::FileInput`. + # + # Note: when `IO` is used, all retries are disabled, since many IO` streams are + # not rewindable. + class FileInput extend OpenAI::Internal::Type::Converter abstract! diff --git a/rbi/lib/openai/internal/util.rbi b/rbi/lib/openai/internal/util.rbi index f1ca8cb7..70758fde 100644 --- a/rbi/lib/openai/internal/util.rbi +++ b/rbi/lib/openai/internal/util.rbi @@ -140,22 +140,6 @@ module OpenAI def normalized_headers(*headers); end end - # @api private - class SerializationAdapter - sig { returns(T.any(Pathname, IO)) } - attr_reader :inner - - sig { params(a: T.anything).returns(String) } - def to_json(*a); end - - sig { params(a: T.anything).returns(String) } - def to_yaml(*a); end - - # @api private - sig { params(inner: T.any(Pathname, IO)).returns(T.attached_class) } - def self.new(inner); end - end - # @api private # # An adapter that satisfies the IO interface required by `::IO.copy_stream` @@ -196,6 +180,18 @@ module OpenAI JSONL_CONTENT = T.let(%r{^application/(?:x-)?jsonl}, Regexp) class << self + # @api private + sig do + params( + y: Enumerator::Yielder, + val: T.anything, + closing: T::Array[T.proc.void], + content_type: T.nilable(String) + ) + .void + end + private def write_multipart_content(y, val:, closing:, content_type: nil); end + # @api private sig do params( diff --git a/rbi/lib/openai/models/audio/transcription_create_params.rbi b/rbi/lib/openai/models/audio/transcription_create_params.rbi index f89a401f..57d34b34 100644 --- a/rbi/lib/openai/models/audio/transcription_create_params.rbi +++ b/rbi/lib/openai/models/audio/transcription_create_params.rbi @@ -9,7 +9,7 @@ module OpenAI # The audio file object (not file name) to transcribe, in one of these formats: # flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - sig { returns(T.any(Pathname, StringIO)) } + sig { returns(T.any(Pathname, StringIO, IO, OpenAI::FilePart)) } attr_accessor :file # ID of the model to use. The options are `gpt-4o-transcribe`, @@ -90,7 +90,7 @@ module OpenAI sig do params( - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.any(String, OpenAI::Models::AudioModel::OrSymbol), include: T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol], language: String, @@ -147,7 +147,7 @@ module OpenAI override .returns( { - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.any(String, OpenAI::Models::AudioModel::OrSymbol), include: T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol], language: String, diff --git a/rbi/lib/openai/models/audio/translation_create_params.rbi b/rbi/lib/openai/models/audio/translation_create_params.rbi index 807e0bb2..77933b04 100644 --- a/rbi/lib/openai/models/audio/translation_create_params.rbi +++ b/rbi/lib/openai/models/audio/translation_create_params.rbi @@ -9,7 +9,7 @@ module OpenAI # The audio file object (not file name) translate, in one of these formats: flac, # mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - sig { returns(T.any(Pathname, StringIO)) } + sig { returns(T.any(Pathname, StringIO, IO, OpenAI::FilePart)) } attr_accessor :file # ID of the model to use. Only `whisper-1` (which is powered by our open source @@ -48,7 +48,7 @@ module OpenAI sig do params( - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.any(String, OpenAI::Models::AudioModel::OrSymbol), prompt: String, response_format: OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol, @@ -84,7 +84,7 @@ module OpenAI override .returns( { - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.any(String, OpenAI::Models::AudioModel::OrSymbol), prompt: String, response_format: OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol, diff --git a/rbi/lib/openai/models/file_create_params.rbi b/rbi/lib/openai/models/file_create_params.rbi index 2580e280..675c3c74 100644 --- a/rbi/lib/openai/models/file_create_params.rbi +++ b/rbi/lib/openai/models/file_create_params.rbi @@ -7,7 +7,7 @@ module OpenAI include OpenAI::Internal::Type::RequestParameters # The File object (not file name) to be uploaded. - sig { returns(T.any(Pathname, StringIO)) } + sig { returns(T.any(Pathname, StringIO, IO, OpenAI::FilePart)) } attr_accessor :file # The intended purpose of the uploaded file. One of: - `assistants`: Used in the @@ -19,7 +19,7 @@ module OpenAI sig do params( - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), purpose: OpenAI::Models::FilePurpose::OrSymbol, request_options: T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash) ) @@ -39,7 +39,7 @@ module OpenAI override .returns( { - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), purpose: OpenAI::Models::FilePurpose::OrSymbol, request_options: OpenAI::RequestOptions } diff --git a/rbi/lib/openai/models/image_create_variation_params.rbi b/rbi/lib/openai/models/image_create_variation_params.rbi index 96899fe5..361f3512 100644 --- a/rbi/lib/openai/models/image_create_variation_params.rbi +++ b/rbi/lib/openai/models/image_create_variation_params.rbi @@ -8,7 +8,7 @@ module OpenAI # The image to use as the basis for the variation(s). Must be a valid PNG file, # less than 4MB, and square. - sig { returns(T.any(Pathname, StringIO)) } + sig { returns(T.any(Pathname, StringIO, IO, OpenAI::FilePart)) } attr_accessor :image # The model to use for image generation. Only `dall-e-2` is supported at this @@ -42,7 +42,7 @@ module OpenAI sig do params( - image: T.any(Pathname, StringIO), + image: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), response_format: T.nilable(OpenAI::Models::ImageCreateVariationParams::ResponseFormat::OrSymbol), @@ -78,7 +78,7 @@ module OpenAI override .returns( { - image: T.any(Pathname, StringIO), + image: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), response_format: T.nilable(OpenAI::Models::ImageCreateVariationParams::ResponseFormat::OrSymbol), diff --git a/rbi/lib/openai/models/image_edit_params.rbi b/rbi/lib/openai/models/image_edit_params.rbi index 68d09cd7..4ae05e29 100644 --- a/rbi/lib/openai/models/image_edit_params.rbi +++ b/rbi/lib/openai/models/image_edit_params.rbi @@ -10,7 +10,17 @@ module OpenAI # `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than # 25MB. For `dall-e-2`, you can only provide one image, and it should be a square # `png` file less than 4MB. - sig { returns(T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)])) } + sig do + returns( + T.any( + Pathname, + StringIO, + IO, + OpenAI::FilePart, + T::Array[T.any(Pathname, StringIO, IO, OpenAI::FilePart)] + ) + ) + end attr_accessor :image # A text description of the desired image(s). The maximum length is 1000 @@ -22,10 +32,10 @@ module OpenAI # indicate where `image` should be edited. If there are multiple images provided, # the mask will be applied on the first image. Must be a valid PNG file, less than # 4MB, and have the same dimensions as `image`. - sig { returns(T.nilable(T.any(Pathname, StringIO))) } + sig { returns(T.nilable(T.any(Pathname, StringIO, IO, OpenAI::FilePart))) } attr_reader :mask - sig { params(mask: T.any(Pathname, StringIO)).void } + sig { params(mask: T.any(Pathname, StringIO, IO, OpenAI::FilePart)).void } attr_writer :mask # The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are @@ -68,9 +78,15 @@ module OpenAI sig do params( - image: T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)]), + image: T.any( + Pathname, + StringIO, + IO, + OpenAI::FilePart, + T::Array[T.any(Pathname, StringIO, IO, OpenAI::FilePart)] + ), prompt: String, - mask: T.any(Pathname, StringIO), + mask: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), quality: T.nilable(OpenAI::Models::ImageEditParams::Quality::OrSymbol), @@ -124,9 +140,15 @@ module OpenAI override .returns( { - image: T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)]), + image: T.any( + Pathname, + StringIO, + IO, + OpenAI::FilePart, + T::Array[T.any(Pathname, StringIO, IO, OpenAI::FilePart)] + ), prompt: String, - mask: T.any(Pathname, StringIO), + mask: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), quality: T.nilable(OpenAI::Models::ImageEditParams::Quality::OrSymbol), @@ -151,7 +173,7 @@ module OpenAI StringArray = T.let( - OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::IOLike], + OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::FileInput], OpenAI::Internal::Type::Converter ) end diff --git a/rbi/lib/openai/models/uploads/part_create_params.rbi b/rbi/lib/openai/models/uploads/part_create_params.rbi index 1a62a478..e8d07b06 100644 --- a/rbi/lib/openai/models/uploads/part_create_params.rbi +++ b/rbi/lib/openai/models/uploads/part_create_params.rbi @@ -8,12 +8,12 @@ module OpenAI include OpenAI::Internal::Type::RequestParameters # The chunk of bytes for this Part. - sig { returns(T.any(Pathname, StringIO)) } + sig { returns(T.any(Pathname, StringIO, IO, OpenAI::FilePart)) } attr_accessor :data sig do params( - data: T.any(Pathname, StringIO), + data: T.any(Pathname, StringIO, IO, OpenAI::FilePart), request_options: T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash) ) .returns(T.attached_class) @@ -23,7 +23,13 @@ module OpenAI data:, request_options: {} ); end - sig { override.returns({data: T.any(Pathname, StringIO), request_options: OpenAI::RequestOptions}) } + sig do + override + .returns({ + data: T.any(Pathname, StringIO, IO, OpenAI::FilePart), + request_options: OpenAI::RequestOptions + }) + end def to_hash; end end end diff --git a/rbi/lib/openai/resources/audio/transcriptions.rbi b/rbi/lib/openai/resources/audio/transcriptions.rbi index a411c389..45316428 100644 --- a/rbi/lib/openai/resources/audio/transcriptions.rbi +++ b/rbi/lib/openai/resources/audio/transcriptions.rbi @@ -10,7 +10,7 @@ module OpenAI # Transcribes audio into the input language. sig do params( - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.any(String, OpenAI::Models::AudioModel::OrSymbol), include: T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol], language: String, @@ -73,7 +73,7 @@ module OpenAI # Transcribes audio into the input language. sig do params( - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.any(String, OpenAI::Models::AudioModel::OrSymbol), include: T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol], language: String, diff --git a/rbi/lib/openai/resources/audio/translations.rbi b/rbi/lib/openai/resources/audio/translations.rbi index c11c0bde..b9130883 100644 --- a/rbi/lib/openai/resources/audio/translations.rbi +++ b/rbi/lib/openai/resources/audio/translations.rbi @@ -7,7 +7,7 @@ module OpenAI # Translates audio into English. sig do params( - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.any(String, OpenAI::Models::AudioModel::OrSymbol), prompt: String, response_format: OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol, diff --git a/rbi/lib/openai/resources/files.rbi b/rbi/lib/openai/resources/files.rbi index 182dba52..aa872185 100644 --- a/rbi/lib/openai/resources/files.rbi +++ b/rbi/lib/openai/resources/files.rbi @@ -26,7 +26,7 @@ module OpenAI # storage limits. sig do params( - file: T.any(Pathname, StringIO), + file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), purpose: OpenAI::Models::FilePurpose::OrSymbol, request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) ) diff --git a/rbi/lib/openai/resources/images.rbi b/rbi/lib/openai/resources/images.rbi index 7e97700a..f50d6486 100644 --- a/rbi/lib/openai/resources/images.rbi +++ b/rbi/lib/openai/resources/images.rbi @@ -6,7 +6,7 @@ module OpenAI # Creates a variation of a given image. This endpoint only supports `dall-e-2`. sig do params( - image: T.any(Pathname, StringIO), + image: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), response_format: T.nilable(OpenAI::Models::ImageCreateVariationParams::ResponseFormat::OrSymbol), @@ -42,9 +42,15 @@ module OpenAI # prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`. sig do params( - image: T.any(Pathname, StringIO, T::Array[T.any(Pathname, StringIO)]), + image: T.any( + Pathname, + StringIO, + IO, + OpenAI::FilePart, + T::Array[T.any(Pathname, StringIO, IO, OpenAI::FilePart)] + ), prompt: String, - mask: T.any(Pathname, StringIO), + mask: T.any(Pathname, StringIO, IO, OpenAI::FilePart), model: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol)), n: T.nilable(Integer), quality: T.nilable(OpenAI::Models::ImageEditParams::Quality::OrSymbol), diff --git a/rbi/lib/openai/resources/uploads/parts.rbi b/rbi/lib/openai/resources/uploads/parts.rbi index 8258aeea..867a760a 100644 --- a/rbi/lib/openai/resources/uploads/parts.rbi +++ b/rbi/lib/openai/resources/uploads/parts.rbi @@ -18,7 +18,7 @@ module OpenAI sig do params( upload_id: String, - data: T.any(Pathname, StringIO), + data: T.any(Pathname, StringIO, IO, OpenAI::FilePart), request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) ) .returns(OpenAI::Models::Uploads::UploadPart) diff --git a/sig/openai/file_part.rbs b/sig/openai/file_part.rbs new file mode 100644 index 00000000..c517bee8 --- /dev/null +++ b/sig/openai/file_part.rbs @@ -0,0 +1,21 @@ +module OpenAI + class FilePart + attr_reader content: Pathname | StringIO | IO | String + + attr_reader content_type: String? + + attr_reader filename: String? + + private def read: -> String + + def to_json: (*top a) -> String + + def to_yaml: (*top a) -> String + + def initialize: ( + Pathname | StringIO | IO | String content, + ?filename: String?, + ?content_type: String? + ) -> void + end +end diff --git a/sig/openai/internal/type/io_like.rbs b/sig/openai/internal/type/file_input.rbs similarity index 96% rename from sig/openai/internal/type/io_like.rbs rename to sig/openai/internal/type/file_input.rbs index 8a5fb508..862c2111 100644 --- a/sig/openai/internal/type/io_like.rbs +++ b/sig/openai/internal/type/file_input.rbs @@ -1,7 +1,7 @@ module OpenAI module Internal module Type - class IOLike + class FileInput extend OpenAI::Internal::Type::Converter def self.===: (top other) -> bool diff --git a/sig/openai/internal/util.rbs b/sig/openai/internal/util.rbs index 6c038865..0e7d0388 100644 --- a/sig/openai/internal/util.rbs +++ b/sig/openai/internal/util.rbs @@ -73,16 +73,6 @@ module OpenAI | ::Array[(String | Integer)?])?] headers ) -> ::Hash[String, String] - class SerializationAdapter - attr_reader inner: Pathname | IO - - def to_json: (*top a) -> String - - def to_yaml: (*top a) -> String - - def initialize: (Pathname | IO inner) -> void - end - class ReadIOAdapter def close?: -> bool? @@ -106,6 +96,13 @@ module OpenAI JSON_CONTENT: Regexp JSONL_CONTENT: Regexp + def self?.write_multipart_content: ( + Enumerator::Yielder y, + val: top, + closing: ::Array[^-> void], + ?content_type: String? + ) -> void + def self?.write_multipart_chunk: ( Enumerator::Yielder y, boundary: String, diff --git a/sig/openai/models/audio/transcription_create_params.rbs b/sig/openai/models/audio/transcription_create_params.rbs index 0ed3e9cd..e16d6287 100644 --- a/sig/openai/models/audio/transcription_create_params.rbs +++ b/sig/openai/models/audio/transcription_create_params.rbs @@ -3,7 +3,7 @@ module OpenAI module Audio type transcription_create_params = { - file: (Pathname | StringIO), + file: (Pathname | StringIO | IO | OpenAI::FilePart), model: OpenAI::Models::Audio::TranscriptionCreateParams::model, include: ::Array[OpenAI::Models::Audio::transcription_include], language: String, @@ -18,7 +18,7 @@ module OpenAI extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - attr_accessor file: Pathname | StringIO + attr_accessor file: Pathname | StringIO | IO | OpenAI::FilePart attr_accessor model: OpenAI::Models::Audio::TranscriptionCreateParams::model @@ -53,7 +53,7 @@ module OpenAI ) -> ::Array[OpenAI::Models::Audio::TranscriptionCreateParams::timestamp_granularity] def initialize: ( - file: Pathname | StringIO, + file: Pathname | StringIO | IO | OpenAI::FilePart, model: OpenAI::Models::Audio::TranscriptionCreateParams::model, ?include: ::Array[OpenAI::Models::Audio::transcription_include], ?language: String, diff --git a/sig/openai/models/audio/translation_create_params.rbs b/sig/openai/models/audio/translation_create_params.rbs index 2ed83e46..8fcd623b 100644 --- a/sig/openai/models/audio/translation_create_params.rbs +++ b/sig/openai/models/audio/translation_create_params.rbs @@ -3,7 +3,7 @@ module OpenAI module Audio type translation_create_params = { - file: (Pathname | StringIO), + file: (Pathname | StringIO | IO | OpenAI::FilePart), model: OpenAI::Models::Audio::TranslationCreateParams::model, prompt: String, response_format: OpenAI::Models::Audio::TranslationCreateParams::response_format, @@ -15,7 +15,7 @@ module OpenAI extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - attr_accessor file: Pathname | StringIO + attr_accessor file: Pathname | StringIO | IO | OpenAI::FilePart attr_accessor model: OpenAI::Models::Audio::TranslationCreateParams::model @@ -34,7 +34,7 @@ module OpenAI def temperature=: (Float) -> Float def initialize: ( - file: Pathname | StringIO, + file: Pathname | StringIO | IO | OpenAI::FilePart, model: OpenAI::Models::Audio::TranslationCreateParams::model, ?prompt: String, ?response_format: OpenAI::Models::Audio::TranslationCreateParams::response_format, diff --git a/sig/openai/models/file_create_params.rbs b/sig/openai/models/file_create_params.rbs index c57c5981..33f381f0 100644 --- a/sig/openai/models/file_create_params.rbs +++ b/sig/openai/models/file_create_params.rbs @@ -1,19 +1,22 @@ module OpenAI module Models type file_create_params = - { file: (Pathname | StringIO), purpose: OpenAI::Models::file_purpose } + { + file: (Pathname | StringIO | IO | OpenAI::FilePart), + purpose: OpenAI::Models::file_purpose + } & OpenAI::Internal::Type::request_parameters class FileCreateParams < OpenAI::Internal::Type::BaseModel extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - attr_accessor file: Pathname | StringIO + attr_accessor file: Pathname | StringIO | IO | OpenAI::FilePart attr_accessor purpose: OpenAI::Models::file_purpose def initialize: ( - file: Pathname | StringIO, + file: Pathname | StringIO | IO | OpenAI::FilePart, purpose: OpenAI::Models::file_purpose, ?request_options: OpenAI::request_opts ) -> void diff --git a/sig/openai/models/image_create_variation_params.rbs b/sig/openai/models/image_create_variation_params.rbs index 28803369..1d87d6c6 100644 --- a/sig/openai/models/image_create_variation_params.rbs +++ b/sig/openai/models/image_create_variation_params.rbs @@ -2,7 +2,7 @@ module OpenAI module Models type image_create_variation_params = { - image: (Pathname | StringIO), + image: (Pathname | StringIO | IO | OpenAI::FilePart), model: OpenAI::Models::ImageCreateVariationParams::model?, n: Integer?, response_format: OpenAI::Models::ImageCreateVariationParams::response_format?, @@ -15,7 +15,7 @@ module OpenAI extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - attr_accessor image: Pathname | StringIO + attr_accessor image: Pathname | StringIO | IO | OpenAI::FilePart attr_accessor model: OpenAI::Models::ImageCreateVariationParams::model? @@ -30,7 +30,7 @@ module OpenAI def user=: (String) -> String def initialize: ( - image: Pathname | StringIO, + image: Pathname | StringIO | IO | OpenAI::FilePart, ?model: OpenAI::Models::ImageCreateVariationParams::model?, ?n: Integer?, ?response_format: OpenAI::Models::ImageCreateVariationParams::response_format?, diff --git a/sig/openai/models/image_edit_params.rbs b/sig/openai/models/image_edit_params.rbs index 30bf203d..95e02a84 100644 --- a/sig/openai/models/image_edit_params.rbs +++ b/sig/openai/models/image_edit_params.rbs @@ -4,7 +4,7 @@ module OpenAI { image: OpenAI::Models::ImageEditParams::image, prompt: String, - mask: (Pathname | StringIO), + mask: (Pathname | StringIO | IO | OpenAI::FilePart), model: OpenAI::Models::ImageEditParams::model?, n: Integer?, quality: OpenAI::Models::ImageEditParams::quality?, @@ -22,9 +22,11 @@ module OpenAI attr_accessor prompt: String - attr_reader mask: (Pathname | StringIO)? + attr_reader mask: (Pathname | StringIO | IO | OpenAI::FilePart)? - def mask=: (Pathname | StringIO) -> (Pathname | StringIO) + def mask=: ( + Pathname | StringIO | IO | OpenAI::FilePart + ) -> (Pathname | StringIO | IO | OpenAI::FilePart) attr_accessor model: OpenAI::Models::ImageEditParams::model? @@ -43,7 +45,7 @@ module OpenAI def initialize: ( image: OpenAI::Models::ImageEditParams::image, prompt: String, - ?mask: Pathname | StringIO, + ?mask: Pathname | StringIO | IO | OpenAI::FilePart, ?model: OpenAI::Models::ImageEditParams::model?, ?n: Integer?, ?quality: OpenAI::Models::ImageEditParams::quality?, @@ -55,14 +57,19 @@ module OpenAI def to_hash: -> OpenAI::Models::image_edit_params - type image = Pathname | StringIO | ::Array[Pathname | StringIO] + type image = + Pathname + | StringIO + | IO + | OpenAI::FilePart + | ::Array[Pathname | StringIO | IO | OpenAI::FilePart] module Image extend OpenAI::Internal::Type::Union def self?.variants: -> [StringIO, ::Array[StringIO]] - type string_array = ::Array[Pathname | StringIO] + type string_array = ::Array[Pathname | StringIO | IO | OpenAI::FilePart] StringArray: string_array end diff --git a/sig/openai/models/uploads/part_create_params.rbs b/sig/openai/models/uploads/part_create_params.rbs index 89c4c092..f3ea9aa1 100644 --- a/sig/openai/models/uploads/part_create_params.rbs +++ b/sig/openai/models/uploads/part_create_params.rbs @@ -2,17 +2,17 @@ module OpenAI module Models module Uploads type part_create_params = - { data: (Pathname | StringIO) } + { data: (Pathname | StringIO | IO | OpenAI::FilePart) } & OpenAI::Internal::Type::request_parameters class PartCreateParams < OpenAI::Internal::Type::BaseModel extend OpenAI::Internal::Type::RequestParameters::Converter include OpenAI::Internal::Type::RequestParameters - attr_accessor data: Pathname | StringIO + attr_accessor data: Pathname | StringIO | IO | OpenAI::FilePart def initialize: ( - data: Pathname | StringIO, + data: Pathname | StringIO | IO | OpenAI::FilePart, ?request_options: OpenAI::request_opts ) -> void diff --git a/sig/openai/resources/audio/transcriptions.rbs b/sig/openai/resources/audio/transcriptions.rbs index bf5e0c11..50dccae8 100644 --- a/sig/openai/resources/audio/transcriptions.rbs +++ b/sig/openai/resources/audio/transcriptions.rbs @@ -3,7 +3,7 @@ module OpenAI class Audio class Transcriptions def create: ( - file: Pathname | StringIO, + file: Pathname | StringIO | IO | OpenAI::FilePart, model: OpenAI::Models::Audio::TranscriptionCreateParams::model, ?include: ::Array[OpenAI::Models::Audio::transcription_include], ?language: String, @@ -15,7 +15,7 @@ module OpenAI ) -> OpenAI::Models::Audio::transcription_create_response def create_streaming: ( - file: Pathname | StringIO, + file: Pathname | StringIO | IO | OpenAI::FilePart, model: OpenAI::Models::Audio::TranscriptionCreateParams::model, ?include: ::Array[OpenAI::Models::Audio::transcription_include], ?language: String, diff --git a/sig/openai/resources/audio/translations.rbs b/sig/openai/resources/audio/translations.rbs index a5cdf743..a2cece60 100644 --- a/sig/openai/resources/audio/translations.rbs +++ b/sig/openai/resources/audio/translations.rbs @@ -3,7 +3,7 @@ module OpenAI class Audio class Translations def create: ( - file: Pathname | StringIO, + file: Pathname | StringIO | IO | OpenAI::FilePart, model: OpenAI::Models::Audio::TranslationCreateParams::model, ?prompt: String, ?response_format: OpenAI::Models::Audio::TranslationCreateParams::response_format, diff --git a/sig/openai/resources/files.rbs b/sig/openai/resources/files.rbs index f4c12155..b6cefa86 100644 --- a/sig/openai/resources/files.rbs +++ b/sig/openai/resources/files.rbs @@ -2,7 +2,7 @@ module OpenAI module Resources class Files def create: ( - file: Pathname | StringIO, + file: Pathname | StringIO | IO | OpenAI::FilePart, purpose: OpenAI::Models::file_purpose, ?request_options: OpenAI::request_opts ) -> OpenAI::Models::FileObject diff --git a/sig/openai/resources/images.rbs b/sig/openai/resources/images.rbs index ec6082ff..d1bddd09 100644 --- a/sig/openai/resources/images.rbs +++ b/sig/openai/resources/images.rbs @@ -2,7 +2,7 @@ module OpenAI module Resources class Images def create_variation: ( - image: Pathname | StringIO, + image: Pathname | StringIO | IO | OpenAI::FilePart, ?model: OpenAI::Models::ImageCreateVariationParams::model?, ?n: Integer?, ?response_format: OpenAI::Models::ImageCreateVariationParams::response_format?, @@ -14,7 +14,7 @@ module OpenAI def edit: ( image: OpenAI::Models::ImageEditParams::image, prompt: String, - ?mask: Pathname | StringIO, + ?mask: Pathname | StringIO | IO | OpenAI::FilePart, ?model: OpenAI::Models::ImageEditParams::model?, ?n: Integer?, ?quality: OpenAI::Models::ImageEditParams::quality?, diff --git a/sig/openai/resources/uploads/parts.rbs b/sig/openai/resources/uploads/parts.rbs index 7d3f7d89..f296f1ef 100644 --- a/sig/openai/resources/uploads/parts.rbs +++ b/sig/openai/resources/uploads/parts.rbs @@ -4,7 +4,7 @@ module OpenAI class Parts def create: ( String upload_id, - data: Pathname | StringIO, + data: Pathname | StringIO | IO | OpenAI::FilePart, ?request_options: OpenAI::request_opts ) -> OpenAI::Models::Uploads::UploadPart diff --git a/test/openai/internal/type/base_model_test.rb b/test/openai/internal/type/base_model_test.rb index a3267818..3f6e7420 100644 --- a/test/openai/internal/type/base_model_test.rb +++ b/test/openai/internal/type/base_model_test.rb @@ -94,7 +94,7 @@ def test_dump [:a, :b] => :b, [:a, "a"] => "a", [String, StringIO.new("one")] => "one", - [String, Pathname(__FILE__)] => OpenAI::Internal::Util::SerializationAdapter + [String, Pathname(__FILE__)] => OpenAI::FilePart } cases.each do diff --git a/test/openai/internal/util_test.rb b/test/openai/internal/util_test.rb index adae5642..5d52ee06 100644 --- a/test/openai/internal/util_test.rb +++ b/test/openai/internal/util_test.rb @@ -200,8 +200,12 @@ def test_file_encode file = Pathname(__FILE__) headers = {"content-type" => "multipart/form-data"} cases = { + "abc" => "abc", StringIO.new("abc") => "abc", - file => /^class OpenAI/ + OpenAI::FilePart.new("abc") => "abc", + OpenAI::FilePart.new(StringIO.new("abc")) => "abc", + file => /^class OpenAI/, + OpenAI::FilePart.new(file) => /^class OpenAI/ } cases.each do |body, val| encoded = OpenAI::Internal::Util.encode_content(headers, body) @@ -219,7 +223,13 @@ def test_hash_encode {a: 2, b: nil} => {"a" => "2", "b" => "null"}, {a: 2, b: [1, 2, 3]} => {"a" => "2", "b" => "1"}, {strio: StringIO.new("a")} => {"strio" => "a"}, - {pathname: Pathname(__FILE__)} => {"pathname" => -> { _1.read in /^class OpenAI/ }} + {strio: OpenAI::FilePart.new("a")} => {"strio" => "a"}, + {pathname: Pathname(__FILE__)} => {"pathname" => -> { _1.read in /^class OpenAI/ }}, + {pathname: OpenAI::FilePart.new(Pathname(__FILE__))} => { + "pathname" => -> { + _1.read in /^class OpenAI/ + } + } } cases.each do |body, testcase| encoded = OpenAI::Internal::Util.encode_content(headers, body) From cec4b051bb0f4357032779cde2c11babe4196fcd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 19:45:39 +0000 Subject: [PATCH 15/33] chore: consistently use string in examples, even for enums --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 33a1ebe9..94764336 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ openai = OpenAI::Client.new( ) chat_completion = openai.chat.completions.create( - messages: [{role: :user, content: "Say this is a test"}], + messages: [{role: "user", content: "Say this is a test"}], model: :"gpt-4.1" ) @@ -48,7 +48,7 @@ When using sorbet, it is recommended to use model classes as below. This provide ```ruby openai.chat.completions.create( - messages: [OpenAI::Models::Chat::ChatCompletionUserMessageParam.new(role: :user, content: "Say this is a test")], + messages: [OpenAI::Models::Chat::ChatCompletionUserMessageParam.new(role: "user", content: "Say this is a test")], model: :"gpt-4.1" ) ``` @@ -80,7 +80,7 @@ We provide support for streaming responses using Server-Sent Events (SSE). ```ruby stream = openai.chat.completions.stream_raw( - messages: [{role: :user, content: "Say this is a test"}], + messages: [{role: "user", content: "Say this is a test"}], model: :"gpt-4.1" ) @@ -97,11 +97,11 @@ Request parameters that correspond to file uploads can be passed as `StringIO`, require "pathname" # using `Pathname`, the file will be lazily read, without reading everything in to memory -file_object = openai.files.create(file: Pathname("input.jsonl"), purpose: :"fine-tune") +file_object = openai.files.create(file: Pathname("input.jsonl"), purpose: "fine-tune") file = File.read("input.jsonl") # using `StringIO`, useful if you already have the data in memory -file_object = openai.files.create(file: StringIO.new(file), purpose: :"fine-tune") +file_object = openai.files.create(file: StringIO.new(file), purpose: "fine-tune") puts(file_object.id) ``` @@ -150,7 +150,7 @@ openai = OpenAI::Client.new( # Or, configure per-request: openai.chat.completions.create( - messages: [{role: :user, content: "How can I get the name of the current day in JavaScript?"}], + messages: [{role: "user", content: "How can I get the name of the current day in JavaScript?"}], model: :"gpt-4.1", request_options: {max_retries: 5} ) @@ -172,7 +172,7 @@ openai = OpenAI::Client.new( # Or, configure per-request: openai.chat.completions.create( - messages: [{role: :user, content: "How can I list all files in a directory using Python?"}], + messages: [{role: "user", content: "How can I list all files in a directory using Python?"}], model: :"gpt-4.1", request_options: {timeout: 5} ) @@ -189,13 +189,13 @@ In all places where a `BaseModel` type is specified, vanilla Ruby `Hash` can als ```ruby # This has tooling readability, for auto-completion, static analysis, and goto definition with supported language services params = OpenAI::Models::Chat::CompletionCreateParams.new( - messages: [OpenAI::Models::Chat::ChatCompletionUserMessageParam.new(role: :user, content: "Say this is a test")], + messages: [OpenAI::Models::Chat::ChatCompletionUserMessageParam.new(role: "user", content: "Say this is a test")], model: :"gpt-4.1" ) # This also works params = { - messages: [{role: :user, content: "Say this is a test"}], + messages: [{role: "user", content: "Say this is a test"}], model: :"gpt-4.1" } ``` @@ -257,7 +257,7 @@ It is possible to pass a compatible model / parameter class to a method that exp ```ruby params = OpenAI::Models::Chat::CompletionCreateParams.new( - messages: [OpenAI::Models::Chat::ChatCompletionUserMessageParam.new(role: :user, content: "Say this is a test")], + messages: [OpenAI::Models::Chat::ChatCompletionUserMessageParam.new(role: "user", content: "Say this is a test")], model: :"gpt-4.1" ) openai.chat.completions.create(**params) From a05d2c5d16ce052c1fb84005739e6b6d853f5e8e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 23:03:34 +0000 Subject: [PATCH 16/33] chore(internal): improve response envelope unwrap functionality --- lib/openai/internal/transport/base_client.rb | 4 ++-- lib/openai/internal/util.rb | 23 ++++++++++--------- .../openai/internal/transport/base_client.rbi | 18 +++++++++++++-- rbi/lib/openai/internal/util.rbi | 12 +++++++--- sig/openai/internal/transport/base_client.rbs | 10 ++++++-- sig/openai/internal/util.rbs | 6 +++-- test/openai/internal/util_test.rb | 7 +++--- 7 files changed, 55 insertions(+), 25 deletions(-) diff --git a/lib/openai/internal/transport/base_client.rb b/lib/openai/internal/transport/base_client.rb index 8866d7ad..5d77a764 100644 --- a/lib/openai/internal/transport/base_client.rb +++ b/lib/openai/internal/transport/base_client.rb @@ -214,7 +214,7 @@ def initialize( # # @option req [Object, nil] :body # - # @option req [Symbol, nil] :unwrap + # @option req [Symbol, Integer, Array, Proc, nil] :unwrap # # @option req [Class, nil] :page # @@ -415,7 +415,7 @@ def initialize( # # @param body [Object, nil] # - # @param unwrap [Symbol, nil] + # @param unwrap [Symbol, Integer, Array, Proc, nil] # # @param page [Class, nil] # diff --git a/lib/openai/internal/util.rb b/lib/openai/internal/util.rb index 7b82110b..c1359d17 100644 --- a/lib/openai/internal/util.rb +++ b/lib/openai/internal/util.rb @@ -175,18 +175,17 @@ def deep_merge(*values, sentinel: nil, concat: false) # @api private # # @param data [Hash{Symbol=>Object}, Array, Object] - # @param pick [Symbol, Integer, Array, nil] - # @param sentinel [Object, nil] + # @param pick [Symbol, Integer, Array, Proc, nil] # @param blk [Proc, nil] # # @return [Object, nil] - def dig(data, pick, sentinel = nil, &blk) - case [data, pick, blk] - in [_, nil, nil] + def dig(data, pick, &blk) + case [data, pick] + in [_, nil] data - in [Hash, Symbol, _] | [Array, Integer, _] - blk.nil? ? data.fetch(pick, sentinel) : data.fetch(pick, &blk) - in [Hash | Array, Array, _] + in [Hash, Symbol] | [Array, Integer] + data.fetch(pick) { blk&.call } + in [Hash | Array, Array] pick.reduce(data) do |acc, key| case acc in Hash if acc.key?(key) @@ -194,11 +193,13 @@ def dig(data, pick, sentinel = nil, &blk) in Array if key.is_a?(Integer) && key < acc.length acc[key] else - return blk.nil? ? sentinel : blk.call + return blk&.call end end - in _ - blk.nil? ? sentinel : blk.call + in [_, Proc] + pick.call(data) + else + blk&.call end end end diff --git a/rbi/lib/openai/internal/transport/base_client.rbi b/rbi/lib/openai/internal/transport/base_client.rbi index 73785f6c..fb87b782 100644 --- a/rbi/lib/openai/internal/transport/base_client.rbi +++ b/rbi/lib/openai/internal/transport/base_client.rbi @@ -24,7 +24,14 @@ module OpenAI )] ), body: T.nilable(T.anything), - unwrap: T.nilable(Symbol), + unwrap: T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), page: T.nilable(T::Class[OpenAI::Internal::Type::BasePage[OpenAI::Internal::Type::BaseModel]]), stream: T.nilable( T::Class[OpenAI::Internal::Type::BaseStream[T.anything, @@ -173,7 +180,14 @@ module OpenAI )] ), body: T.nilable(T.anything), - unwrap: T.nilable(Symbol), + unwrap: T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), page: T.nilable(T::Class[OpenAI::Internal::Type::BasePage[OpenAI::Internal::Type::BaseModel]]), stream: T.nilable( T::Class[OpenAI::Internal::Type::BaseStream[T.anything, diff --git a/rbi/lib/openai/internal/util.rbi b/rbi/lib/openai/internal/util.rbi index 70758fde..3fe2f560 100644 --- a/rbi/lib/openai/internal/util.rbi +++ b/rbi/lib/openai/internal/util.rbi @@ -68,13 +68,19 @@ module OpenAI sig do params( data: T.any(OpenAI::Internal::AnyHash, T::Array[T.anything], T.anything), - pick: T.nilable(T.any(Symbol, Integer, T::Array[T.any(Symbol, Integer)])), - sentinel: T.nilable(T.anything), + pick: T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), blk: T.nilable(T.proc.returns(T.anything)) ) .returns(T.nilable(T.anything)) end - def dig(data, pick, sentinel = nil, &blk); end + def dig(data, pick, &blk); end end class << self diff --git a/sig/openai/internal/transport/base_client.rbs b/sig/openai/internal/transport/base_client.rbs index acb379e9..3b3e9b44 100644 --- a/sig/openai/internal/transport/base_client.rbs +++ b/sig/openai/internal/transport/base_client.rbs @@ -11,7 +11,10 @@ module OpenAI | Integer | ::Array[(String | Integer)?])?]?, body: top?, - unwrap: Symbol?, + unwrap: (Symbol + | Integer + | ::Array[(Symbol | Integer)] + | (^(top arg0) -> top))?, page: Class?, stream: Class?, model: OpenAI::Internal::Type::Converter::input?, @@ -96,7 +99,10 @@ module OpenAI | Integer | ::Array[(String | Integer)?])?]?, ?body: top?, - ?unwrap: Symbol?, + ?unwrap: (Symbol + | Integer + | ::Array[(Symbol | Integer)] + | (^(top arg0) -> top))?, ?page: Class?, ?stream: Class?, ?model: OpenAI::Internal::Type::Converter::input?, diff --git a/sig/openai/internal/util.rbs b/sig/openai/internal/util.rbs index 0e7d0388..14b3d577 100644 --- a/sig/openai/internal/util.rbs +++ b/sig/openai/internal/util.rbs @@ -29,8 +29,10 @@ module OpenAI def self?.dig: ( ::Hash[Symbol, top] | ::Array[top] | top data, - (Symbol | Integer | ::Array[(Symbol | Integer)])? pick, - ?top? sentinel + (Symbol + | Integer + | ::Array[(Symbol | Integer)] + | (^(top arg0) -> top))? pick ) { -> top? } -> top? diff --git a/test/openai/internal/util_test.rb b/test/openai/internal/util_test.rb index 5d52ee06..565fe013 100644 --- a/test/openai/internal/util_test.rb +++ b/test/openai/internal/util_test.rb @@ -87,8 +87,9 @@ def test_dig OpenAI::Internal::Util.dig([], 1.0) => nil OpenAI::Internal::Util.dig(Object, 1) => nil - OpenAI::Internal::Util.dig([], 1.0, 2) => 2 OpenAI::Internal::Util.dig([], 1.0) { 2 } => 2 + OpenAI::Internal::Util.dig([], ->(_) { 2 }) => 2 + OpenAI::Internal::Util.dig([1], -> { _1 in [1] }) => true end end end @@ -165,9 +166,9 @@ def test_json_content "application/vnd.github.v3+json" => true, "application/vnd.api+json" => true } - cases.each do |header, _verdict| + cases.each do |header, verdict| assert_pattern do - OpenAI::Internal::Util::JSON_CONTENT.match?(header) => verdict + OpenAI::Internal::Util::JSON_CONTENT.match?(header) => ^verdict end end end From 513acd850f86110f1820a97468f50baf3a3ae0b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 16:32:47 +0000 Subject: [PATCH 17/33] fix: ensure gem release is unaffected by renaming --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 09924f69..2e5368f2 100644 --- a/Rakefile +++ b/Rakefile @@ -135,5 +135,5 @@ end desc("Release ruby gem") multitask(release: [:"build:gem"]) do - sh(*%w[gem push], *FileList["openai-*.gem"]) + sh(*%w[gem push], *FileList["*.gem"]) end From c78ea0fad674def58c3d15eec516a18149777d09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 21:06:42 +0000 Subject: [PATCH 18/33] fix: make a typo for `FilePart.content` --- lib/openai/file_part.rb | 10 ++++---- lib/openai/internal/type/converter.rb | 3 +++ lib/openai/internal/type/file_input.rb | 33 +++++++++++++++++--------- test/openai/file_part_test.rb | 12 ++++++++++ 4 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 test/openai/file_part_test.rb diff --git a/lib/openai/file_part.rb b/lib/openai/file_part.rb index f17371ec..d2a3f6a5 100644 --- a/lib/openai/file_part.rb +++ b/lib/openai/file_part.rb @@ -15,15 +15,15 @@ class FilePart # # @return [String] private def read - case contents + case content in Pathname - contents.read(binmode: true) + content.read(binmode: true) in StringIO - contents.string + content.string in IO - contents.read + content.read in String - contents + content end end diff --git a/lib/openai/internal/type/converter.rb b/lib/openai/internal/type/converter.rb index 0b58d3b0..0d498235 100644 --- a/lib/openai/internal/type/converter.rb +++ b/lib/openai/internal/type/converter.rb @@ -44,6 +44,9 @@ def dump(value, state:) in Pathname | IO state[:can_retry] = false if value.is_a?(IO) OpenAI::FilePart.new(value) + in OpenAI::FilePart + state[:can_retry] = false if value.content.is_a?(IO) + value else value end diff --git a/lib/openai/internal/type/file_input.rb b/lib/openai/internal/type/file_input.rb index 892a1761..3ed13ec6 100644 --- a/lib/openai/internal/type/file_input.rb +++ b/lib/openai/internal/type/file_input.rb @@ -67,17 +67,28 @@ def coerce(value, state:) end end - # @!parse - # # @api private - # # - # # @param value [Pathname, StringIO, IO, String, Object] - # # - # # @param state [Hash{Symbol=>Object}] . - # # - # # @option state [Boolean] :can_retry - # # - # # @return [Pathname, StringIO, IO, String, Object] - # def dump(value, state:) = super + # @api private + # + # @param value [Pathname, StringIO, IO, String, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Pathname, StringIO, IO, String, Object] + def dump(value, state:) + # rubocop:disable Lint/DuplicateBranch + case value + in IO + state[:can_retry] = false + in OpenAI::FilePart if value.content.is_a?(IO) + state[:can_retry] = false + else + end + # rubocop:enable Lint/DuplicateBranch + + value + end end end end diff --git a/test/openai/file_part_test.rb b/test/openai/file_part_test.rb new file mode 100644 index 00000000..4136b1b6 --- /dev/null +++ b/test/openai/file_part_test.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class OpenAI::Test::FilePartTest < Minitest::Test + def test_to_json + text = "gray" + filepart = OpenAI::FilePart.new(StringIO.new(text)) + + assert_equal(text.to_json, filepart.to_json) + end +end From df9e0991a3aac2a5a480bfb3cf622139ca1b1373 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Apr 2025 05:41:35 +0000 Subject: [PATCH 19/33] chore(internal): remove unnecessary `rbi/lib` folder --- rbi/{lib => }/openai/client.rbi | 0 rbi/{lib => }/openai/errors.rbi | 0 rbi/{lib => }/openai/file_part.rbi | 0 rbi/{lib => }/openai/internal.rbi | 0 rbi/{lib => }/openai/internal/cursor_page.rbi | 0 rbi/{lib => }/openai/internal/page.rbi | 0 rbi/{lib => }/openai/internal/stream.rbi | 0 rbi/{lib => }/openai/internal/transport/base_client.rbi | 0 rbi/{lib => }/openai/internal/transport/pooled_net_requester.rbi | 0 rbi/{lib => }/openai/internal/type/array_of.rbi | 0 rbi/{lib => }/openai/internal/type/base_model.rbi | 0 rbi/{lib => }/openai/internal/type/base_page.rbi | 0 rbi/{lib => }/openai/internal/type/base_stream.rbi | 0 rbi/{lib => }/openai/internal/type/boolean.rbi | 0 rbi/{lib => }/openai/internal/type/converter.rbi | 0 rbi/{lib => }/openai/internal/type/enum.rbi | 0 rbi/{lib => }/openai/internal/type/file_input.rbi | 0 rbi/{lib => }/openai/internal/type/hash_of.rbi | 0 rbi/{lib => }/openai/internal/type/request_parameters.rbi | 0 rbi/{lib => }/openai/internal/type/union.rbi | 0 rbi/{lib => }/openai/internal/type/unknown.rbi | 0 rbi/{lib => }/openai/internal/util.rbi | 0 rbi/{lib => }/openai/models/all_models.rbi | 0 rbi/{lib => }/openai/models/audio/speech_create_params.rbi | 0 rbi/{lib => }/openai/models/audio/speech_model.rbi | 0 rbi/{lib => }/openai/models/audio/transcription.rbi | 0 rbi/{lib => }/openai/models/audio/transcription_create_params.rbi | 0 .../openai/models/audio/transcription_create_response.rbi | 0 rbi/{lib => }/openai/models/audio/transcription_include.rbi | 0 rbi/{lib => }/openai/models/audio/transcription_segment.rbi | 0 rbi/{lib => }/openai/models/audio/transcription_stream_event.rbi | 0 .../openai/models/audio/transcription_text_delta_event.rbi | 0 .../openai/models/audio/transcription_text_done_event.rbi | 0 rbi/{lib => }/openai/models/audio/transcription_verbose.rbi | 0 rbi/{lib => }/openai/models/audio/transcription_word.rbi | 0 rbi/{lib => }/openai/models/audio/translation.rbi | 0 rbi/{lib => }/openai/models/audio/translation_create_params.rbi | 0 rbi/{lib => }/openai/models/audio/translation_create_response.rbi | 0 rbi/{lib => }/openai/models/audio/translation_verbose.rbi | 0 rbi/{lib => }/openai/models/audio_model.rbi | 0 rbi/{lib => }/openai/models/audio_response_format.rbi | 0 rbi/{lib => }/openai/models/auto_file_chunking_strategy_param.rbi | 0 rbi/{lib => }/openai/models/batch.rbi | 0 rbi/{lib => }/openai/models/batch_cancel_params.rbi | 0 rbi/{lib => }/openai/models/batch_create_params.rbi | 0 rbi/{lib => }/openai/models/batch_error.rbi | 0 rbi/{lib => }/openai/models/batch_list_params.rbi | 0 rbi/{lib => }/openai/models/batch_request_counts.rbi | 0 rbi/{lib => }/openai/models/batch_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/beta/assistant.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_create_params.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_delete_params.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_deleted.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_list_params.rbi | 0 .../openai/models/beta/assistant_response_format_option.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_stream_event.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_tool.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_tool_choice.rbi | 0 .../openai/models/beta/assistant_tool_choice_function.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_tool_choice_option.rbi | 0 rbi/{lib => }/openai/models/beta/assistant_update_params.rbi | 0 rbi/{lib => }/openai/models/beta/code_interpreter_tool.rbi | 0 rbi/{lib => }/openai/models/beta/file_search_tool.rbi | 0 rbi/{lib => }/openai/models/beta/function_tool.rbi | 0 rbi/{lib => }/openai/models/beta/message_stream_event.rbi | 0 rbi/{lib => }/openai/models/beta/run_step_stream_event.rbi | 0 rbi/{lib => }/openai/models/beta/run_stream_event.rbi | 0 rbi/{lib => }/openai/models/beta/thread.rbi | 0 rbi/{lib => }/openai/models/beta/thread_create_and_run_params.rbi | 0 rbi/{lib => }/openai/models/beta/thread_create_params.rbi | 0 rbi/{lib => }/openai/models/beta/thread_delete_params.rbi | 0 rbi/{lib => }/openai/models/beta/thread_deleted.rbi | 0 rbi/{lib => }/openai/models/beta/thread_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/beta/thread_stream_event.rbi | 0 rbi/{lib => }/openai/models/beta/thread_update_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/annotation.rbi | 0 rbi/{lib => }/openai/models/beta/threads/annotation_delta.rbi | 0 .../openai/models/beta/threads/file_citation_annotation.rbi | 0 .../openai/models/beta/threads/file_citation_delta_annotation.rbi | 0 rbi/{lib => }/openai/models/beta/threads/file_path_annotation.rbi | 0 .../openai/models/beta/threads/file_path_delta_annotation.rbi | 0 rbi/{lib => }/openai/models/beta/threads/image_file.rbi | 0 .../openai/models/beta/threads/image_file_content_block.rbi | 0 rbi/{lib => }/openai/models/beta/threads/image_file_delta.rbi | 0 .../openai/models/beta/threads/image_file_delta_block.rbi | 0 rbi/{lib => }/openai/models/beta/threads/image_url.rbi | 0 .../openai/models/beta/threads/image_url_content_block.rbi | 0 rbi/{lib => }/openai/models/beta/threads/image_url_delta.rbi | 0 .../openai/models/beta/threads/image_url_delta_block.rbi | 0 rbi/{lib => }/openai/models/beta/threads/message.rbi | 0 rbi/{lib => }/openai/models/beta/threads/message_content.rbi | 0 .../openai/models/beta/threads/message_content_delta.rbi | 0 .../openai/models/beta/threads/message_content_part_param.rbi | 0 .../openai/models/beta/threads/message_create_params.rbi | 0 .../openai/models/beta/threads/message_delete_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/message_deleted.rbi | 0 rbi/{lib => }/openai/models/beta/threads/message_delta.rbi | 0 rbi/{lib => }/openai/models/beta/threads/message_delta_event.rbi | 0 rbi/{lib => }/openai/models/beta/threads/message_list_params.rbi | 0 .../openai/models/beta/threads/message_retrieve_params.rbi | 0 .../openai/models/beta/threads/message_update_params.rbi | 0 .../openai/models/beta/threads/refusal_content_block.rbi | 0 rbi/{lib => }/openai/models/beta/threads/refusal_delta_block.rbi | 0 .../models/beta/threads/required_action_function_tool_call.rbi | 0 rbi/{lib => }/openai/models/beta/threads/run.rbi | 0 rbi/{lib => }/openai/models/beta/threads/run_cancel_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/run_create_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/run_list_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/run_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/run_status.rbi | 0 .../openai/models/beta/threads/run_submit_tool_outputs_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/run_update_params.rbi | 0 .../openai/models/beta/threads/runs/code_interpreter_logs.rbi | 0 .../models/beta/threads/runs/code_interpreter_output_image.rbi | 0 .../models/beta/threads/runs/code_interpreter_tool_call.rbi | 0 .../models/beta/threads/runs/code_interpreter_tool_call_delta.rbi | 0 .../openai/models/beta/threads/runs/file_search_tool_call.rbi | 0 .../models/beta/threads/runs/file_search_tool_call_delta.rbi | 0 .../openai/models/beta/threads/runs/function_tool_call.rbi | 0 .../openai/models/beta/threads/runs/function_tool_call_delta.rbi | 0 .../models/beta/threads/runs/message_creation_step_details.rbi | 0 rbi/{lib => }/openai/models/beta/threads/runs/run_step.rbi | 0 rbi/{lib => }/openai/models/beta/threads/runs/run_step_delta.rbi | 0 .../openai/models/beta/threads/runs/run_step_delta_event.rbi | 0 .../models/beta/threads/runs/run_step_delta_message_delta.rbi | 0 .../openai/models/beta/threads/runs/run_step_include.rbi | 0 .../openai/models/beta/threads/runs/step_list_params.rbi | 0 .../openai/models/beta/threads/runs/step_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/beta/threads/runs/tool_call.rbi | 0 rbi/{lib => }/openai/models/beta/threads/runs/tool_call_delta.rbi | 0 .../openai/models/beta/threads/runs/tool_call_delta_object.rbi | 0 .../openai/models/beta/threads/runs/tool_calls_step_details.rbi | 0 rbi/{lib => }/openai/models/beta/threads/text.rbi | 0 rbi/{lib => }/openai/models/beta/threads/text_content_block.rbi | 0 .../openai/models/beta/threads/text_content_block_param.rbi | 0 rbi/{lib => }/openai/models/beta/threads/text_delta.rbi | 0 rbi/{lib => }/openai/models/beta/threads/text_delta_block.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion.rbi | 0 .../models/chat/chat_completion_assistant_message_param.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_audio.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_audio_param.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_chunk.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_content_part.rbi | 0 .../openai/models/chat/chat_completion_content_part_image.rbi | 0 .../models/chat/chat_completion_content_part_input_audio.rbi | 0 .../openai/models/chat/chat_completion_content_part_refusal.rbi | 0 .../openai/models/chat/chat_completion_content_part_text.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_deleted.rbi | 0 .../models/chat/chat_completion_developer_message_param.rbi | 0 .../openai/models/chat/chat_completion_function_call_option.rbi | 0 .../openai/models/chat/chat_completion_function_message_param.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_message.rbi | 0 .../openai/models/chat/chat_completion_message_param.rbi | 0 .../openai/models/chat/chat_completion_message_tool_call.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_modality.rbi | 0 .../openai/models/chat/chat_completion_named_tool_choice.rbi | 0 .../openai/models/chat/chat_completion_prediction_content.rbi | 0 .../openai/models/chat/chat_completion_reasoning_effort.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_role.rbi | 0 .../openai/models/chat/chat_completion_store_message.rbi | 0 .../openai/models/chat/chat_completion_stream_options.rbi | 0 .../openai/models/chat/chat_completion_system_message_param.rbi | 0 .../openai/models/chat/chat_completion_token_logprob.rbi | 0 rbi/{lib => }/openai/models/chat/chat_completion_tool.rbi | 0 .../openai/models/chat/chat_completion_tool_choice_option.rbi | 0 .../openai/models/chat/chat_completion_tool_message_param.rbi | 0 .../openai/models/chat/chat_completion_user_message_param.rbi | 0 rbi/{lib => }/openai/models/chat/completion_create_params.rbi | 0 rbi/{lib => }/openai/models/chat/completion_delete_params.rbi | 0 rbi/{lib => }/openai/models/chat/completion_list_params.rbi | 0 rbi/{lib => }/openai/models/chat/completion_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/chat/completion_update_params.rbi | 0 .../openai/models/chat/completions/message_list_params.rbi | 0 rbi/{lib => }/openai/models/chat_model.rbi | 0 rbi/{lib => }/openai/models/comparison_filter.rbi | 0 rbi/{lib => }/openai/models/completion.rbi | 0 rbi/{lib => }/openai/models/completion_choice.rbi | 0 rbi/{lib => }/openai/models/completion_create_params.rbi | 0 rbi/{lib => }/openai/models/completion_usage.rbi | 0 rbi/{lib => }/openai/models/compound_filter.rbi | 0 rbi/{lib => }/openai/models/create_embedding_response.rbi | 0 rbi/{lib => }/openai/models/embedding.rbi | 0 rbi/{lib => }/openai/models/embedding_create_params.rbi | 0 rbi/{lib => }/openai/models/embedding_model.rbi | 0 rbi/{lib => }/openai/models/error_object.rbi | 0 rbi/{lib => }/openai/models/eval_create_params.rbi | 0 rbi/{lib => }/openai/models/eval_create_response.rbi | 0 rbi/{lib => }/openai/models/eval_custom_data_source_config.rbi | 0 rbi/{lib => }/openai/models/eval_delete_params.rbi | 0 rbi/{lib => }/openai/models/eval_delete_response.rbi | 0 rbi/{lib => }/openai/models/eval_label_model_grader.rbi | 0 rbi/{lib => }/openai/models/eval_list_params.rbi | 0 rbi/{lib => }/openai/models/eval_list_response.rbi | 0 rbi/{lib => }/openai/models/eval_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/eval_retrieve_response.rbi | 0 .../openai/models/eval_stored_completions_data_source_config.rbi | 0 rbi/{lib => }/openai/models/eval_string_check_grader.rbi | 0 rbi/{lib => }/openai/models/eval_text_similarity_grader.rbi | 0 rbi/{lib => }/openai/models/eval_update_params.rbi | 0 rbi/{lib => }/openai/models/eval_update_response.rbi | 0 .../models/evals/create_eval_completions_run_data_source.rbi | 0 .../openai/models/evals/create_eval_jsonl_run_data_source.rbi | 0 rbi/{lib => }/openai/models/evals/eval_api_error.rbi | 0 rbi/{lib => }/openai/models/evals/run_cancel_params.rbi | 0 rbi/{lib => }/openai/models/evals/run_cancel_response.rbi | 0 rbi/{lib => }/openai/models/evals/run_create_params.rbi | 0 rbi/{lib => }/openai/models/evals/run_create_response.rbi | 0 rbi/{lib => }/openai/models/evals/run_delete_params.rbi | 0 rbi/{lib => }/openai/models/evals/run_delete_response.rbi | 0 rbi/{lib => }/openai/models/evals/run_list_params.rbi | 0 rbi/{lib => }/openai/models/evals/run_list_response.rbi | 0 rbi/{lib => }/openai/models/evals/run_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/evals/run_retrieve_response.rbi | 0 .../openai/models/evals/runs/output_item_list_params.rbi | 0 .../openai/models/evals/runs/output_item_list_response.rbi | 0 .../openai/models/evals/runs/output_item_retrieve_params.rbi | 0 .../openai/models/evals/runs/output_item_retrieve_response.rbi | 0 rbi/{lib => }/openai/models/file_chunking_strategy.rbi | 0 rbi/{lib => }/openai/models/file_chunking_strategy_param.rbi | 0 rbi/{lib => }/openai/models/file_content_params.rbi | 0 rbi/{lib => }/openai/models/file_create_params.rbi | 0 rbi/{lib => }/openai/models/file_delete_params.rbi | 0 rbi/{lib => }/openai/models/file_deleted.rbi | 0 rbi/{lib => }/openai/models/file_list_params.rbi | 0 rbi/{lib => }/openai/models/file_object.rbi | 0 rbi/{lib => }/openai/models/file_purpose.rbi | 0 rbi/{lib => }/openai/models/file_retrieve_params.rbi | 0 .../models/fine_tuning/checkpoints/permission_create_params.rbi | 0 .../models/fine_tuning/checkpoints/permission_create_response.rbi | 0 .../models/fine_tuning/checkpoints/permission_delete_params.rbi | 0 .../models/fine_tuning/checkpoints/permission_delete_response.rbi | 0 .../models/fine_tuning/checkpoints/permission_retrieve_params.rbi | 0 .../fine_tuning/checkpoints/permission_retrieve_response.rbi | 0 rbi/{lib => }/openai/models/fine_tuning/fine_tuning_job.rbi | 0 rbi/{lib => }/openai/models/fine_tuning/fine_tuning_job_event.rbi | 0 .../openai/models/fine_tuning/fine_tuning_job_integration.rbi | 0 .../models/fine_tuning/fine_tuning_job_wandb_integration.rbi | 0 .../fine_tuning/fine_tuning_job_wandb_integration_object.rbi | 0 rbi/{lib => }/openai/models/fine_tuning/job_cancel_params.rbi | 0 rbi/{lib => }/openai/models/fine_tuning/job_create_params.rbi | 0 .../openai/models/fine_tuning/job_list_events_params.rbi | 0 rbi/{lib => }/openai/models/fine_tuning/job_list_params.rbi | 0 rbi/{lib => }/openai/models/fine_tuning/job_retrieve_params.rbi | 0 .../openai/models/fine_tuning/jobs/checkpoint_list_params.rbi | 0 .../openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi | 0 rbi/{lib => }/openai/models/function_definition.rbi | 0 rbi/{lib => }/openai/models/function_parameters.rbi | 0 rbi/{lib => }/openai/models/image.rbi | 0 rbi/{lib => }/openai/models/image_create_variation_params.rbi | 0 rbi/{lib => }/openai/models/image_edit_params.rbi | 0 rbi/{lib => }/openai/models/image_generate_params.rbi | 0 rbi/{lib => }/openai/models/image_model.rbi | 0 rbi/{lib => }/openai/models/images_response.rbi | 0 rbi/{lib => }/openai/models/metadata.rbi | 0 rbi/{lib => }/openai/models/model.rbi | 0 rbi/{lib => }/openai/models/model_delete_params.rbi | 0 rbi/{lib => }/openai/models/model_deleted.rbi | 0 rbi/{lib => }/openai/models/model_list_params.rbi | 0 rbi/{lib => }/openai/models/model_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/moderation.rbi | 0 rbi/{lib => }/openai/models/moderation_create_params.rbi | 0 rbi/{lib => }/openai/models/moderation_create_response.rbi | 0 rbi/{lib => }/openai/models/moderation_image_url_input.rbi | 0 rbi/{lib => }/openai/models/moderation_model.rbi | 0 rbi/{lib => }/openai/models/moderation_multi_modal_input.rbi | 0 rbi/{lib => }/openai/models/moderation_text_input.rbi | 0 .../openai/models/other_file_chunking_strategy_object.rbi | 0 rbi/{lib => }/openai/models/reasoning.rbi | 0 rbi/{lib => }/openai/models/reasoning_effort.rbi | 0 rbi/{lib => }/openai/models/response_format_json_object.rbi | 0 rbi/{lib => }/openai/models/response_format_json_schema.rbi | 0 rbi/{lib => }/openai/models/response_format_text.rbi | 0 rbi/{lib => }/openai/models/responses/computer_tool.rbi | 0 rbi/{lib => }/openai/models/responses/easy_input_message.rbi | 0 rbi/{lib => }/openai/models/responses/file_search_tool.rbi | 0 rbi/{lib => }/openai/models/responses/function_tool.rbi | 0 rbi/{lib => }/openai/models/responses/input_item_list_params.rbi | 0 rbi/{lib => }/openai/models/responses/response.rbi | 0 .../openai/models/responses/response_audio_delta_event.rbi | 0 .../openai/models/responses/response_audio_done_event.rbi | 0 .../models/responses/response_audio_transcript_delta_event.rbi | 0 .../models/responses/response_audio_transcript_done_event.rbi | 0 .../responses/response_code_interpreter_call_code_delta_event.rbi | 0 .../responses/response_code_interpreter_call_code_done_event.rbi | 0 .../responses/response_code_interpreter_call_completed_event.rbi | 0 .../response_code_interpreter_call_in_progress_event.rbi | 0 .../response_code_interpreter_call_interpreting_event.rbi | 0 .../models/responses/response_code_interpreter_tool_call.rbi | 0 .../openai/models/responses/response_completed_event.rbi | 0 .../openai/models/responses/response_computer_tool_call.rbi | 0 .../models/responses/response_computer_tool_call_output_item.rbi | 0 .../responses/response_computer_tool_call_output_screenshot.rbi | 0 rbi/{lib => }/openai/models/responses/response_content.rbi | 0 .../openai/models/responses/response_content_part_added_event.rbi | 0 .../openai/models/responses/response_content_part_done_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_create_params.rbi | 0 rbi/{lib => }/openai/models/responses/response_created_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_delete_params.rbi | 0 rbi/{lib => }/openai/models/responses/response_error.rbi | 0 rbi/{lib => }/openai/models/responses/response_error_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_failed_event.rbi | 0 .../responses/response_file_search_call_completed_event.rbi | 0 .../responses/response_file_search_call_in_progress_event.rbi | 0 .../responses/response_file_search_call_searching_event.rbi | 0 .../openai/models/responses/response_file_search_tool_call.rbi | 0 .../openai/models/responses/response_format_text_config.rbi | 0 .../models/responses/response_format_text_json_schema_config.rbi | 0 .../responses/response_function_call_arguments_delta_event.rbi | 0 .../responses/response_function_call_arguments_done_event.rbi | 0 .../openai/models/responses/response_function_tool_call.rbi | 0 .../openai/models/responses/response_function_tool_call_item.rbi | 0 .../models/responses/response_function_tool_call_output_item.rbi | 0 .../openai/models/responses/response_function_web_search.rbi | 0 .../openai/models/responses/response_in_progress_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_includable.rbi | 0 .../openai/models/responses/response_incomplete_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_input.rbi | 0 rbi/{lib => }/openai/models/responses/response_input_audio.rbi | 0 rbi/{lib => }/openai/models/responses/response_input_content.rbi | 0 rbi/{lib => }/openai/models/responses/response_input_file.rbi | 0 rbi/{lib => }/openai/models/responses/response_input_image.rbi | 0 rbi/{lib => }/openai/models/responses/response_input_item.rbi | 0 .../models/responses/response_input_message_content_list.rbi | 0 .../openai/models/responses/response_input_message_item.rbi | 0 rbi/{lib => }/openai/models/responses/response_input_text.rbi | 0 rbi/{lib => }/openai/models/responses/response_item.rbi | 0 rbi/{lib => }/openai/models/responses/response_item_list.rbi | 0 rbi/{lib => }/openai/models/responses/response_output_audio.rbi | 0 rbi/{lib => }/openai/models/responses/response_output_item.rbi | 0 .../openai/models/responses/response_output_item_added_event.rbi | 0 .../openai/models/responses/response_output_item_done_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_output_message.rbi | 0 rbi/{lib => }/openai/models/responses/response_output_refusal.rbi | 0 rbi/{lib => }/openai/models/responses/response_output_text.rbi | 0 rbi/{lib => }/openai/models/responses/response_reasoning_item.rbi | 0 .../responses/response_reasoning_summary_part_added_event.rbi | 0 .../responses/response_reasoning_summary_part_done_event.rbi | 0 .../responses/response_reasoning_summary_text_delta_event.rbi | 0 .../responses/response_reasoning_summary_text_done_event.rbi | 0 .../openai/models/responses/response_refusal_delta_event.rbi | 0 .../openai/models/responses/response_refusal_done_event.rbi | 0 .../openai/models/responses/response_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/responses/response_status.rbi | 0 rbi/{lib => }/openai/models/responses/response_stream_event.rbi | 0 .../models/responses/response_text_annotation_delta_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_text_config.rbi | 0 .../openai/models/responses/response_text_delta_event.rbi | 0 .../openai/models/responses/response_text_done_event.rbi | 0 rbi/{lib => }/openai/models/responses/response_usage.rbi | 0 .../models/responses/response_web_search_call_completed_event.rbi | 0 .../responses/response_web_search_call_in_progress_event.rbi | 0 .../models/responses/response_web_search_call_searching_event.rbi | 0 rbi/{lib => }/openai/models/responses/tool.rbi | 0 rbi/{lib => }/openai/models/responses/tool_choice_function.rbi | 0 rbi/{lib => }/openai/models/responses/tool_choice_options.rbi | 0 rbi/{lib => }/openai/models/responses/tool_choice_types.rbi | 0 rbi/{lib => }/openai/models/responses/web_search_tool.rbi | 0 rbi/{lib => }/openai/models/responses_model.rbi | 0 rbi/{lib => }/openai/models/static_file_chunking_strategy.rbi | 0 .../openai/models/static_file_chunking_strategy_object.rbi | 0 .../openai/models/static_file_chunking_strategy_object_param.rbi | 0 rbi/{lib => }/openai/models/upload.rbi | 0 rbi/{lib => }/openai/models/upload_cancel_params.rbi | 0 rbi/{lib => }/openai/models/upload_complete_params.rbi | 0 rbi/{lib => }/openai/models/upload_create_params.rbi | 0 rbi/{lib => }/openai/models/uploads/part_create_params.rbi | 0 rbi/{lib => }/openai/models/uploads/upload_part.rbi | 0 rbi/{lib => }/openai/models/vector_store.rbi | 0 rbi/{lib => }/openai/models/vector_store_create_params.rbi | 0 rbi/{lib => }/openai/models/vector_store_delete_params.rbi | 0 rbi/{lib => }/openai/models/vector_store_deleted.rbi | 0 rbi/{lib => }/openai/models/vector_store_list_params.rbi | 0 rbi/{lib => }/openai/models/vector_store_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/vector_store_search_params.rbi | 0 rbi/{lib => }/openai/models/vector_store_search_response.rbi | 0 rbi/{lib => }/openai/models/vector_store_update_params.rbi | 0 .../openai/models/vector_stores/file_batch_cancel_params.rbi | 0 .../openai/models/vector_stores/file_batch_create_params.rbi | 0 .../openai/models/vector_stores/file_batch_list_files_params.rbi | 0 .../openai/models/vector_stores/file_batch_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/vector_stores/file_content_params.rbi | 0 .../openai/models/vector_stores/file_content_response.rbi | 0 rbi/{lib => }/openai/models/vector_stores/file_create_params.rbi | 0 rbi/{lib => }/openai/models/vector_stores/file_delete_params.rbi | 0 rbi/{lib => }/openai/models/vector_stores/file_list_params.rbi | 0 .../openai/models/vector_stores/file_retrieve_params.rbi | 0 rbi/{lib => }/openai/models/vector_stores/file_update_params.rbi | 0 rbi/{lib => }/openai/models/vector_stores/vector_store_file.rbi | 0 .../openai/models/vector_stores/vector_store_file_batch.rbi | 0 .../openai/models/vector_stores/vector_store_file_deleted.rbi | 0 rbi/{lib => }/openai/request_options.rbi | 0 rbi/{lib => }/openai/resources/audio.rbi | 0 rbi/{lib => }/openai/resources/audio/speech.rbi | 0 rbi/{lib => }/openai/resources/audio/transcriptions.rbi | 0 rbi/{lib => }/openai/resources/audio/translations.rbi | 0 rbi/{lib => }/openai/resources/batches.rbi | 0 rbi/{lib => }/openai/resources/beta.rbi | 0 rbi/{lib => }/openai/resources/beta/assistants.rbi | 0 rbi/{lib => }/openai/resources/beta/threads.rbi | 0 rbi/{lib => }/openai/resources/beta/threads/messages.rbi | 0 rbi/{lib => }/openai/resources/beta/threads/runs.rbi | 0 rbi/{lib => }/openai/resources/beta/threads/runs/steps.rbi | 0 rbi/{lib => }/openai/resources/chat.rbi | 0 rbi/{lib => }/openai/resources/chat/completions.rbi | 0 rbi/{lib => }/openai/resources/chat/completions/messages.rbi | 0 rbi/{lib => }/openai/resources/completions.rbi | 0 rbi/{lib => }/openai/resources/embeddings.rbi | 0 rbi/{lib => }/openai/resources/evals.rbi | 0 rbi/{lib => }/openai/resources/evals/runs.rbi | 0 rbi/{lib => }/openai/resources/evals/runs/output_items.rbi | 0 rbi/{lib => }/openai/resources/files.rbi | 0 rbi/{lib => }/openai/resources/fine_tuning.rbi | 0 rbi/{lib => }/openai/resources/fine_tuning/checkpoints.rbi | 0 .../openai/resources/fine_tuning/checkpoints/permissions.rbi | 0 rbi/{lib => }/openai/resources/fine_tuning/jobs.rbi | 0 rbi/{lib => }/openai/resources/fine_tuning/jobs/checkpoints.rbi | 0 rbi/{lib => }/openai/resources/images.rbi | 0 rbi/{lib => }/openai/resources/models.rbi | 0 rbi/{lib => }/openai/resources/moderations.rbi | 0 rbi/{lib => }/openai/resources/responses.rbi | 0 rbi/{lib => }/openai/resources/responses/input_items.rbi | 0 rbi/{lib => }/openai/resources/uploads.rbi | 0 rbi/{lib => }/openai/resources/uploads/parts.rbi | 0 rbi/{lib => }/openai/resources/vector_stores.rbi | 0 rbi/{lib => }/openai/resources/vector_stores/file_batches.rbi | 0 rbi/{lib => }/openai/resources/vector_stores/files.rbi | 0 rbi/{lib => }/openai/version.rbi | 0 428 files changed, 0 insertions(+), 0 deletions(-) rename rbi/{lib => }/openai/client.rbi (100%) rename rbi/{lib => }/openai/errors.rbi (100%) rename rbi/{lib => }/openai/file_part.rbi (100%) rename rbi/{lib => }/openai/internal.rbi (100%) rename rbi/{lib => }/openai/internal/cursor_page.rbi (100%) rename rbi/{lib => }/openai/internal/page.rbi (100%) rename rbi/{lib => }/openai/internal/stream.rbi (100%) rename rbi/{lib => }/openai/internal/transport/base_client.rbi (100%) rename rbi/{lib => }/openai/internal/transport/pooled_net_requester.rbi (100%) rename rbi/{lib => }/openai/internal/type/array_of.rbi (100%) rename rbi/{lib => }/openai/internal/type/base_model.rbi (100%) rename rbi/{lib => }/openai/internal/type/base_page.rbi (100%) rename rbi/{lib => }/openai/internal/type/base_stream.rbi (100%) rename rbi/{lib => }/openai/internal/type/boolean.rbi (100%) rename rbi/{lib => }/openai/internal/type/converter.rbi (100%) rename rbi/{lib => }/openai/internal/type/enum.rbi (100%) rename rbi/{lib => }/openai/internal/type/file_input.rbi (100%) rename rbi/{lib => }/openai/internal/type/hash_of.rbi (100%) rename rbi/{lib => }/openai/internal/type/request_parameters.rbi (100%) rename rbi/{lib => }/openai/internal/type/union.rbi (100%) rename rbi/{lib => }/openai/internal/type/unknown.rbi (100%) rename rbi/{lib => }/openai/internal/util.rbi (100%) rename rbi/{lib => }/openai/models/all_models.rbi (100%) rename rbi/{lib => }/openai/models/audio/speech_create_params.rbi (100%) rename rbi/{lib => }/openai/models/audio/speech_model.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_create_params.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_create_response.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_include.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_segment.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_stream_event.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_text_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_text_done_event.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_verbose.rbi (100%) rename rbi/{lib => }/openai/models/audio/transcription_word.rbi (100%) rename rbi/{lib => }/openai/models/audio/translation.rbi (100%) rename rbi/{lib => }/openai/models/audio/translation_create_params.rbi (100%) rename rbi/{lib => }/openai/models/audio/translation_create_response.rbi (100%) rename rbi/{lib => }/openai/models/audio/translation_verbose.rbi (100%) rename rbi/{lib => }/openai/models/audio_model.rbi (100%) rename rbi/{lib => }/openai/models/audio_response_format.rbi (100%) rename rbi/{lib => }/openai/models/auto_file_chunking_strategy_param.rbi (100%) rename rbi/{lib => }/openai/models/batch.rbi (100%) rename rbi/{lib => }/openai/models/batch_cancel_params.rbi (100%) rename rbi/{lib => }/openai/models/batch_create_params.rbi (100%) rename rbi/{lib => }/openai/models/batch_error.rbi (100%) rename rbi/{lib => }/openai/models/batch_list_params.rbi (100%) rename rbi/{lib => }/openai/models/batch_request_counts.rbi (100%) rename rbi/{lib => }/openai/models/batch_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_create_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_deleted.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_list_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_response_format_option.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_stream_event.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_tool.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_tool_choice.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_tool_choice_function.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_tool_choice_option.rbi (100%) rename rbi/{lib => }/openai/models/beta/assistant_update_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/code_interpreter_tool.rbi (100%) rename rbi/{lib => }/openai/models/beta/file_search_tool.rbi (100%) rename rbi/{lib => }/openai/models/beta/function_tool.rbi (100%) rename rbi/{lib => }/openai/models/beta/message_stream_event.rbi (100%) rename rbi/{lib => }/openai/models/beta/run_step_stream_event.rbi (100%) rename rbi/{lib => }/openai/models/beta/run_stream_event.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread_create_and_run_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread_create_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread_deleted.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread_stream_event.rbi (100%) rename rbi/{lib => }/openai/models/beta/thread_update_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/annotation.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/annotation_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/file_citation_annotation.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/file_citation_delta_annotation.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/file_path_annotation.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/file_path_delta_annotation.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_file.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_file_content_block.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_file_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_file_delta_block.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_url.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_url_content_block.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_url_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/image_url_delta_block.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_content.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_content_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_content_part_param.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_create_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_deleted.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_list_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/message_update_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/refusal_content_block.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/refusal_delta_block.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/required_action_function_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run_cancel_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run_create_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run_list_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run_status.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run_submit_tool_outputs_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/run_update_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/code_interpreter_logs.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/code_interpreter_output_image.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/file_search_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/function_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/function_tool_call_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/message_creation_step_details.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/run_step.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/run_step_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/run_step_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/run_step_include.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/step_list_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/step_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/tool_call.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/tool_call_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/tool_call_delta_object.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/runs/tool_calls_step_details.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/text.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/text_content_block.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/text_content_block_param.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/text_delta.rbi (100%) rename rbi/{lib => }/openai/models/beta/threads/text_delta_block.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_assistant_message_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_audio.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_audio_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_chunk.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_content_part.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_content_part_image.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_content_part_input_audio.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_content_part_refusal.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_content_part_text.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_deleted.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_developer_message_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_function_call_option.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_function_message_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_message.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_message_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_message_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_modality.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_named_tool_choice.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_prediction_content.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_reasoning_effort.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_role.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_store_message.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_stream_options.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_system_message_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_token_logprob.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_tool.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_tool_choice_option.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_tool_message_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/chat_completion_user_message_param.rbi (100%) rename rbi/{lib => }/openai/models/chat/completion_create_params.rbi (100%) rename rbi/{lib => }/openai/models/chat/completion_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/chat/completion_list_params.rbi (100%) rename rbi/{lib => }/openai/models/chat/completion_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/chat/completion_update_params.rbi (100%) rename rbi/{lib => }/openai/models/chat/completions/message_list_params.rbi (100%) rename rbi/{lib => }/openai/models/chat_model.rbi (100%) rename rbi/{lib => }/openai/models/comparison_filter.rbi (100%) rename rbi/{lib => }/openai/models/completion.rbi (100%) rename rbi/{lib => }/openai/models/completion_choice.rbi (100%) rename rbi/{lib => }/openai/models/completion_create_params.rbi (100%) rename rbi/{lib => }/openai/models/completion_usage.rbi (100%) rename rbi/{lib => }/openai/models/compound_filter.rbi (100%) rename rbi/{lib => }/openai/models/create_embedding_response.rbi (100%) rename rbi/{lib => }/openai/models/embedding.rbi (100%) rename rbi/{lib => }/openai/models/embedding_create_params.rbi (100%) rename rbi/{lib => }/openai/models/embedding_model.rbi (100%) rename rbi/{lib => }/openai/models/error_object.rbi (100%) rename rbi/{lib => }/openai/models/eval_create_params.rbi (100%) rename rbi/{lib => }/openai/models/eval_create_response.rbi (100%) rename rbi/{lib => }/openai/models/eval_custom_data_source_config.rbi (100%) rename rbi/{lib => }/openai/models/eval_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/eval_delete_response.rbi (100%) rename rbi/{lib => }/openai/models/eval_label_model_grader.rbi (100%) rename rbi/{lib => }/openai/models/eval_list_params.rbi (100%) rename rbi/{lib => }/openai/models/eval_list_response.rbi (100%) rename rbi/{lib => }/openai/models/eval_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/eval_retrieve_response.rbi (100%) rename rbi/{lib => }/openai/models/eval_stored_completions_data_source_config.rbi (100%) rename rbi/{lib => }/openai/models/eval_string_check_grader.rbi (100%) rename rbi/{lib => }/openai/models/eval_text_similarity_grader.rbi (100%) rename rbi/{lib => }/openai/models/eval_update_params.rbi (100%) rename rbi/{lib => }/openai/models/eval_update_response.rbi (100%) rename rbi/{lib => }/openai/models/evals/create_eval_completions_run_data_source.rbi (100%) rename rbi/{lib => }/openai/models/evals/create_eval_jsonl_run_data_source.rbi (100%) rename rbi/{lib => }/openai/models/evals/eval_api_error.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_cancel_params.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_cancel_response.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_create_params.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_create_response.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_delete_response.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_list_params.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_list_response.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/evals/run_retrieve_response.rbi (100%) rename rbi/{lib => }/openai/models/evals/runs/output_item_list_params.rbi (100%) rename rbi/{lib => }/openai/models/evals/runs/output_item_list_response.rbi (100%) rename rbi/{lib => }/openai/models/evals/runs/output_item_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/evals/runs/output_item_retrieve_response.rbi (100%) rename rbi/{lib => }/openai/models/file_chunking_strategy.rbi (100%) rename rbi/{lib => }/openai/models/file_chunking_strategy_param.rbi (100%) rename rbi/{lib => }/openai/models/file_content_params.rbi (100%) rename rbi/{lib => }/openai/models/file_create_params.rbi (100%) rename rbi/{lib => }/openai/models/file_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/file_deleted.rbi (100%) rename rbi/{lib => }/openai/models/file_list_params.rbi (100%) rename rbi/{lib => }/openai/models/file_object.rbi (100%) rename rbi/{lib => }/openai/models/file_purpose.rbi (100%) rename rbi/{lib => }/openai/models/file_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/checkpoints/permission_create_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/checkpoints/permission_create_response.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/fine_tuning_job.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/fine_tuning_job_event.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/fine_tuning_job_integration.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/job_cancel_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/job_create_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/job_list_events_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/job_list_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/job_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi (100%) rename rbi/{lib => }/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi (100%) rename rbi/{lib => }/openai/models/function_definition.rbi (100%) rename rbi/{lib => }/openai/models/function_parameters.rbi (100%) rename rbi/{lib => }/openai/models/image.rbi (100%) rename rbi/{lib => }/openai/models/image_create_variation_params.rbi (100%) rename rbi/{lib => }/openai/models/image_edit_params.rbi (100%) rename rbi/{lib => }/openai/models/image_generate_params.rbi (100%) rename rbi/{lib => }/openai/models/image_model.rbi (100%) rename rbi/{lib => }/openai/models/images_response.rbi (100%) rename rbi/{lib => }/openai/models/metadata.rbi (100%) rename rbi/{lib => }/openai/models/model.rbi (100%) rename rbi/{lib => }/openai/models/model_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/model_deleted.rbi (100%) rename rbi/{lib => }/openai/models/model_list_params.rbi (100%) rename rbi/{lib => }/openai/models/model_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/moderation.rbi (100%) rename rbi/{lib => }/openai/models/moderation_create_params.rbi (100%) rename rbi/{lib => }/openai/models/moderation_create_response.rbi (100%) rename rbi/{lib => }/openai/models/moderation_image_url_input.rbi (100%) rename rbi/{lib => }/openai/models/moderation_model.rbi (100%) rename rbi/{lib => }/openai/models/moderation_multi_modal_input.rbi (100%) rename rbi/{lib => }/openai/models/moderation_text_input.rbi (100%) rename rbi/{lib => }/openai/models/other_file_chunking_strategy_object.rbi (100%) rename rbi/{lib => }/openai/models/reasoning.rbi (100%) rename rbi/{lib => }/openai/models/reasoning_effort.rbi (100%) rename rbi/{lib => }/openai/models/response_format_json_object.rbi (100%) rename rbi/{lib => }/openai/models/response_format_json_schema.rbi (100%) rename rbi/{lib => }/openai/models/response_format_text.rbi (100%) rename rbi/{lib => }/openai/models/responses/computer_tool.rbi (100%) rename rbi/{lib => }/openai/models/responses/easy_input_message.rbi (100%) rename rbi/{lib => }/openai/models/responses/file_search_tool.rbi (100%) rename rbi/{lib => }/openai/models/responses/function_tool.rbi (100%) rename rbi/{lib => }/openai/models/responses/input_item_list_params.rbi (100%) rename rbi/{lib => }/openai/models/responses/response.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_audio_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_audio_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_audio_transcript_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_audio_transcript_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_code_interpreter_call_code_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_code_interpreter_call_completed_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_code_interpreter_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_completed_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_computer_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_computer_tool_call_output_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_computer_tool_call_output_screenshot.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_content.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_content_part_added_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_content_part_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_create_params.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_created_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_error.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_error_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_failed_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_file_search_call_completed_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_file_search_call_in_progress_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_file_search_call_searching_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_file_search_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_format_text_config.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_format_text_json_schema_config.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_function_call_arguments_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_function_call_arguments_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_function_tool_call.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_function_tool_call_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_function_tool_call_output_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_function_web_search.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_in_progress_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_includable.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_incomplete_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_audio.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_content.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_file.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_image.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_message_content_list.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_message_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_input_text.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_item_list.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_output_audio.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_output_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_output_item_added_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_output_item_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_output_message.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_output_refusal.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_output_text.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_reasoning_item.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_reasoning_summary_part_added_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_reasoning_summary_part_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_reasoning_summary_text_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_reasoning_summary_text_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_refusal_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_refusal_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_status.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_stream_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_text_annotation_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_text_config.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_text_delta_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_text_done_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_usage.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_web_search_call_completed_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_web_search_call_in_progress_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/response_web_search_call_searching_event.rbi (100%) rename rbi/{lib => }/openai/models/responses/tool.rbi (100%) rename rbi/{lib => }/openai/models/responses/tool_choice_function.rbi (100%) rename rbi/{lib => }/openai/models/responses/tool_choice_options.rbi (100%) rename rbi/{lib => }/openai/models/responses/tool_choice_types.rbi (100%) rename rbi/{lib => }/openai/models/responses/web_search_tool.rbi (100%) rename rbi/{lib => }/openai/models/responses_model.rbi (100%) rename rbi/{lib => }/openai/models/static_file_chunking_strategy.rbi (100%) rename rbi/{lib => }/openai/models/static_file_chunking_strategy_object.rbi (100%) rename rbi/{lib => }/openai/models/static_file_chunking_strategy_object_param.rbi (100%) rename rbi/{lib => }/openai/models/upload.rbi (100%) rename rbi/{lib => }/openai/models/upload_cancel_params.rbi (100%) rename rbi/{lib => }/openai/models/upload_complete_params.rbi (100%) rename rbi/{lib => }/openai/models/upload_create_params.rbi (100%) rename rbi/{lib => }/openai/models/uploads/part_create_params.rbi (100%) rename rbi/{lib => }/openai/models/uploads/upload_part.rbi (100%) rename rbi/{lib => }/openai/models/vector_store.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_create_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_deleted.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_list_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_search_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_search_response.rbi (100%) rename rbi/{lib => }/openai/models/vector_store_update_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_batch_cancel_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_batch_create_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_batch_list_files_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_batch_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_content_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_content_response.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_create_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_delete_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_list_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_retrieve_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/file_update_params.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/vector_store_file.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/vector_store_file_batch.rbi (100%) rename rbi/{lib => }/openai/models/vector_stores/vector_store_file_deleted.rbi (100%) rename rbi/{lib => }/openai/request_options.rbi (100%) rename rbi/{lib => }/openai/resources/audio.rbi (100%) rename rbi/{lib => }/openai/resources/audio/speech.rbi (100%) rename rbi/{lib => }/openai/resources/audio/transcriptions.rbi (100%) rename rbi/{lib => }/openai/resources/audio/translations.rbi (100%) rename rbi/{lib => }/openai/resources/batches.rbi (100%) rename rbi/{lib => }/openai/resources/beta.rbi (100%) rename rbi/{lib => }/openai/resources/beta/assistants.rbi (100%) rename rbi/{lib => }/openai/resources/beta/threads.rbi (100%) rename rbi/{lib => }/openai/resources/beta/threads/messages.rbi (100%) rename rbi/{lib => }/openai/resources/beta/threads/runs.rbi (100%) rename rbi/{lib => }/openai/resources/beta/threads/runs/steps.rbi (100%) rename rbi/{lib => }/openai/resources/chat.rbi (100%) rename rbi/{lib => }/openai/resources/chat/completions.rbi (100%) rename rbi/{lib => }/openai/resources/chat/completions/messages.rbi (100%) rename rbi/{lib => }/openai/resources/completions.rbi (100%) rename rbi/{lib => }/openai/resources/embeddings.rbi (100%) rename rbi/{lib => }/openai/resources/evals.rbi (100%) rename rbi/{lib => }/openai/resources/evals/runs.rbi (100%) rename rbi/{lib => }/openai/resources/evals/runs/output_items.rbi (100%) rename rbi/{lib => }/openai/resources/files.rbi (100%) rename rbi/{lib => }/openai/resources/fine_tuning.rbi (100%) rename rbi/{lib => }/openai/resources/fine_tuning/checkpoints.rbi (100%) rename rbi/{lib => }/openai/resources/fine_tuning/checkpoints/permissions.rbi (100%) rename rbi/{lib => }/openai/resources/fine_tuning/jobs.rbi (100%) rename rbi/{lib => }/openai/resources/fine_tuning/jobs/checkpoints.rbi (100%) rename rbi/{lib => }/openai/resources/images.rbi (100%) rename rbi/{lib => }/openai/resources/models.rbi (100%) rename rbi/{lib => }/openai/resources/moderations.rbi (100%) rename rbi/{lib => }/openai/resources/responses.rbi (100%) rename rbi/{lib => }/openai/resources/responses/input_items.rbi (100%) rename rbi/{lib => }/openai/resources/uploads.rbi (100%) rename rbi/{lib => }/openai/resources/uploads/parts.rbi (100%) rename rbi/{lib => }/openai/resources/vector_stores.rbi (100%) rename rbi/{lib => }/openai/resources/vector_stores/file_batches.rbi (100%) rename rbi/{lib => }/openai/resources/vector_stores/files.rbi (100%) rename rbi/{lib => }/openai/version.rbi (100%) diff --git a/rbi/lib/openai/client.rbi b/rbi/openai/client.rbi similarity index 100% rename from rbi/lib/openai/client.rbi rename to rbi/openai/client.rbi diff --git a/rbi/lib/openai/errors.rbi b/rbi/openai/errors.rbi similarity index 100% rename from rbi/lib/openai/errors.rbi rename to rbi/openai/errors.rbi diff --git a/rbi/lib/openai/file_part.rbi b/rbi/openai/file_part.rbi similarity index 100% rename from rbi/lib/openai/file_part.rbi rename to rbi/openai/file_part.rbi diff --git a/rbi/lib/openai/internal.rbi b/rbi/openai/internal.rbi similarity index 100% rename from rbi/lib/openai/internal.rbi rename to rbi/openai/internal.rbi diff --git a/rbi/lib/openai/internal/cursor_page.rbi b/rbi/openai/internal/cursor_page.rbi similarity index 100% rename from rbi/lib/openai/internal/cursor_page.rbi rename to rbi/openai/internal/cursor_page.rbi diff --git a/rbi/lib/openai/internal/page.rbi b/rbi/openai/internal/page.rbi similarity index 100% rename from rbi/lib/openai/internal/page.rbi rename to rbi/openai/internal/page.rbi diff --git a/rbi/lib/openai/internal/stream.rbi b/rbi/openai/internal/stream.rbi similarity index 100% rename from rbi/lib/openai/internal/stream.rbi rename to rbi/openai/internal/stream.rbi diff --git a/rbi/lib/openai/internal/transport/base_client.rbi b/rbi/openai/internal/transport/base_client.rbi similarity index 100% rename from rbi/lib/openai/internal/transport/base_client.rbi rename to rbi/openai/internal/transport/base_client.rbi diff --git a/rbi/lib/openai/internal/transport/pooled_net_requester.rbi b/rbi/openai/internal/transport/pooled_net_requester.rbi similarity index 100% rename from rbi/lib/openai/internal/transport/pooled_net_requester.rbi rename to rbi/openai/internal/transport/pooled_net_requester.rbi diff --git a/rbi/lib/openai/internal/type/array_of.rbi b/rbi/openai/internal/type/array_of.rbi similarity index 100% rename from rbi/lib/openai/internal/type/array_of.rbi rename to rbi/openai/internal/type/array_of.rbi diff --git a/rbi/lib/openai/internal/type/base_model.rbi b/rbi/openai/internal/type/base_model.rbi similarity index 100% rename from rbi/lib/openai/internal/type/base_model.rbi rename to rbi/openai/internal/type/base_model.rbi diff --git a/rbi/lib/openai/internal/type/base_page.rbi b/rbi/openai/internal/type/base_page.rbi similarity index 100% rename from rbi/lib/openai/internal/type/base_page.rbi rename to rbi/openai/internal/type/base_page.rbi diff --git a/rbi/lib/openai/internal/type/base_stream.rbi b/rbi/openai/internal/type/base_stream.rbi similarity index 100% rename from rbi/lib/openai/internal/type/base_stream.rbi rename to rbi/openai/internal/type/base_stream.rbi diff --git a/rbi/lib/openai/internal/type/boolean.rbi b/rbi/openai/internal/type/boolean.rbi similarity index 100% rename from rbi/lib/openai/internal/type/boolean.rbi rename to rbi/openai/internal/type/boolean.rbi diff --git a/rbi/lib/openai/internal/type/converter.rbi b/rbi/openai/internal/type/converter.rbi similarity index 100% rename from rbi/lib/openai/internal/type/converter.rbi rename to rbi/openai/internal/type/converter.rbi diff --git a/rbi/lib/openai/internal/type/enum.rbi b/rbi/openai/internal/type/enum.rbi similarity index 100% rename from rbi/lib/openai/internal/type/enum.rbi rename to rbi/openai/internal/type/enum.rbi diff --git a/rbi/lib/openai/internal/type/file_input.rbi b/rbi/openai/internal/type/file_input.rbi similarity index 100% rename from rbi/lib/openai/internal/type/file_input.rbi rename to rbi/openai/internal/type/file_input.rbi diff --git a/rbi/lib/openai/internal/type/hash_of.rbi b/rbi/openai/internal/type/hash_of.rbi similarity index 100% rename from rbi/lib/openai/internal/type/hash_of.rbi rename to rbi/openai/internal/type/hash_of.rbi diff --git a/rbi/lib/openai/internal/type/request_parameters.rbi b/rbi/openai/internal/type/request_parameters.rbi similarity index 100% rename from rbi/lib/openai/internal/type/request_parameters.rbi rename to rbi/openai/internal/type/request_parameters.rbi diff --git a/rbi/lib/openai/internal/type/union.rbi b/rbi/openai/internal/type/union.rbi similarity index 100% rename from rbi/lib/openai/internal/type/union.rbi rename to rbi/openai/internal/type/union.rbi diff --git a/rbi/lib/openai/internal/type/unknown.rbi b/rbi/openai/internal/type/unknown.rbi similarity index 100% rename from rbi/lib/openai/internal/type/unknown.rbi rename to rbi/openai/internal/type/unknown.rbi diff --git a/rbi/lib/openai/internal/util.rbi b/rbi/openai/internal/util.rbi similarity index 100% rename from rbi/lib/openai/internal/util.rbi rename to rbi/openai/internal/util.rbi diff --git a/rbi/lib/openai/models/all_models.rbi b/rbi/openai/models/all_models.rbi similarity index 100% rename from rbi/lib/openai/models/all_models.rbi rename to rbi/openai/models/all_models.rbi diff --git a/rbi/lib/openai/models/audio/speech_create_params.rbi b/rbi/openai/models/audio/speech_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/audio/speech_create_params.rbi rename to rbi/openai/models/audio/speech_create_params.rbi diff --git a/rbi/lib/openai/models/audio/speech_model.rbi b/rbi/openai/models/audio/speech_model.rbi similarity index 100% rename from rbi/lib/openai/models/audio/speech_model.rbi rename to rbi/openai/models/audio/speech_model.rbi diff --git a/rbi/lib/openai/models/audio/transcription.rbi b/rbi/openai/models/audio/transcription.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription.rbi rename to rbi/openai/models/audio/transcription.rbi diff --git a/rbi/lib/openai/models/audio/transcription_create_params.rbi b/rbi/openai/models/audio/transcription_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_create_params.rbi rename to rbi/openai/models/audio/transcription_create_params.rbi diff --git a/rbi/lib/openai/models/audio/transcription_create_response.rbi b/rbi/openai/models/audio/transcription_create_response.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_create_response.rbi rename to rbi/openai/models/audio/transcription_create_response.rbi diff --git a/rbi/lib/openai/models/audio/transcription_include.rbi b/rbi/openai/models/audio/transcription_include.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_include.rbi rename to rbi/openai/models/audio/transcription_include.rbi diff --git a/rbi/lib/openai/models/audio/transcription_segment.rbi b/rbi/openai/models/audio/transcription_segment.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_segment.rbi rename to rbi/openai/models/audio/transcription_segment.rbi diff --git a/rbi/lib/openai/models/audio/transcription_stream_event.rbi b/rbi/openai/models/audio/transcription_stream_event.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_stream_event.rbi rename to rbi/openai/models/audio/transcription_stream_event.rbi diff --git a/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi b/rbi/openai/models/audio/transcription_text_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_text_delta_event.rbi rename to rbi/openai/models/audio/transcription_text_delta_event.rbi diff --git a/rbi/lib/openai/models/audio/transcription_text_done_event.rbi b/rbi/openai/models/audio/transcription_text_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_text_done_event.rbi rename to rbi/openai/models/audio/transcription_text_done_event.rbi diff --git a/rbi/lib/openai/models/audio/transcription_verbose.rbi b/rbi/openai/models/audio/transcription_verbose.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_verbose.rbi rename to rbi/openai/models/audio/transcription_verbose.rbi diff --git a/rbi/lib/openai/models/audio/transcription_word.rbi b/rbi/openai/models/audio/transcription_word.rbi similarity index 100% rename from rbi/lib/openai/models/audio/transcription_word.rbi rename to rbi/openai/models/audio/transcription_word.rbi diff --git a/rbi/lib/openai/models/audio/translation.rbi b/rbi/openai/models/audio/translation.rbi similarity index 100% rename from rbi/lib/openai/models/audio/translation.rbi rename to rbi/openai/models/audio/translation.rbi diff --git a/rbi/lib/openai/models/audio/translation_create_params.rbi b/rbi/openai/models/audio/translation_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/audio/translation_create_params.rbi rename to rbi/openai/models/audio/translation_create_params.rbi diff --git a/rbi/lib/openai/models/audio/translation_create_response.rbi b/rbi/openai/models/audio/translation_create_response.rbi similarity index 100% rename from rbi/lib/openai/models/audio/translation_create_response.rbi rename to rbi/openai/models/audio/translation_create_response.rbi diff --git a/rbi/lib/openai/models/audio/translation_verbose.rbi b/rbi/openai/models/audio/translation_verbose.rbi similarity index 100% rename from rbi/lib/openai/models/audio/translation_verbose.rbi rename to rbi/openai/models/audio/translation_verbose.rbi diff --git a/rbi/lib/openai/models/audio_model.rbi b/rbi/openai/models/audio_model.rbi similarity index 100% rename from rbi/lib/openai/models/audio_model.rbi rename to rbi/openai/models/audio_model.rbi diff --git a/rbi/lib/openai/models/audio_response_format.rbi b/rbi/openai/models/audio_response_format.rbi similarity index 100% rename from rbi/lib/openai/models/audio_response_format.rbi rename to rbi/openai/models/audio_response_format.rbi diff --git a/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi b/rbi/openai/models/auto_file_chunking_strategy_param.rbi similarity index 100% rename from rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi rename to rbi/openai/models/auto_file_chunking_strategy_param.rbi diff --git a/rbi/lib/openai/models/batch.rbi b/rbi/openai/models/batch.rbi similarity index 100% rename from rbi/lib/openai/models/batch.rbi rename to rbi/openai/models/batch.rbi diff --git a/rbi/lib/openai/models/batch_cancel_params.rbi b/rbi/openai/models/batch_cancel_params.rbi similarity index 100% rename from rbi/lib/openai/models/batch_cancel_params.rbi rename to rbi/openai/models/batch_cancel_params.rbi diff --git a/rbi/lib/openai/models/batch_create_params.rbi b/rbi/openai/models/batch_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/batch_create_params.rbi rename to rbi/openai/models/batch_create_params.rbi diff --git a/rbi/lib/openai/models/batch_error.rbi b/rbi/openai/models/batch_error.rbi similarity index 100% rename from rbi/lib/openai/models/batch_error.rbi rename to rbi/openai/models/batch_error.rbi diff --git a/rbi/lib/openai/models/batch_list_params.rbi b/rbi/openai/models/batch_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/batch_list_params.rbi rename to rbi/openai/models/batch_list_params.rbi diff --git a/rbi/lib/openai/models/batch_request_counts.rbi b/rbi/openai/models/batch_request_counts.rbi similarity index 100% rename from rbi/lib/openai/models/batch_request_counts.rbi rename to rbi/openai/models/batch_request_counts.rbi diff --git a/rbi/lib/openai/models/batch_retrieve_params.rbi b/rbi/openai/models/batch_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/batch_retrieve_params.rbi rename to rbi/openai/models/batch_retrieve_params.rbi diff --git a/rbi/lib/openai/models/beta/assistant.rbi b/rbi/openai/models/beta/assistant.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant.rbi rename to rbi/openai/models/beta/assistant.rbi diff --git a/rbi/lib/openai/models/beta/assistant_create_params.rbi b/rbi/openai/models/beta/assistant_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_create_params.rbi rename to rbi/openai/models/beta/assistant_create_params.rbi diff --git a/rbi/lib/openai/models/beta/assistant_delete_params.rbi b/rbi/openai/models/beta/assistant_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_delete_params.rbi rename to rbi/openai/models/beta/assistant_delete_params.rbi diff --git a/rbi/lib/openai/models/beta/assistant_deleted.rbi b/rbi/openai/models/beta/assistant_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_deleted.rbi rename to rbi/openai/models/beta/assistant_deleted.rbi diff --git a/rbi/lib/openai/models/beta/assistant_list_params.rbi b/rbi/openai/models/beta/assistant_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_list_params.rbi rename to rbi/openai/models/beta/assistant_list_params.rbi diff --git a/rbi/lib/openai/models/beta/assistant_response_format_option.rbi b/rbi/openai/models/beta/assistant_response_format_option.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_response_format_option.rbi rename to rbi/openai/models/beta/assistant_response_format_option.rbi diff --git a/rbi/lib/openai/models/beta/assistant_retrieve_params.rbi b/rbi/openai/models/beta/assistant_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_retrieve_params.rbi rename to rbi/openai/models/beta/assistant_retrieve_params.rbi diff --git a/rbi/lib/openai/models/beta/assistant_stream_event.rbi b/rbi/openai/models/beta/assistant_stream_event.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_stream_event.rbi rename to rbi/openai/models/beta/assistant_stream_event.rbi diff --git a/rbi/lib/openai/models/beta/assistant_tool.rbi b/rbi/openai/models/beta/assistant_tool.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_tool.rbi rename to rbi/openai/models/beta/assistant_tool.rbi diff --git a/rbi/lib/openai/models/beta/assistant_tool_choice.rbi b/rbi/openai/models/beta/assistant_tool_choice.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_tool_choice.rbi rename to rbi/openai/models/beta/assistant_tool_choice.rbi diff --git a/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi b/rbi/openai/models/beta/assistant_tool_choice_function.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi rename to rbi/openai/models/beta/assistant_tool_choice_function.rbi diff --git a/rbi/lib/openai/models/beta/assistant_tool_choice_option.rbi b/rbi/openai/models/beta/assistant_tool_choice_option.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_tool_choice_option.rbi rename to rbi/openai/models/beta/assistant_tool_choice_option.rbi diff --git a/rbi/lib/openai/models/beta/assistant_update_params.rbi b/rbi/openai/models/beta/assistant_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/assistant_update_params.rbi rename to rbi/openai/models/beta/assistant_update_params.rbi diff --git a/rbi/lib/openai/models/beta/code_interpreter_tool.rbi b/rbi/openai/models/beta/code_interpreter_tool.rbi similarity index 100% rename from rbi/lib/openai/models/beta/code_interpreter_tool.rbi rename to rbi/openai/models/beta/code_interpreter_tool.rbi diff --git a/rbi/lib/openai/models/beta/file_search_tool.rbi b/rbi/openai/models/beta/file_search_tool.rbi similarity index 100% rename from rbi/lib/openai/models/beta/file_search_tool.rbi rename to rbi/openai/models/beta/file_search_tool.rbi diff --git a/rbi/lib/openai/models/beta/function_tool.rbi b/rbi/openai/models/beta/function_tool.rbi similarity index 100% rename from rbi/lib/openai/models/beta/function_tool.rbi rename to rbi/openai/models/beta/function_tool.rbi diff --git a/rbi/lib/openai/models/beta/message_stream_event.rbi b/rbi/openai/models/beta/message_stream_event.rbi similarity index 100% rename from rbi/lib/openai/models/beta/message_stream_event.rbi rename to rbi/openai/models/beta/message_stream_event.rbi diff --git a/rbi/lib/openai/models/beta/run_step_stream_event.rbi b/rbi/openai/models/beta/run_step_stream_event.rbi similarity index 100% rename from rbi/lib/openai/models/beta/run_step_stream_event.rbi rename to rbi/openai/models/beta/run_step_stream_event.rbi diff --git a/rbi/lib/openai/models/beta/run_stream_event.rbi b/rbi/openai/models/beta/run_stream_event.rbi similarity index 100% rename from rbi/lib/openai/models/beta/run_stream_event.rbi rename to rbi/openai/models/beta/run_stream_event.rbi diff --git a/rbi/lib/openai/models/beta/thread.rbi b/rbi/openai/models/beta/thread.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread.rbi rename to rbi/openai/models/beta/thread.rbi diff --git a/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi b/rbi/openai/models/beta/thread_create_and_run_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread_create_and_run_params.rbi rename to rbi/openai/models/beta/thread_create_and_run_params.rbi diff --git a/rbi/lib/openai/models/beta/thread_create_params.rbi b/rbi/openai/models/beta/thread_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread_create_params.rbi rename to rbi/openai/models/beta/thread_create_params.rbi diff --git a/rbi/lib/openai/models/beta/thread_delete_params.rbi b/rbi/openai/models/beta/thread_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread_delete_params.rbi rename to rbi/openai/models/beta/thread_delete_params.rbi diff --git a/rbi/lib/openai/models/beta/thread_deleted.rbi b/rbi/openai/models/beta/thread_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread_deleted.rbi rename to rbi/openai/models/beta/thread_deleted.rbi diff --git a/rbi/lib/openai/models/beta/thread_retrieve_params.rbi b/rbi/openai/models/beta/thread_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread_retrieve_params.rbi rename to rbi/openai/models/beta/thread_retrieve_params.rbi diff --git a/rbi/lib/openai/models/beta/thread_stream_event.rbi b/rbi/openai/models/beta/thread_stream_event.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread_stream_event.rbi rename to rbi/openai/models/beta/thread_stream_event.rbi diff --git a/rbi/lib/openai/models/beta/thread_update_params.rbi b/rbi/openai/models/beta/thread_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/thread_update_params.rbi rename to rbi/openai/models/beta/thread_update_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/annotation.rbi b/rbi/openai/models/beta/threads/annotation.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/annotation.rbi rename to rbi/openai/models/beta/threads/annotation.rbi diff --git a/rbi/lib/openai/models/beta/threads/annotation_delta.rbi b/rbi/openai/models/beta/threads/annotation_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/annotation_delta.rbi rename to rbi/openai/models/beta/threads/annotation_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi b/rbi/openai/models/beta/threads/file_citation_annotation.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi rename to rbi/openai/models/beta/threads/file_citation_annotation.rbi diff --git a/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi b/rbi/openai/models/beta/threads/file_citation_delta_annotation.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi rename to rbi/openai/models/beta/threads/file_citation_delta_annotation.rbi diff --git a/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi b/rbi/openai/models/beta/threads/file_path_annotation.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/file_path_annotation.rbi rename to rbi/openai/models/beta/threads/file_path_annotation.rbi diff --git a/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi b/rbi/openai/models/beta/threads/file_path_delta_annotation.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi rename to rbi/openai/models/beta/threads/file_path_delta_annotation.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_file.rbi b/rbi/openai/models/beta/threads/image_file.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_file.rbi rename to rbi/openai/models/beta/threads/image_file.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi b/rbi/openai/models/beta/threads/image_file_content_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_file_content_block.rbi rename to rbi/openai/models/beta/threads/image_file_content_block.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_file_delta.rbi b/rbi/openai/models/beta/threads/image_file_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_file_delta.rbi rename to rbi/openai/models/beta/threads/image_file_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi b/rbi/openai/models/beta/threads/image_file_delta_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi rename to rbi/openai/models/beta/threads/image_file_delta_block.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_url.rbi b/rbi/openai/models/beta/threads/image_url.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_url.rbi rename to rbi/openai/models/beta/threads/image_url.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi b/rbi/openai/models/beta/threads/image_url_content_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_url_content_block.rbi rename to rbi/openai/models/beta/threads/image_url_content_block.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_url_delta.rbi b/rbi/openai/models/beta/threads/image_url_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_url_delta.rbi rename to rbi/openai/models/beta/threads/image_url_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi b/rbi/openai/models/beta/threads/image_url_delta_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi rename to rbi/openai/models/beta/threads/image_url_delta_block.rbi diff --git a/rbi/lib/openai/models/beta/threads/message.rbi b/rbi/openai/models/beta/threads/message.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message.rbi rename to rbi/openai/models/beta/threads/message.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_content.rbi b/rbi/openai/models/beta/threads/message_content.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_content.rbi rename to rbi/openai/models/beta/threads/message_content.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_content_delta.rbi b/rbi/openai/models/beta/threads/message_content_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_content_delta.rbi rename to rbi/openai/models/beta/threads/message_content_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_content_part_param.rbi b/rbi/openai/models/beta/threads/message_content_part_param.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_content_part_param.rbi rename to rbi/openai/models/beta/threads/message_content_part_param.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_create_params.rbi b/rbi/openai/models/beta/threads/message_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_create_params.rbi rename to rbi/openai/models/beta/threads/message_create_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_delete_params.rbi b/rbi/openai/models/beta/threads/message_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_delete_params.rbi rename to rbi/openai/models/beta/threads/message_delete_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_deleted.rbi b/rbi/openai/models/beta/threads/message_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_deleted.rbi rename to rbi/openai/models/beta/threads/message_deleted.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_delta.rbi b/rbi/openai/models/beta/threads/message_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_delta.rbi rename to rbi/openai/models/beta/threads/message_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_delta_event.rbi b/rbi/openai/models/beta/threads/message_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_delta_event.rbi rename to rbi/openai/models/beta/threads/message_delta_event.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_list_params.rbi b/rbi/openai/models/beta/threads/message_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_list_params.rbi rename to rbi/openai/models/beta/threads/message_list_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_retrieve_params.rbi b/rbi/openai/models/beta/threads/message_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_retrieve_params.rbi rename to rbi/openai/models/beta/threads/message_retrieve_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/message_update_params.rbi b/rbi/openai/models/beta/threads/message_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/message_update_params.rbi rename to rbi/openai/models/beta/threads/message_update_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi b/rbi/openai/models/beta/threads/refusal_content_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/refusal_content_block.rbi rename to rbi/openai/models/beta/threads/refusal_content_block.rbi diff --git a/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi b/rbi/openai/models/beta/threads/refusal_delta_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi rename to rbi/openai/models/beta/threads/refusal_delta_block.rbi diff --git a/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi b/rbi/openai/models/beta/threads/required_action_function_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi rename to rbi/openai/models/beta/threads/required_action_function_tool_call.rbi diff --git a/rbi/lib/openai/models/beta/threads/run.rbi b/rbi/openai/models/beta/threads/run.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run.rbi rename to rbi/openai/models/beta/threads/run.rbi diff --git a/rbi/lib/openai/models/beta/threads/run_cancel_params.rbi b/rbi/openai/models/beta/threads/run_cancel_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run_cancel_params.rbi rename to rbi/openai/models/beta/threads/run_cancel_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/run_create_params.rbi b/rbi/openai/models/beta/threads/run_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run_create_params.rbi rename to rbi/openai/models/beta/threads/run_create_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/run_list_params.rbi b/rbi/openai/models/beta/threads/run_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run_list_params.rbi rename to rbi/openai/models/beta/threads/run_list_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/run_retrieve_params.rbi b/rbi/openai/models/beta/threads/run_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run_retrieve_params.rbi rename to rbi/openai/models/beta/threads/run_retrieve_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/run_status.rbi b/rbi/openai/models/beta/threads/run_status.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run_status.rbi rename to rbi/openai/models/beta/threads/run_status.rbi diff --git a/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi b/rbi/openai/models/beta/threads/run_submit_tool_outputs_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi rename to rbi/openai/models/beta/threads/run_submit_tool_outputs_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/run_update_params.rbi b/rbi/openai/models/beta/threads/run_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/run_update_params.rbi rename to rbi/openai/models/beta/threads/run_update_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi b/rbi/openai/models/beta/threads/runs/code_interpreter_logs.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi rename to rbi/openai/models/beta/threads/runs/code_interpreter_logs.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi b/rbi/openai/models/beta/threads/runs/code_interpreter_output_image.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi rename to rbi/openai/models/beta/threads/runs/code_interpreter_output_image.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi b/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi rename to rbi/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi b/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi rename to rbi/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi b/rbi/openai/models/beta/threads/runs/file_search_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi rename to rbi/openai/models/beta/threads/runs/file_search_tool_call.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi b/rbi/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi rename to rbi/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi b/rbi/openai/models/beta/threads/runs/function_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi rename to rbi/openai/models/beta/threads/runs/function_tool_call.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi b/rbi/openai/models/beta/threads/runs/function_tool_call_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi rename to rbi/openai/models/beta/threads/runs/function_tool_call_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi b/rbi/openai/models/beta/threads/runs/message_creation_step_details.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi rename to rbi/openai/models/beta/threads/runs/message_creation_step_details.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step.rbi b/rbi/openai/models/beta/threads/runs/run_step.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/run_step.rbi rename to rbi/openai/models/beta/threads/runs/run_step.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi b/rbi/openai/models/beta/threads/runs/run_step_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi rename to rbi/openai/models/beta/threads/runs/run_step_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi b/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi rename to rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi b/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi rename to rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_include.rbi b/rbi/openai/models/beta/threads/runs/run_step_include.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/run_step_include.rbi rename to rbi/openai/models/beta/threads/runs/run_step_include.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi b/rbi/openai/models/beta/threads/runs/step_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi rename to rbi/openai/models/beta/threads/runs/step_list_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi b/rbi/openai/models/beta/threads/runs/step_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi rename to rbi/openai/models/beta/threads/runs/step_retrieve_params.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_call.rbi b/rbi/openai/models/beta/threads/runs/tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/tool_call.rbi rename to rbi/openai/models/beta/threads/runs/tool_call.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_call_delta.rbi b/rbi/openai/models/beta/threads/runs/tool_call_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/tool_call_delta.rbi rename to rbi/openai/models/beta/threads/runs/tool_call_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi b/rbi/openai/models/beta/threads/runs/tool_call_delta_object.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi rename to rbi/openai/models/beta/threads/runs/tool_call_delta_object.rbi diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi b/rbi/openai/models/beta/threads/runs/tool_calls_step_details.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi rename to rbi/openai/models/beta/threads/runs/tool_calls_step_details.rbi diff --git a/rbi/lib/openai/models/beta/threads/text.rbi b/rbi/openai/models/beta/threads/text.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/text.rbi rename to rbi/openai/models/beta/threads/text.rbi diff --git a/rbi/lib/openai/models/beta/threads/text_content_block.rbi b/rbi/openai/models/beta/threads/text_content_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/text_content_block.rbi rename to rbi/openai/models/beta/threads/text_content_block.rbi diff --git a/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi b/rbi/openai/models/beta/threads/text_content_block_param.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/text_content_block_param.rbi rename to rbi/openai/models/beta/threads/text_content_block_param.rbi diff --git a/rbi/lib/openai/models/beta/threads/text_delta.rbi b/rbi/openai/models/beta/threads/text_delta.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/text_delta.rbi rename to rbi/openai/models/beta/threads/text_delta.rbi diff --git a/rbi/lib/openai/models/beta/threads/text_delta_block.rbi b/rbi/openai/models/beta/threads/text_delta_block.rbi similarity index 100% rename from rbi/lib/openai/models/beta/threads/text_delta_block.rbi rename to rbi/openai/models/beta/threads/text_delta_block.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion.rbi b/rbi/openai/models/chat/chat_completion.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion.rbi rename to rbi/openai/models/chat/chat_completion.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi b/rbi/openai/models/chat/chat_completion_assistant_message_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi rename to rbi/openai/models/chat/chat_completion_assistant_message_param.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_audio.rbi b/rbi/openai/models/chat/chat_completion_audio.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_audio.rbi rename to rbi/openai/models/chat/chat_completion_audio.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi b/rbi/openai/models/chat/chat_completion_audio_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_audio_param.rbi rename to rbi/openai/models/chat/chat_completion_audio_param.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_chunk.rbi b/rbi/openai/models/chat/chat_completion_chunk.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_chunk.rbi rename to rbi/openai/models/chat/chat_completion_chunk.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part.rbi b/rbi/openai/models/chat/chat_completion_content_part.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_content_part.rbi rename to rbi/openai/models/chat/chat_completion_content_part.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi b/rbi/openai/models/chat/chat_completion_content_part_image.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi rename to rbi/openai/models/chat/chat_completion_content_part_image.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi b/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi rename to rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi b/rbi/openai/models/chat/chat_completion_content_part_refusal.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi rename to rbi/openai/models/chat/chat_completion_content_part_refusal.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi b/rbi/openai/models/chat/chat_completion_content_part_text.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi rename to rbi/openai/models/chat/chat_completion_content_part_text.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_deleted.rbi b/rbi/openai/models/chat/chat_completion_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_deleted.rbi rename to rbi/openai/models/chat/chat_completion_deleted.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi b/rbi/openai/models/chat/chat_completion_developer_message_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi rename to rbi/openai/models/chat/chat_completion_developer_message_param.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi b/rbi/openai/models/chat/chat_completion_function_call_option.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi rename to rbi/openai/models/chat/chat_completion_function_call_option.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi b/rbi/openai/models/chat/chat_completion_function_message_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi rename to rbi/openai/models/chat/chat_completion_function_message_param.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_message.rbi b/rbi/openai/models/chat/chat_completion_message.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_message.rbi rename to rbi/openai/models/chat/chat_completion_message.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_message_param.rbi b/rbi/openai/models/chat/chat_completion_message_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_message_param.rbi rename to rbi/openai/models/chat/chat_completion_message_param.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi b/rbi/openai/models/chat/chat_completion_message_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi rename to rbi/openai/models/chat/chat_completion_message_tool_call.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_modality.rbi b/rbi/openai/models/chat/chat_completion_modality.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_modality.rbi rename to rbi/openai/models/chat/chat_completion_modality.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi b/rbi/openai/models/chat/chat_completion_named_tool_choice.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi rename to rbi/openai/models/chat/chat_completion_named_tool_choice.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi b/rbi/openai/models/chat/chat_completion_prediction_content.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi rename to rbi/openai/models/chat/chat_completion_prediction_content.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_reasoning_effort.rbi b/rbi/openai/models/chat/chat_completion_reasoning_effort.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_reasoning_effort.rbi rename to rbi/openai/models/chat/chat_completion_reasoning_effort.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_role.rbi b/rbi/openai/models/chat/chat_completion_role.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_role.rbi rename to rbi/openai/models/chat/chat_completion_role.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_store_message.rbi b/rbi/openai/models/chat/chat_completion_store_message.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_store_message.rbi rename to rbi/openai/models/chat/chat_completion_store_message.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi b/rbi/openai/models/chat/chat_completion_stream_options.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_stream_options.rbi rename to rbi/openai/models/chat/chat_completion_stream_options.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi b/rbi/openai/models/chat/chat_completion_system_message_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi rename to rbi/openai/models/chat/chat_completion_system_message_param.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi b/rbi/openai/models/chat/chat_completion_token_logprob.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi rename to rbi/openai/models/chat/chat_completion_token_logprob.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_tool.rbi b/rbi/openai/models/chat/chat_completion_tool.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_tool.rbi rename to rbi/openai/models/chat/chat_completion_tool.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_tool_choice_option.rbi b/rbi/openai/models/chat/chat_completion_tool_choice_option.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_tool_choice_option.rbi rename to rbi/openai/models/chat/chat_completion_tool_choice_option.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi b/rbi/openai/models/chat/chat_completion_tool_message_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi rename to rbi/openai/models/chat/chat_completion_tool_message_param.rbi diff --git a/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi b/rbi/openai/models/chat/chat_completion_user_message_param.rbi similarity index 100% rename from rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi rename to rbi/openai/models/chat/chat_completion_user_message_param.rbi diff --git a/rbi/lib/openai/models/chat/completion_create_params.rbi b/rbi/openai/models/chat/completion_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/chat/completion_create_params.rbi rename to rbi/openai/models/chat/completion_create_params.rbi diff --git a/rbi/lib/openai/models/chat/completion_delete_params.rbi b/rbi/openai/models/chat/completion_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/chat/completion_delete_params.rbi rename to rbi/openai/models/chat/completion_delete_params.rbi diff --git a/rbi/lib/openai/models/chat/completion_list_params.rbi b/rbi/openai/models/chat/completion_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/chat/completion_list_params.rbi rename to rbi/openai/models/chat/completion_list_params.rbi diff --git a/rbi/lib/openai/models/chat/completion_retrieve_params.rbi b/rbi/openai/models/chat/completion_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/chat/completion_retrieve_params.rbi rename to rbi/openai/models/chat/completion_retrieve_params.rbi diff --git a/rbi/lib/openai/models/chat/completion_update_params.rbi b/rbi/openai/models/chat/completion_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/chat/completion_update_params.rbi rename to rbi/openai/models/chat/completion_update_params.rbi diff --git a/rbi/lib/openai/models/chat/completions/message_list_params.rbi b/rbi/openai/models/chat/completions/message_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/chat/completions/message_list_params.rbi rename to rbi/openai/models/chat/completions/message_list_params.rbi diff --git a/rbi/lib/openai/models/chat_model.rbi b/rbi/openai/models/chat_model.rbi similarity index 100% rename from rbi/lib/openai/models/chat_model.rbi rename to rbi/openai/models/chat_model.rbi diff --git a/rbi/lib/openai/models/comparison_filter.rbi b/rbi/openai/models/comparison_filter.rbi similarity index 100% rename from rbi/lib/openai/models/comparison_filter.rbi rename to rbi/openai/models/comparison_filter.rbi diff --git a/rbi/lib/openai/models/completion.rbi b/rbi/openai/models/completion.rbi similarity index 100% rename from rbi/lib/openai/models/completion.rbi rename to rbi/openai/models/completion.rbi diff --git a/rbi/lib/openai/models/completion_choice.rbi b/rbi/openai/models/completion_choice.rbi similarity index 100% rename from rbi/lib/openai/models/completion_choice.rbi rename to rbi/openai/models/completion_choice.rbi diff --git a/rbi/lib/openai/models/completion_create_params.rbi b/rbi/openai/models/completion_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/completion_create_params.rbi rename to rbi/openai/models/completion_create_params.rbi diff --git a/rbi/lib/openai/models/completion_usage.rbi b/rbi/openai/models/completion_usage.rbi similarity index 100% rename from rbi/lib/openai/models/completion_usage.rbi rename to rbi/openai/models/completion_usage.rbi diff --git a/rbi/lib/openai/models/compound_filter.rbi b/rbi/openai/models/compound_filter.rbi similarity index 100% rename from rbi/lib/openai/models/compound_filter.rbi rename to rbi/openai/models/compound_filter.rbi diff --git a/rbi/lib/openai/models/create_embedding_response.rbi b/rbi/openai/models/create_embedding_response.rbi similarity index 100% rename from rbi/lib/openai/models/create_embedding_response.rbi rename to rbi/openai/models/create_embedding_response.rbi diff --git a/rbi/lib/openai/models/embedding.rbi b/rbi/openai/models/embedding.rbi similarity index 100% rename from rbi/lib/openai/models/embedding.rbi rename to rbi/openai/models/embedding.rbi diff --git a/rbi/lib/openai/models/embedding_create_params.rbi b/rbi/openai/models/embedding_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/embedding_create_params.rbi rename to rbi/openai/models/embedding_create_params.rbi diff --git a/rbi/lib/openai/models/embedding_model.rbi b/rbi/openai/models/embedding_model.rbi similarity index 100% rename from rbi/lib/openai/models/embedding_model.rbi rename to rbi/openai/models/embedding_model.rbi diff --git a/rbi/lib/openai/models/error_object.rbi b/rbi/openai/models/error_object.rbi similarity index 100% rename from rbi/lib/openai/models/error_object.rbi rename to rbi/openai/models/error_object.rbi diff --git a/rbi/lib/openai/models/eval_create_params.rbi b/rbi/openai/models/eval_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/eval_create_params.rbi rename to rbi/openai/models/eval_create_params.rbi diff --git a/rbi/lib/openai/models/eval_create_response.rbi b/rbi/openai/models/eval_create_response.rbi similarity index 100% rename from rbi/lib/openai/models/eval_create_response.rbi rename to rbi/openai/models/eval_create_response.rbi diff --git a/rbi/lib/openai/models/eval_custom_data_source_config.rbi b/rbi/openai/models/eval_custom_data_source_config.rbi similarity index 100% rename from rbi/lib/openai/models/eval_custom_data_source_config.rbi rename to rbi/openai/models/eval_custom_data_source_config.rbi diff --git a/rbi/lib/openai/models/eval_delete_params.rbi b/rbi/openai/models/eval_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/eval_delete_params.rbi rename to rbi/openai/models/eval_delete_params.rbi diff --git a/rbi/lib/openai/models/eval_delete_response.rbi b/rbi/openai/models/eval_delete_response.rbi similarity index 100% rename from rbi/lib/openai/models/eval_delete_response.rbi rename to rbi/openai/models/eval_delete_response.rbi diff --git a/rbi/lib/openai/models/eval_label_model_grader.rbi b/rbi/openai/models/eval_label_model_grader.rbi similarity index 100% rename from rbi/lib/openai/models/eval_label_model_grader.rbi rename to rbi/openai/models/eval_label_model_grader.rbi diff --git a/rbi/lib/openai/models/eval_list_params.rbi b/rbi/openai/models/eval_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/eval_list_params.rbi rename to rbi/openai/models/eval_list_params.rbi diff --git a/rbi/lib/openai/models/eval_list_response.rbi b/rbi/openai/models/eval_list_response.rbi similarity index 100% rename from rbi/lib/openai/models/eval_list_response.rbi rename to rbi/openai/models/eval_list_response.rbi diff --git a/rbi/lib/openai/models/eval_retrieve_params.rbi b/rbi/openai/models/eval_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/eval_retrieve_params.rbi rename to rbi/openai/models/eval_retrieve_params.rbi diff --git a/rbi/lib/openai/models/eval_retrieve_response.rbi b/rbi/openai/models/eval_retrieve_response.rbi similarity index 100% rename from rbi/lib/openai/models/eval_retrieve_response.rbi rename to rbi/openai/models/eval_retrieve_response.rbi diff --git a/rbi/lib/openai/models/eval_stored_completions_data_source_config.rbi b/rbi/openai/models/eval_stored_completions_data_source_config.rbi similarity index 100% rename from rbi/lib/openai/models/eval_stored_completions_data_source_config.rbi rename to rbi/openai/models/eval_stored_completions_data_source_config.rbi diff --git a/rbi/lib/openai/models/eval_string_check_grader.rbi b/rbi/openai/models/eval_string_check_grader.rbi similarity index 100% rename from rbi/lib/openai/models/eval_string_check_grader.rbi rename to rbi/openai/models/eval_string_check_grader.rbi diff --git a/rbi/lib/openai/models/eval_text_similarity_grader.rbi b/rbi/openai/models/eval_text_similarity_grader.rbi similarity index 100% rename from rbi/lib/openai/models/eval_text_similarity_grader.rbi rename to rbi/openai/models/eval_text_similarity_grader.rbi diff --git a/rbi/lib/openai/models/eval_update_params.rbi b/rbi/openai/models/eval_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/eval_update_params.rbi rename to rbi/openai/models/eval_update_params.rbi diff --git a/rbi/lib/openai/models/eval_update_response.rbi b/rbi/openai/models/eval_update_response.rbi similarity index 100% rename from rbi/lib/openai/models/eval_update_response.rbi rename to rbi/openai/models/eval_update_response.rbi diff --git a/rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi b/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi similarity index 100% rename from rbi/lib/openai/models/evals/create_eval_completions_run_data_source.rbi rename to rbi/openai/models/evals/create_eval_completions_run_data_source.rbi diff --git a/rbi/lib/openai/models/evals/create_eval_jsonl_run_data_source.rbi b/rbi/openai/models/evals/create_eval_jsonl_run_data_source.rbi similarity index 100% rename from rbi/lib/openai/models/evals/create_eval_jsonl_run_data_source.rbi rename to rbi/openai/models/evals/create_eval_jsonl_run_data_source.rbi diff --git a/rbi/lib/openai/models/evals/eval_api_error.rbi b/rbi/openai/models/evals/eval_api_error.rbi similarity index 100% rename from rbi/lib/openai/models/evals/eval_api_error.rbi rename to rbi/openai/models/evals/eval_api_error.rbi diff --git a/rbi/lib/openai/models/evals/run_cancel_params.rbi b/rbi/openai/models/evals/run_cancel_params.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_cancel_params.rbi rename to rbi/openai/models/evals/run_cancel_params.rbi diff --git a/rbi/lib/openai/models/evals/run_cancel_response.rbi b/rbi/openai/models/evals/run_cancel_response.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_cancel_response.rbi rename to rbi/openai/models/evals/run_cancel_response.rbi diff --git a/rbi/lib/openai/models/evals/run_create_params.rbi b/rbi/openai/models/evals/run_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_create_params.rbi rename to rbi/openai/models/evals/run_create_params.rbi diff --git a/rbi/lib/openai/models/evals/run_create_response.rbi b/rbi/openai/models/evals/run_create_response.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_create_response.rbi rename to rbi/openai/models/evals/run_create_response.rbi diff --git a/rbi/lib/openai/models/evals/run_delete_params.rbi b/rbi/openai/models/evals/run_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_delete_params.rbi rename to rbi/openai/models/evals/run_delete_params.rbi diff --git a/rbi/lib/openai/models/evals/run_delete_response.rbi b/rbi/openai/models/evals/run_delete_response.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_delete_response.rbi rename to rbi/openai/models/evals/run_delete_response.rbi diff --git a/rbi/lib/openai/models/evals/run_list_params.rbi b/rbi/openai/models/evals/run_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_list_params.rbi rename to rbi/openai/models/evals/run_list_params.rbi diff --git a/rbi/lib/openai/models/evals/run_list_response.rbi b/rbi/openai/models/evals/run_list_response.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_list_response.rbi rename to rbi/openai/models/evals/run_list_response.rbi diff --git a/rbi/lib/openai/models/evals/run_retrieve_params.rbi b/rbi/openai/models/evals/run_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_retrieve_params.rbi rename to rbi/openai/models/evals/run_retrieve_params.rbi diff --git a/rbi/lib/openai/models/evals/run_retrieve_response.rbi b/rbi/openai/models/evals/run_retrieve_response.rbi similarity index 100% rename from rbi/lib/openai/models/evals/run_retrieve_response.rbi rename to rbi/openai/models/evals/run_retrieve_response.rbi diff --git a/rbi/lib/openai/models/evals/runs/output_item_list_params.rbi b/rbi/openai/models/evals/runs/output_item_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/evals/runs/output_item_list_params.rbi rename to rbi/openai/models/evals/runs/output_item_list_params.rbi diff --git a/rbi/lib/openai/models/evals/runs/output_item_list_response.rbi b/rbi/openai/models/evals/runs/output_item_list_response.rbi similarity index 100% rename from rbi/lib/openai/models/evals/runs/output_item_list_response.rbi rename to rbi/openai/models/evals/runs/output_item_list_response.rbi diff --git a/rbi/lib/openai/models/evals/runs/output_item_retrieve_params.rbi b/rbi/openai/models/evals/runs/output_item_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/evals/runs/output_item_retrieve_params.rbi rename to rbi/openai/models/evals/runs/output_item_retrieve_params.rbi diff --git a/rbi/lib/openai/models/evals/runs/output_item_retrieve_response.rbi b/rbi/openai/models/evals/runs/output_item_retrieve_response.rbi similarity index 100% rename from rbi/lib/openai/models/evals/runs/output_item_retrieve_response.rbi rename to rbi/openai/models/evals/runs/output_item_retrieve_response.rbi diff --git a/rbi/lib/openai/models/file_chunking_strategy.rbi b/rbi/openai/models/file_chunking_strategy.rbi similarity index 100% rename from rbi/lib/openai/models/file_chunking_strategy.rbi rename to rbi/openai/models/file_chunking_strategy.rbi diff --git a/rbi/lib/openai/models/file_chunking_strategy_param.rbi b/rbi/openai/models/file_chunking_strategy_param.rbi similarity index 100% rename from rbi/lib/openai/models/file_chunking_strategy_param.rbi rename to rbi/openai/models/file_chunking_strategy_param.rbi diff --git a/rbi/lib/openai/models/file_content_params.rbi b/rbi/openai/models/file_content_params.rbi similarity index 100% rename from rbi/lib/openai/models/file_content_params.rbi rename to rbi/openai/models/file_content_params.rbi diff --git a/rbi/lib/openai/models/file_create_params.rbi b/rbi/openai/models/file_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/file_create_params.rbi rename to rbi/openai/models/file_create_params.rbi diff --git a/rbi/lib/openai/models/file_delete_params.rbi b/rbi/openai/models/file_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/file_delete_params.rbi rename to rbi/openai/models/file_delete_params.rbi diff --git a/rbi/lib/openai/models/file_deleted.rbi b/rbi/openai/models/file_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/file_deleted.rbi rename to rbi/openai/models/file_deleted.rbi diff --git a/rbi/lib/openai/models/file_list_params.rbi b/rbi/openai/models/file_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/file_list_params.rbi rename to rbi/openai/models/file_list_params.rbi diff --git a/rbi/lib/openai/models/file_object.rbi b/rbi/openai/models/file_object.rbi similarity index 100% rename from rbi/lib/openai/models/file_object.rbi rename to rbi/openai/models/file_object.rbi diff --git a/rbi/lib/openai/models/file_purpose.rbi b/rbi/openai/models/file_purpose.rbi similarity index 100% rename from rbi/lib/openai/models/file_purpose.rbi rename to rbi/openai/models/file_purpose.rbi diff --git a/rbi/lib/openai/models/file_retrieve_params.rbi b/rbi/openai/models/file_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/file_retrieve_params.rbi rename to rbi/openai/models/file_retrieve_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rbi b/rbi/openai/models/fine_tuning/checkpoints/permission_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_params.rbi rename to rbi/openai/models/fine_tuning/checkpoints/permission_create_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rbi b/rbi/openai/models/fine_tuning/checkpoints/permission_create_response.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/checkpoints/permission_create_response.rbi rename to rbi/openai/models/fine_tuning/checkpoints/permission_create_response.rbi diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi b/rbi/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi rename to rbi/openai/models/fine_tuning/checkpoints/permission_delete_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi b/rbi/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi rename to rbi/openai/models/fine_tuning/checkpoints/permission_delete_response.rbi diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi b/rbi/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi rename to rbi/openai/models/fine_tuning/checkpoints/permission_retrieve_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi b/rbi/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi rename to rbi/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi rename to rbi/openai/models/fine_tuning/fine_tuning_job.rbi diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_event.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi rename to rbi/openai/models/fine_tuning/fine_tuning_job_event.rbi diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_integration.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_integration.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/fine_tuning_job_integration.rbi rename to rbi/openai/models/fine_tuning/fine_tuning_job_integration.rbi diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi rename to rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi rename to rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi diff --git a/rbi/lib/openai/models/fine_tuning/job_cancel_params.rbi b/rbi/openai/models/fine_tuning/job_cancel_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/job_cancel_params.rbi rename to rbi/openai/models/fine_tuning/job_cancel_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/job_create_params.rbi b/rbi/openai/models/fine_tuning/job_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/job_create_params.rbi rename to rbi/openai/models/fine_tuning/job_create_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi b/rbi/openai/models/fine_tuning/job_list_events_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi rename to rbi/openai/models/fine_tuning/job_list_events_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/job_list_params.rbi b/rbi/openai/models/fine_tuning/job_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/job_list_params.rbi rename to rbi/openai/models/fine_tuning/job_list_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/job_retrieve_params.rbi b/rbi/openai/models/fine_tuning/job_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/job_retrieve_params.rbi rename to rbi/openai/models/fine_tuning/job_retrieve_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi b/rbi/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi rename to rbi/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi diff --git a/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi b/rbi/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi similarity index 100% rename from rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi rename to rbi/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi diff --git a/rbi/lib/openai/models/function_definition.rbi b/rbi/openai/models/function_definition.rbi similarity index 100% rename from rbi/lib/openai/models/function_definition.rbi rename to rbi/openai/models/function_definition.rbi diff --git a/rbi/lib/openai/models/function_parameters.rbi b/rbi/openai/models/function_parameters.rbi similarity index 100% rename from rbi/lib/openai/models/function_parameters.rbi rename to rbi/openai/models/function_parameters.rbi diff --git a/rbi/lib/openai/models/image.rbi b/rbi/openai/models/image.rbi similarity index 100% rename from rbi/lib/openai/models/image.rbi rename to rbi/openai/models/image.rbi diff --git a/rbi/lib/openai/models/image_create_variation_params.rbi b/rbi/openai/models/image_create_variation_params.rbi similarity index 100% rename from rbi/lib/openai/models/image_create_variation_params.rbi rename to rbi/openai/models/image_create_variation_params.rbi diff --git a/rbi/lib/openai/models/image_edit_params.rbi b/rbi/openai/models/image_edit_params.rbi similarity index 100% rename from rbi/lib/openai/models/image_edit_params.rbi rename to rbi/openai/models/image_edit_params.rbi diff --git a/rbi/lib/openai/models/image_generate_params.rbi b/rbi/openai/models/image_generate_params.rbi similarity index 100% rename from rbi/lib/openai/models/image_generate_params.rbi rename to rbi/openai/models/image_generate_params.rbi diff --git a/rbi/lib/openai/models/image_model.rbi b/rbi/openai/models/image_model.rbi similarity index 100% rename from rbi/lib/openai/models/image_model.rbi rename to rbi/openai/models/image_model.rbi diff --git a/rbi/lib/openai/models/images_response.rbi b/rbi/openai/models/images_response.rbi similarity index 100% rename from rbi/lib/openai/models/images_response.rbi rename to rbi/openai/models/images_response.rbi diff --git a/rbi/lib/openai/models/metadata.rbi b/rbi/openai/models/metadata.rbi similarity index 100% rename from rbi/lib/openai/models/metadata.rbi rename to rbi/openai/models/metadata.rbi diff --git a/rbi/lib/openai/models/model.rbi b/rbi/openai/models/model.rbi similarity index 100% rename from rbi/lib/openai/models/model.rbi rename to rbi/openai/models/model.rbi diff --git a/rbi/lib/openai/models/model_delete_params.rbi b/rbi/openai/models/model_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/model_delete_params.rbi rename to rbi/openai/models/model_delete_params.rbi diff --git a/rbi/lib/openai/models/model_deleted.rbi b/rbi/openai/models/model_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/model_deleted.rbi rename to rbi/openai/models/model_deleted.rbi diff --git a/rbi/lib/openai/models/model_list_params.rbi b/rbi/openai/models/model_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/model_list_params.rbi rename to rbi/openai/models/model_list_params.rbi diff --git a/rbi/lib/openai/models/model_retrieve_params.rbi b/rbi/openai/models/model_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/model_retrieve_params.rbi rename to rbi/openai/models/model_retrieve_params.rbi diff --git a/rbi/lib/openai/models/moderation.rbi b/rbi/openai/models/moderation.rbi similarity index 100% rename from rbi/lib/openai/models/moderation.rbi rename to rbi/openai/models/moderation.rbi diff --git a/rbi/lib/openai/models/moderation_create_params.rbi b/rbi/openai/models/moderation_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/moderation_create_params.rbi rename to rbi/openai/models/moderation_create_params.rbi diff --git a/rbi/lib/openai/models/moderation_create_response.rbi b/rbi/openai/models/moderation_create_response.rbi similarity index 100% rename from rbi/lib/openai/models/moderation_create_response.rbi rename to rbi/openai/models/moderation_create_response.rbi diff --git a/rbi/lib/openai/models/moderation_image_url_input.rbi b/rbi/openai/models/moderation_image_url_input.rbi similarity index 100% rename from rbi/lib/openai/models/moderation_image_url_input.rbi rename to rbi/openai/models/moderation_image_url_input.rbi diff --git a/rbi/lib/openai/models/moderation_model.rbi b/rbi/openai/models/moderation_model.rbi similarity index 100% rename from rbi/lib/openai/models/moderation_model.rbi rename to rbi/openai/models/moderation_model.rbi diff --git a/rbi/lib/openai/models/moderation_multi_modal_input.rbi b/rbi/openai/models/moderation_multi_modal_input.rbi similarity index 100% rename from rbi/lib/openai/models/moderation_multi_modal_input.rbi rename to rbi/openai/models/moderation_multi_modal_input.rbi diff --git a/rbi/lib/openai/models/moderation_text_input.rbi b/rbi/openai/models/moderation_text_input.rbi similarity index 100% rename from rbi/lib/openai/models/moderation_text_input.rbi rename to rbi/openai/models/moderation_text_input.rbi diff --git a/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi b/rbi/openai/models/other_file_chunking_strategy_object.rbi similarity index 100% rename from rbi/lib/openai/models/other_file_chunking_strategy_object.rbi rename to rbi/openai/models/other_file_chunking_strategy_object.rbi diff --git a/rbi/lib/openai/models/reasoning.rbi b/rbi/openai/models/reasoning.rbi similarity index 100% rename from rbi/lib/openai/models/reasoning.rbi rename to rbi/openai/models/reasoning.rbi diff --git a/rbi/lib/openai/models/reasoning_effort.rbi b/rbi/openai/models/reasoning_effort.rbi similarity index 100% rename from rbi/lib/openai/models/reasoning_effort.rbi rename to rbi/openai/models/reasoning_effort.rbi diff --git a/rbi/lib/openai/models/response_format_json_object.rbi b/rbi/openai/models/response_format_json_object.rbi similarity index 100% rename from rbi/lib/openai/models/response_format_json_object.rbi rename to rbi/openai/models/response_format_json_object.rbi diff --git a/rbi/lib/openai/models/response_format_json_schema.rbi b/rbi/openai/models/response_format_json_schema.rbi similarity index 100% rename from rbi/lib/openai/models/response_format_json_schema.rbi rename to rbi/openai/models/response_format_json_schema.rbi diff --git a/rbi/lib/openai/models/response_format_text.rbi b/rbi/openai/models/response_format_text.rbi similarity index 100% rename from rbi/lib/openai/models/response_format_text.rbi rename to rbi/openai/models/response_format_text.rbi diff --git a/rbi/lib/openai/models/responses/computer_tool.rbi b/rbi/openai/models/responses/computer_tool.rbi similarity index 100% rename from rbi/lib/openai/models/responses/computer_tool.rbi rename to rbi/openai/models/responses/computer_tool.rbi diff --git a/rbi/lib/openai/models/responses/easy_input_message.rbi b/rbi/openai/models/responses/easy_input_message.rbi similarity index 100% rename from rbi/lib/openai/models/responses/easy_input_message.rbi rename to rbi/openai/models/responses/easy_input_message.rbi diff --git a/rbi/lib/openai/models/responses/file_search_tool.rbi b/rbi/openai/models/responses/file_search_tool.rbi similarity index 100% rename from rbi/lib/openai/models/responses/file_search_tool.rbi rename to rbi/openai/models/responses/file_search_tool.rbi diff --git a/rbi/lib/openai/models/responses/function_tool.rbi b/rbi/openai/models/responses/function_tool.rbi similarity index 100% rename from rbi/lib/openai/models/responses/function_tool.rbi rename to rbi/openai/models/responses/function_tool.rbi diff --git a/rbi/lib/openai/models/responses/input_item_list_params.rbi b/rbi/openai/models/responses/input_item_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/responses/input_item_list_params.rbi rename to rbi/openai/models/responses/input_item_list_params.rbi diff --git a/rbi/lib/openai/models/responses/response.rbi b/rbi/openai/models/responses/response.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response.rbi rename to rbi/openai/models/responses/response.rbi diff --git a/rbi/lib/openai/models/responses/response_audio_delta_event.rbi b/rbi/openai/models/responses/response_audio_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_audio_delta_event.rbi rename to rbi/openai/models/responses/response_audio_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_audio_done_event.rbi b/rbi/openai/models/responses/response_audio_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_audio_done_event.rbi rename to rbi/openai/models/responses/response_audio_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi b/rbi/openai/models/responses/response_audio_transcript_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi rename to rbi/openai/models/responses/response_audio_transcript_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi b/rbi/openai/models/responses/response_audio_transcript_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi rename to rbi/openai/models/responses/response_audio_transcript_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi b/rbi/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi rename to rbi/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi b/rbi/openai/models/responses/response_code_interpreter_call_code_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi rename to rbi/openai/models/responses/response_code_interpreter_call_code_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi b/rbi/openai/models/responses/response_code_interpreter_call_completed_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi rename to rbi/openai/models/responses/response_code_interpreter_call_completed_event.rbi diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi b/rbi/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi rename to rbi/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi b/rbi/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi rename to rbi/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi b/rbi/openai/models/responses/response_code_interpreter_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi rename to rbi/openai/models/responses/response_code_interpreter_tool_call.rbi diff --git a/rbi/lib/openai/models/responses/response_completed_event.rbi b/rbi/openai/models/responses/response_completed_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_completed_event.rbi rename to rbi/openai/models/responses/response_completed_event.rbi diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call.rbi b/rbi/openai/models/responses/response_computer_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_computer_tool_call.rbi rename to rbi/openai/models/responses/response_computer_tool_call.rbi diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi b/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi rename to rbi/openai/models/responses/response_computer_tool_call_output_item.rbi diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi b/rbi/openai/models/responses/response_computer_tool_call_output_screenshot.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi rename to rbi/openai/models/responses/response_computer_tool_call_output_screenshot.rbi diff --git a/rbi/lib/openai/models/responses/response_content.rbi b/rbi/openai/models/responses/response_content.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_content.rbi rename to rbi/openai/models/responses/response_content.rbi diff --git a/rbi/lib/openai/models/responses/response_content_part_added_event.rbi b/rbi/openai/models/responses/response_content_part_added_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_content_part_added_event.rbi rename to rbi/openai/models/responses/response_content_part_added_event.rbi diff --git a/rbi/lib/openai/models/responses/response_content_part_done_event.rbi b/rbi/openai/models/responses/response_content_part_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_content_part_done_event.rbi rename to rbi/openai/models/responses/response_content_part_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_create_params.rbi b/rbi/openai/models/responses/response_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_create_params.rbi rename to rbi/openai/models/responses/response_create_params.rbi diff --git a/rbi/lib/openai/models/responses/response_created_event.rbi b/rbi/openai/models/responses/response_created_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_created_event.rbi rename to rbi/openai/models/responses/response_created_event.rbi diff --git a/rbi/lib/openai/models/responses/response_delete_params.rbi b/rbi/openai/models/responses/response_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_delete_params.rbi rename to rbi/openai/models/responses/response_delete_params.rbi diff --git a/rbi/lib/openai/models/responses/response_error.rbi b/rbi/openai/models/responses/response_error.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_error.rbi rename to rbi/openai/models/responses/response_error.rbi diff --git a/rbi/lib/openai/models/responses/response_error_event.rbi b/rbi/openai/models/responses/response_error_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_error_event.rbi rename to rbi/openai/models/responses/response_error_event.rbi diff --git a/rbi/lib/openai/models/responses/response_failed_event.rbi b/rbi/openai/models/responses/response_failed_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_failed_event.rbi rename to rbi/openai/models/responses/response_failed_event.rbi diff --git a/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi b/rbi/openai/models/responses/response_file_search_call_completed_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi rename to rbi/openai/models/responses/response_file_search_call_completed_event.rbi diff --git a/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi b/rbi/openai/models/responses/response_file_search_call_in_progress_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi rename to rbi/openai/models/responses/response_file_search_call_in_progress_event.rbi diff --git a/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi b/rbi/openai/models/responses/response_file_search_call_searching_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi rename to rbi/openai/models/responses/response_file_search_call_searching_event.rbi diff --git a/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi b/rbi/openai/models/responses/response_file_search_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_file_search_tool_call.rbi rename to rbi/openai/models/responses/response_file_search_tool_call.rbi diff --git a/rbi/lib/openai/models/responses/response_format_text_config.rbi b/rbi/openai/models/responses/response_format_text_config.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_format_text_config.rbi rename to rbi/openai/models/responses/response_format_text_config.rbi diff --git a/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi b/rbi/openai/models/responses/response_format_text_json_schema_config.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi rename to rbi/openai/models/responses/response_format_text_json_schema_config.rbi diff --git a/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi b/rbi/openai/models/responses/response_function_call_arguments_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi rename to rbi/openai/models/responses/response_function_call_arguments_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi b/rbi/openai/models/responses/response_function_call_arguments_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi rename to rbi/openai/models/responses/response_function_call_arguments_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_function_tool_call.rbi b/rbi/openai/models/responses/response_function_tool_call.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_function_tool_call.rbi rename to rbi/openai/models/responses/response_function_tool_call.rbi diff --git a/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi b/rbi/openai/models/responses/response_function_tool_call_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_function_tool_call_item.rbi rename to rbi/openai/models/responses/response_function_tool_call_item.rbi diff --git a/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi b/rbi/openai/models/responses/response_function_tool_call_output_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi rename to rbi/openai/models/responses/response_function_tool_call_output_item.rbi diff --git a/rbi/lib/openai/models/responses/response_function_web_search.rbi b/rbi/openai/models/responses/response_function_web_search.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_function_web_search.rbi rename to rbi/openai/models/responses/response_function_web_search.rbi diff --git a/rbi/lib/openai/models/responses/response_in_progress_event.rbi b/rbi/openai/models/responses/response_in_progress_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_in_progress_event.rbi rename to rbi/openai/models/responses/response_in_progress_event.rbi diff --git a/rbi/lib/openai/models/responses/response_includable.rbi b/rbi/openai/models/responses/response_includable.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_includable.rbi rename to rbi/openai/models/responses/response_includable.rbi diff --git a/rbi/lib/openai/models/responses/response_incomplete_event.rbi b/rbi/openai/models/responses/response_incomplete_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_incomplete_event.rbi rename to rbi/openai/models/responses/response_incomplete_event.rbi diff --git a/rbi/lib/openai/models/responses/response_input.rbi b/rbi/openai/models/responses/response_input.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input.rbi rename to rbi/openai/models/responses/response_input.rbi diff --git a/rbi/lib/openai/models/responses/response_input_audio.rbi b/rbi/openai/models/responses/response_input_audio.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_audio.rbi rename to rbi/openai/models/responses/response_input_audio.rbi diff --git a/rbi/lib/openai/models/responses/response_input_content.rbi b/rbi/openai/models/responses/response_input_content.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_content.rbi rename to rbi/openai/models/responses/response_input_content.rbi diff --git a/rbi/lib/openai/models/responses/response_input_file.rbi b/rbi/openai/models/responses/response_input_file.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_file.rbi rename to rbi/openai/models/responses/response_input_file.rbi diff --git a/rbi/lib/openai/models/responses/response_input_image.rbi b/rbi/openai/models/responses/response_input_image.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_image.rbi rename to rbi/openai/models/responses/response_input_image.rbi diff --git a/rbi/lib/openai/models/responses/response_input_item.rbi b/rbi/openai/models/responses/response_input_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_item.rbi rename to rbi/openai/models/responses/response_input_item.rbi diff --git a/rbi/lib/openai/models/responses/response_input_message_content_list.rbi b/rbi/openai/models/responses/response_input_message_content_list.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_message_content_list.rbi rename to rbi/openai/models/responses/response_input_message_content_list.rbi diff --git a/rbi/lib/openai/models/responses/response_input_message_item.rbi b/rbi/openai/models/responses/response_input_message_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_message_item.rbi rename to rbi/openai/models/responses/response_input_message_item.rbi diff --git a/rbi/lib/openai/models/responses/response_input_text.rbi b/rbi/openai/models/responses/response_input_text.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_input_text.rbi rename to rbi/openai/models/responses/response_input_text.rbi diff --git a/rbi/lib/openai/models/responses/response_item.rbi b/rbi/openai/models/responses/response_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_item.rbi rename to rbi/openai/models/responses/response_item.rbi diff --git a/rbi/lib/openai/models/responses/response_item_list.rbi b/rbi/openai/models/responses/response_item_list.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_item_list.rbi rename to rbi/openai/models/responses/response_item_list.rbi diff --git a/rbi/lib/openai/models/responses/response_output_audio.rbi b/rbi/openai/models/responses/response_output_audio.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_output_audio.rbi rename to rbi/openai/models/responses/response_output_audio.rbi diff --git a/rbi/lib/openai/models/responses/response_output_item.rbi b/rbi/openai/models/responses/response_output_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_output_item.rbi rename to rbi/openai/models/responses/response_output_item.rbi diff --git a/rbi/lib/openai/models/responses/response_output_item_added_event.rbi b/rbi/openai/models/responses/response_output_item_added_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_output_item_added_event.rbi rename to rbi/openai/models/responses/response_output_item_added_event.rbi diff --git a/rbi/lib/openai/models/responses/response_output_item_done_event.rbi b/rbi/openai/models/responses/response_output_item_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_output_item_done_event.rbi rename to rbi/openai/models/responses/response_output_item_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_output_message.rbi b/rbi/openai/models/responses/response_output_message.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_output_message.rbi rename to rbi/openai/models/responses/response_output_message.rbi diff --git a/rbi/lib/openai/models/responses/response_output_refusal.rbi b/rbi/openai/models/responses/response_output_refusal.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_output_refusal.rbi rename to rbi/openai/models/responses/response_output_refusal.rbi diff --git a/rbi/lib/openai/models/responses/response_output_text.rbi b/rbi/openai/models/responses/response_output_text.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_output_text.rbi rename to rbi/openai/models/responses/response_output_text.rbi diff --git a/rbi/lib/openai/models/responses/response_reasoning_item.rbi b/rbi/openai/models/responses/response_reasoning_item.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_reasoning_item.rbi rename to rbi/openai/models/responses/response_reasoning_item.rbi diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi b/rbi/openai/models/responses/response_reasoning_summary_part_added_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_reasoning_summary_part_added_event.rbi rename to rbi/openai/models/responses/response_reasoning_summary_part_added_event.rbi diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi b/rbi/openai/models/responses/response_reasoning_summary_part_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_reasoning_summary_part_done_event.rbi rename to rbi/openai/models/responses/response_reasoning_summary_part_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi b/rbi/openai/models/responses/response_reasoning_summary_text_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_reasoning_summary_text_delta_event.rbi rename to rbi/openai/models/responses/response_reasoning_summary_text_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi b/rbi/openai/models/responses/response_reasoning_summary_text_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_reasoning_summary_text_done_event.rbi rename to rbi/openai/models/responses/response_reasoning_summary_text_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi b/rbi/openai/models/responses/response_refusal_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_refusal_delta_event.rbi rename to rbi/openai/models/responses/response_refusal_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_refusal_done_event.rbi b/rbi/openai/models/responses/response_refusal_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_refusal_done_event.rbi rename to rbi/openai/models/responses/response_refusal_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_retrieve_params.rbi b/rbi/openai/models/responses/response_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_retrieve_params.rbi rename to rbi/openai/models/responses/response_retrieve_params.rbi diff --git a/rbi/lib/openai/models/responses/response_status.rbi b/rbi/openai/models/responses/response_status.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_status.rbi rename to rbi/openai/models/responses/response_status.rbi diff --git a/rbi/lib/openai/models/responses/response_stream_event.rbi b/rbi/openai/models/responses/response_stream_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_stream_event.rbi rename to rbi/openai/models/responses/response_stream_event.rbi diff --git a/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi b/rbi/openai/models/responses/response_text_annotation_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi rename to rbi/openai/models/responses/response_text_annotation_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_text_config.rbi b/rbi/openai/models/responses/response_text_config.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_text_config.rbi rename to rbi/openai/models/responses/response_text_config.rbi diff --git a/rbi/lib/openai/models/responses/response_text_delta_event.rbi b/rbi/openai/models/responses/response_text_delta_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_text_delta_event.rbi rename to rbi/openai/models/responses/response_text_delta_event.rbi diff --git a/rbi/lib/openai/models/responses/response_text_done_event.rbi b/rbi/openai/models/responses/response_text_done_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_text_done_event.rbi rename to rbi/openai/models/responses/response_text_done_event.rbi diff --git a/rbi/lib/openai/models/responses/response_usage.rbi b/rbi/openai/models/responses/response_usage.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_usage.rbi rename to rbi/openai/models/responses/response_usage.rbi diff --git a/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi b/rbi/openai/models/responses/response_web_search_call_completed_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi rename to rbi/openai/models/responses/response_web_search_call_completed_event.rbi diff --git a/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi b/rbi/openai/models/responses/response_web_search_call_in_progress_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi rename to rbi/openai/models/responses/response_web_search_call_in_progress_event.rbi diff --git a/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi b/rbi/openai/models/responses/response_web_search_call_searching_event.rbi similarity index 100% rename from rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi rename to rbi/openai/models/responses/response_web_search_call_searching_event.rbi diff --git a/rbi/lib/openai/models/responses/tool.rbi b/rbi/openai/models/responses/tool.rbi similarity index 100% rename from rbi/lib/openai/models/responses/tool.rbi rename to rbi/openai/models/responses/tool.rbi diff --git a/rbi/lib/openai/models/responses/tool_choice_function.rbi b/rbi/openai/models/responses/tool_choice_function.rbi similarity index 100% rename from rbi/lib/openai/models/responses/tool_choice_function.rbi rename to rbi/openai/models/responses/tool_choice_function.rbi diff --git a/rbi/lib/openai/models/responses/tool_choice_options.rbi b/rbi/openai/models/responses/tool_choice_options.rbi similarity index 100% rename from rbi/lib/openai/models/responses/tool_choice_options.rbi rename to rbi/openai/models/responses/tool_choice_options.rbi diff --git a/rbi/lib/openai/models/responses/tool_choice_types.rbi b/rbi/openai/models/responses/tool_choice_types.rbi similarity index 100% rename from rbi/lib/openai/models/responses/tool_choice_types.rbi rename to rbi/openai/models/responses/tool_choice_types.rbi diff --git a/rbi/lib/openai/models/responses/web_search_tool.rbi b/rbi/openai/models/responses/web_search_tool.rbi similarity index 100% rename from rbi/lib/openai/models/responses/web_search_tool.rbi rename to rbi/openai/models/responses/web_search_tool.rbi diff --git a/rbi/lib/openai/models/responses_model.rbi b/rbi/openai/models/responses_model.rbi similarity index 100% rename from rbi/lib/openai/models/responses_model.rbi rename to rbi/openai/models/responses_model.rbi diff --git a/rbi/lib/openai/models/static_file_chunking_strategy.rbi b/rbi/openai/models/static_file_chunking_strategy.rbi similarity index 100% rename from rbi/lib/openai/models/static_file_chunking_strategy.rbi rename to rbi/openai/models/static_file_chunking_strategy.rbi diff --git a/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi b/rbi/openai/models/static_file_chunking_strategy_object.rbi similarity index 100% rename from rbi/lib/openai/models/static_file_chunking_strategy_object.rbi rename to rbi/openai/models/static_file_chunking_strategy_object.rbi diff --git a/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi b/rbi/openai/models/static_file_chunking_strategy_object_param.rbi similarity index 100% rename from rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi rename to rbi/openai/models/static_file_chunking_strategy_object_param.rbi diff --git a/rbi/lib/openai/models/upload.rbi b/rbi/openai/models/upload.rbi similarity index 100% rename from rbi/lib/openai/models/upload.rbi rename to rbi/openai/models/upload.rbi diff --git a/rbi/lib/openai/models/upload_cancel_params.rbi b/rbi/openai/models/upload_cancel_params.rbi similarity index 100% rename from rbi/lib/openai/models/upload_cancel_params.rbi rename to rbi/openai/models/upload_cancel_params.rbi diff --git a/rbi/lib/openai/models/upload_complete_params.rbi b/rbi/openai/models/upload_complete_params.rbi similarity index 100% rename from rbi/lib/openai/models/upload_complete_params.rbi rename to rbi/openai/models/upload_complete_params.rbi diff --git a/rbi/lib/openai/models/upload_create_params.rbi b/rbi/openai/models/upload_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/upload_create_params.rbi rename to rbi/openai/models/upload_create_params.rbi diff --git a/rbi/lib/openai/models/uploads/part_create_params.rbi b/rbi/openai/models/uploads/part_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/uploads/part_create_params.rbi rename to rbi/openai/models/uploads/part_create_params.rbi diff --git a/rbi/lib/openai/models/uploads/upload_part.rbi b/rbi/openai/models/uploads/upload_part.rbi similarity index 100% rename from rbi/lib/openai/models/uploads/upload_part.rbi rename to rbi/openai/models/uploads/upload_part.rbi diff --git a/rbi/lib/openai/models/vector_store.rbi b/rbi/openai/models/vector_store.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store.rbi rename to rbi/openai/models/vector_store.rbi diff --git a/rbi/lib/openai/models/vector_store_create_params.rbi b/rbi/openai/models/vector_store_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_create_params.rbi rename to rbi/openai/models/vector_store_create_params.rbi diff --git a/rbi/lib/openai/models/vector_store_delete_params.rbi b/rbi/openai/models/vector_store_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_delete_params.rbi rename to rbi/openai/models/vector_store_delete_params.rbi diff --git a/rbi/lib/openai/models/vector_store_deleted.rbi b/rbi/openai/models/vector_store_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_deleted.rbi rename to rbi/openai/models/vector_store_deleted.rbi diff --git a/rbi/lib/openai/models/vector_store_list_params.rbi b/rbi/openai/models/vector_store_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_list_params.rbi rename to rbi/openai/models/vector_store_list_params.rbi diff --git a/rbi/lib/openai/models/vector_store_retrieve_params.rbi b/rbi/openai/models/vector_store_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_retrieve_params.rbi rename to rbi/openai/models/vector_store_retrieve_params.rbi diff --git a/rbi/lib/openai/models/vector_store_search_params.rbi b/rbi/openai/models/vector_store_search_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_search_params.rbi rename to rbi/openai/models/vector_store_search_params.rbi diff --git a/rbi/lib/openai/models/vector_store_search_response.rbi b/rbi/openai/models/vector_store_search_response.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_search_response.rbi rename to rbi/openai/models/vector_store_search_response.rbi diff --git a/rbi/lib/openai/models/vector_store_update_params.rbi b/rbi/openai/models/vector_store_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_store_update_params.rbi rename to rbi/openai/models/vector_store_update_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_batch_cancel_params.rbi b/rbi/openai/models/vector_stores/file_batch_cancel_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_batch_cancel_params.rbi rename to rbi/openai/models/vector_stores/file_batch_cancel_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi b/rbi/openai/models/vector_stores/file_batch_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi rename to rbi/openai/models/vector_stores/file_batch_create_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi b/rbi/openai/models/vector_stores/file_batch_list_files_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi rename to rbi/openai/models/vector_stores/file_batch_list_files_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_batch_retrieve_params.rbi b/rbi/openai/models/vector_stores/file_batch_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_batch_retrieve_params.rbi rename to rbi/openai/models/vector_stores/file_batch_retrieve_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_content_params.rbi b/rbi/openai/models/vector_stores/file_content_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_content_params.rbi rename to rbi/openai/models/vector_stores/file_content_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_content_response.rbi b/rbi/openai/models/vector_stores/file_content_response.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_content_response.rbi rename to rbi/openai/models/vector_stores/file_content_response.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_create_params.rbi b/rbi/openai/models/vector_stores/file_create_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_create_params.rbi rename to rbi/openai/models/vector_stores/file_create_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_delete_params.rbi b/rbi/openai/models/vector_stores/file_delete_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_delete_params.rbi rename to rbi/openai/models/vector_stores/file_delete_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_list_params.rbi b/rbi/openai/models/vector_stores/file_list_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_list_params.rbi rename to rbi/openai/models/vector_stores/file_list_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_retrieve_params.rbi b/rbi/openai/models/vector_stores/file_retrieve_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_retrieve_params.rbi rename to rbi/openai/models/vector_stores/file_retrieve_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/file_update_params.rbi b/rbi/openai/models/vector_stores/file_update_params.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/file_update_params.rbi rename to rbi/openai/models/vector_stores/file_update_params.rbi diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file.rbi b/rbi/openai/models/vector_stores/vector_store_file.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/vector_store_file.rbi rename to rbi/openai/models/vector_stores/vector_store_file.rbi diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi b/rbi/openai/models/vector_stores/vector_store_file_batch.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi rename to rbi/openai/models/vector_stores/vector_store_file_batch.rbi diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file_deleted.rbi b/rbi/openai/models/vector_stores/vector_store_file_deleted.rbi similarity index 100% rename from rbi/lib/openai/models/vector_stores/vector_store_file_deleted.rbi rename to rbi/openai/models/vector_stores/vector_store_file_deleted.rbi diff --git a/rbi/lib/openai/request_options.rbi b/rbi/openai/request_options.rbi similarity index 100% rename from rbi/lib/openai/request_options.rbi rename to rbi/openai/request_options.rbi diff --git a/rbi/lib/openai/resources/audio.rbi b/rbi/openai/resources/audio.rbi similarity index 100% rename from rbi/lib/openai/resources/audio.rbi rename to rbi/openai/resources/audio.rbi diff --git a/rbi/lib/openai/resources/audio/speech.rbi b/rbi/openai/resources/audio/speech.rbi similarity index 100% rename from rbi/lib/openai/resources/audio/speech.rbi rename to rbi/openai/resources/audio/speech.rbi diff --git a/rbi/lib/openai/resources/audio/transcriptions.rbi b/rbi/openai/resources/audio/transcriptions.rbi similarity index 100% rename from rbi/lib/openai/resources/audio/transcriptions.rbi rename to rbi/openai/resources/audio/transcriptions.rbi diff --git a/rbi/lib/openai/resources/audio/translations.rbi b/rbi/openai/resources/audio/translations.rbi similarity index 100% rename from rbi/lib/openai/resources/audio/translations.rbi rename to rbi/openai/resources/audio/translations.rbi diff --git a/rbi/lib/openai/resources/batches.rbi b/rbi/openai/resources/batches.rbi similarity index 100% rename from rbi/lib/openai/resources/batches.rbi rename to rbi/openai/resources/batches.rbi diff --git a/rbi/lib/openai/resources/beta.rbi b/rbi/openai/resources/beta.rbi similarity index 100% rename from rbi/lib/openai/resources/beta.rbi rename to rbi/openai/resources/beta.rbi diff --git a/rbi/lib/openai/resources/beta/assistants.rbi b/rbi/openai/resources/beta/assistants.rbi similarity index 100% rename from rbi/lib/openai/resources/beta/assistants.rbi rename to rbi/openai/resources/beta/assistants.rbi diff --git a/rbi/lib/openai/resources/beta/threads.rbi b/rbi/openai/resources/beta/threads.rbi similarity index 100% rename from rbi/lib/openai/resources/beta/threads.rbi rename to rbi/openai/resources/beta/threads.rbi diff --git a/rbi/lib/openai/resources/beta/threads/messages.rbi b/rbi/openai/resources/beta/threads/messages.rbi similarity index 100% rename from rbi/lib/openai/resources/beta/threads/messages.rbi rename to rbi/openai/resources/beta/threads/messages.rbi diff --git a/rbi/lib/openai/resources/beta/threads/runs.rbi b/rbi/openai/resources/beta/threads/runs.rbi similarity index 100% rename from rbi/lib/openai/resources/beta/threads/runs.rbi rename to rbi/openai/resources/beta/threads/runs.rbi diff --git a/rbi/lib/openai/resources/beta/threads/runs/steps.rbi b/rbi/openai/resources/beta/threads/runs/steps.rbi similarity index 100% rename from rbi/lib/openai/resources/beta/threads/runs/steps.rbi rename to rbi/openai/resources/beta/threads/runs/steps.rbi diff --git a/rbi/lib/openai/resources/chat.rbi b/rbi/openai/resources/chat.rbi similarity index 100% rename from rbi/lib/openai/resources/chat.rbi rename to rbi/openai/resources/chat.rbi diff --git a/rbi/lib/openai/resources/chat/completions.rbi b/rbi/openai/resources/chat/completions.rbi similarity index 100% rename from rbi/lib/openai/resources/chat/completions.rbi rename to rbi/openai/resources/chat/completions.rbi diff --git a/rbi/lib/openai/resources/chat/completions/messages.rbi b/rbi/openai/resources/chat/completions/messages.rbi similarity index 100% rename from rbi/lib/openai/resources/chat/completions/messages.rbi rename to rbi/openai/resources/chat/completions/messages.rbi diff --git a/rbi/lib/openai/resources/completions.rbi b/rbi/openai/resources/completions.rbi similarity index 100% rename from rbi/lib/openai/resources/completions.rbi rename to rbi/openai/resources/completions.rbi diff --git a/rbi/lib/openai/resources/embeddings.rbi b/rbi/openai/resources/embeddings.rbi similarity index 100% rename from rbi/lib/openai/resources/embeddings.rbi rename to rbi/openai/resources/embeddings.rbi diff --git a/rbi/lib/openai/resources/evals.rbi b/rbi/openai/resources/evals.rbi similarity index 100% rename from rbi/lib/openai/resources/evals.rbi rename to rbi/openai/resources/evals.rbi diff --git a/rbi/lib/openai/resources/evals/runs.rbi b/rbi/openai/resources/evals/runs.rbi similarity index 100% rename from rbi/lib/openai/resources/evals/runs.rbi rename to rbi/openai/resources/evals/runs.rbi diff --git a/rbi/lib/openai/resources/evals/runs/output_items.rbi b/rbi/openai/resources/evals/runs/output_items.rbi similarity index 100% rename from rbi/lib/openai/resources/evals/runs/output_items.rbi rename to rbi/openai/resources/evals/runs/output_items.rbi diff --git a/rbi/lib/openai/resources/files.rbi b/rbi/openai/resources/files.rbi similarity index 100% rename from rbi/lib/openai/resources/files.rbi rename to rbi/openai/resources/files.rbi diff --git a/rbi/lib/openai/resources/fine_tuning.rbi b/rbi/openai/resources/fine_tuning.rbi similarity index 100% rename from rbi/lib/openai/resources/fine_tuning.rbi rename to rbi/openai/resources/fine_tuning.rbi diff --git a/rbi/lib/openai/resources/fine_tuning/checkpoints.rbi b/rbi/openai/resources/fine_tuning/checkpoints.rbi similarity index 100% rename from rbi/lib/openai/resources/fine_tuning/checkpoints.rbi rename to rbi/openai/resources/fine_tuning/checkpoints.rbi diff --git a/rbi/lib/openai/resources/fine_tuning/checkpoints/permissions.rbi b/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi similarity index 100% rename from rbi/lib/openai/resources/fine_tuning/checkpoints/permissions.rbi rename to rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi diff --git a/rbi/lib/openai/resources/fine_tuning/jobs.rbi b/rbi/openai/resources/fine_tuning/jobs.rbi similarity index 100% rename from rbi/lib/openai/resources/fine_tuning/jobs.rbi rename to rbi/openai/resources/fine_tuning/jobs.rbi diff --git a/rbi/lib/openai/resources/fine_tuning/jobs/checkpoints.rbi b/rbi/openai/resources/fine_tuning/jobs/checkpoints.rbi similarity index 100% rename from rbi/lib/openai/resources/fine_tuning/jobs/checkpoints.rbi rename to rbi/openai/resources/fine_tuning/jobs/checkpoints.rbi diff --git a/rbi/lib/openai/resources/images.rbi b/rbi/openai/resources/images.rbi similarity index 100% rename from rbi/lib/openai/resources/images.rbi rename to rbi/openai/resources/images.rbi diff --git a/rbi/lib/openai/resources/models.rbi b/rbi/openai/resources/models.rbi similarity index 100% rename from rbi/lib/openai/resources/models.rbi rename to rbi/openai/resources/models.rbi diff --git a/rbi/lib/openai/resources/moderations.rbi b/rbi/openai/resources/moderations.rbi similarity index 100% rename from rbi/lib/openai/resources/moderations.rbi rename to rbi/openai/resources/moderations.rbi diff --git a/rbi/lib/openai/resources/responses.rbi b/rbi/openai/resources/responses.rbi similarity index 100% rename from rbi/lib/openai/resources/responses.rbi rename to rbi/openai/resources/responses.rbi diff --git a/rbi/lib/openai/resources/responses/input_items.rbi b/rbi/openai/resources/responses/input_items.rbi similarity index 100% rename from rbi/lib/openai/resources/responses/input_items.rbi rename to rbi/openai/resources/responses/input_items.rbi diff --git a/rbi/lib/openai/resources/uploads.rbi b/rbi/openai/resources/uploads.rbi similarity index 100% rename from rbi/lib/openai/resources/uploads.rbi rename to rbi/openai/resources/uploads.rbi diff --git a/rbi/lib/openai/resources/uploads/parts.rbi b/rbi/openai/resources/uploads/parts.rbi similarity index 100% rename from rbi/lib/openai/resources/uploads/parts.rbi rename to rbi/openai/resources/uploads/parts.rbi diff --git a/rbi/lib/openai/resources/vector_stores.rbi b/rbi/openai/resources/vector_stores.rbi similarity index 100% rename from rbi/lib/openai/resources/vector_stores.rbi rename to rbi/openai/resources/vector_stores.rbi diff --git a/rbi/lib/openai/resources/vector_stores/file_batches.rbi b/rbi/openai/resources/vector_stores/file_batches.rbi similarity index 100% rename from rbi/lib/openai/resources/vector_stores/file_batches.rbi rename to rbi/openai/resources/vector_stores/file_batches.rbi diff --git a/rbi/lib/openai/resources/vector_stores/files.rbi b/rbi/openai/resources/vector_stores/files.rbi similarity index 100% rename from rbi/lib/openai/resources/vector_stores/files.rbi rename to rbi/openai/resources/vector_stores/files.rbi diff --git a/rbi/lib/openai/version.rbi b/rbi/openai/version.rbi similarity index 100% rename from rbi/lib/openai/version.rbi rename to rbi/openai/version.rbi From 04b111dcdc2c5d458159be87a180174243a9d058 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Apr 2025 06:27:23 +0000 Subject: [PATCH 20/33] chore: more accurate type annotations and aliases --- lib/openai/errors.rb | 36 +++++++++---------- lib/openai/internal/type/boolean.rb | 21 ++++++----- lib/openai/internal/type/enum.rb | 21 ++++++----- lib/openai/internal/type/unknown.rb | 21 ++++++----- .../beta/thread_create_and_run_params.rb | 1 + .../models/beta/thread_create_params.rb | 1 + .../beta/threads/message_create_params.rb | 1 + .../models/beta/threads/run_create_params.rb | 1 + ...chat_completion_assistant_message_param.rb | 1 + ...chat_completion_developer_message_param.rb | 1 + .../chat_completion_prediction_content.rb | 1 + .../chat_completion_system_message_param.rb | 1 + .../chat_completion_tool_message_param.rb | 1 + .../chat_completion_user_message_param.rb | 1 + .../models/chat/completion_create_params.rb | 1 + lib/openai/models/completion_create_params.rb | 4 +++ lib/openai/models/embedding_create_params.rb | 3 ++ lib/openai/models/image_edit_params.rb | 1 + lib/openai/models/moderation_create_params.rb | 2 ++ .../models/vector_store_search_params.rb | 1 + lib/openai/request_options.rb | 9 +++-- .../beta/thread_create_and_run_params.rbs | 5 +-- .../models/beta/thread_create_params.rbs | 5 +-- .../beta/threads/message_create_params.rbs | 5 +-- .../models/beta/threads/run_create_params.rbs | 5 +-- ...hat_completion_assistant_message_param.rbs | 5 +-- ...hat_completion_developer_message_param.rbs | 5 +-- .../chat_completion_prediction_content.rbs | 5 +-- .../chat_completion_system_message_param.rbs | 5 +-- .../chat_completion_tool_message_param.rbs | 5 +-- .../chat_completion_user_message_param.rbs | 5 +-- .../models/chat/completion_create_params.rbs | 4 +-- .../models/completion_create_params.rbs | 16 +++------ sig/openai/models/embedding_create_params.rbs | 12 ++----- sig/openai/models/image_edit_params.rbs | 4 +-- .../models/moderation_create_params.rbs | 9 ++--- .../models/vector_store_search_params.rbs | 4 +-- test/openai/file_part_test.rb | 1 + 38 files changed, 97 insertions(+), 133 deletions(-) diff --git a/lib/openai/errors.rb b/lib/openai/errors.rb index 73e74f52..6f159c87 100644 --- a/lib/openai/errors.rb +++ b/lib/openai/errors.rb @@ -3,9 +3,9 @@ module OpenAI module Errors class Error < StandardError - # @!parse - # # @return [StandardError, nil] - # attr_accessor :cause + # @!attribute cause + # + # @return [StandardError, nil] end class ConversionError < OpenAI::Errors::Error @@ -49,25 +49,25 @@ def initialize(url:, status: nil, body: nil, request: nil, response: nil, messag end class APIConnectionError < OpenAI::Errors::APIError - # @!parse - # # @return [nil] - # attr_accessor :status + # @!attribute status + # + # @return [nil] - # @!parse - # # @return [nil] - # attr_accessor :body + # @!attribute body + # + # @return [nil] - # @!parse - # # @return [nil] - # attr_accessor :code + # @!attribute code + # + # @return [nil] - # @!parse - # # @return [nil] - # attr_accessor :param + # @!attribute param + # + # @return [nil] - # @!parse - # # @return [nil] - # attr_accessor :type + # @!attribute type + # + # @return [nil] # @api private # diff --git a/lib/openai/internal/type/boolean.rb b/lib/openai/internal/type/boolean.rb index 13c242e0..3e852539 100644 --- a/lib/openai/internal/type/boolean.rb +++ b/lib/openai/internal/type/boolean.rb @@ -46,17 +46,16 @@ def coerce(value, state:) value end - # @!parse - # # @api private - # # - # # @param value [Boolean, Object] - # # - # # @param state [Hash{Symbol=>Object}] . - # # - # # @option state [Boolean] :can_retry - # # - # # @return [Boolean, Object] - # def dump(value, state:) = super + # @!method dump(value, state:) + # @api private + # + # @param value [Boolean, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Boolean, Object] end end end diff --git a/lib/openai/internal/type/enum.rb b/lib/openai/internal/type/enum.rb index 55df3e66..5ceef679 100644 --- a/lib/openai/internal/type/enum.rb +++ b/lib/openai/internal/type/enum.rb @@ -100,17 +100,16 @@ def coerce(value, state:) end end - # @!parse - # # @api private - # # - # # @param value [Symbol, Object] - # # - # # @param state [Hash{Symbol=>Object}] . - # # - # # @option state [Boolean] :can_retry - # # - # # @return [Symbol, Object] - # def dump(value, state:) = super + # @!method dump(value, state:) + # @api private + # + # @param value [Symbol, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Symbol, Object] # @api private # diff --git a/lib/openai/internal/type/unknown.rb b/lib/openai/internal/type/unknown.rb index 698303d5..a629570f 100644 --- a/lib/openai/internal/type/unknown.rb +++ b/lib/openai/internal/type/unknown.rb @@ -48,17 +48,16 @@ def coerce(value, state:) value end - # @!parse - # # @api private - # # - # # @param value [Object] - # # - # # @param state [Hash{Symbol=>Object}] . - # # - # # @option state [Boolean] :can_retry - # # - # # @return [Object] - # def dump(value, state:) = super + # @!method dump(value, state:) + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Object] end # rubocop:enable Lint/UnusedMethodArgument diff --git a/lib/openai/models/beta/thread_create_and_run_params.rb b/lib/openai/models/beta/thread_create_and_run_params.rb index 0cd74409..4199cc52 100644 --- a/lib/openai/models/beta/thread_create_and_run_params.rb +++ b/lib/openai/models/beta/thread_create_and_run_params.rb @@ -337,6 +337,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] MessageContentPartParamArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Beta::Threads::MessageContentPartParam }] end diff --git a/lib/openai/models/beta/thread_create_params.rb b/lib/openai/models/beta/thread_create_params.rb index 3cb1d240..50ef5aca 100644 --- a/lib/openai/models/beta/thread_create_params.rb +++ b/lib/openai/models/beta/thread_create_params.rb @@ -114,6 +114,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] MessageContentPartParamArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Beta::Threads::MessageContentPartParam }] end diff --git a/lib/openai/models/beta/threads/message_create_params.rb b/lib/openai/models/beta/threads/message_create_params.rb index ff6d233f..e6a5e155 100644 --- a/lib/openai/models/beta/threads/message_create_params.rb +++ b/lib/openai/models/beta/threads/message_create_params.rb @@ -72,6 +72,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] MessageContentPartParamArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Beta::Threads::MessageContentPartParam }] end diff --git a/lib/openai/models/beta/threads/run_create_params.rb b/lib/openai/models/beta/threads/run_create_params.rb index d47e1177..8ced1f05 100644 --- a/lib/openai/models/beta/threads/run_create_params.rb +++ b/lib/openai/models/beta/threads/run_create_params.rb @@ -307,6 +307,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] MessageContentPartParamArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Beta::Threads::MessageContentPartParam }] end diff --git a/lib/openai/models/chat/chat_completion_assistant_message_param.rb b/lib/openai/models/chat/chat_completion_assistant_message_param.rb index f5bc27e0..ab8b934b 100644 --- a/lib/openai/models/chat/chat_completion_assistant_message_param.rb +++ b/lib/openai/models/chat/chat_completion_assistant_message_param.rb @@ -131,6 +131,7 @@ module ArrayOfContentPart # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] ArrayOfContentPartArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Content::ArrayOfContentPart }] end diff --git a/lib/openai/models/chat/chat_completion_developer_message_param.rb b/lib/openai/models/chat/chat_completion_developer_message_param.rb index df851c32..412741c9 100644 --- a/lib/openai/models/chat/chat_completion_developer_message_param.rb +++ b/lib/openai/models/chat/chat_completion_developer_message_param.rb @@ -53,6 +53,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] ChatCompletionContentPartTextArray = OpenAI::Internal::Type::ArrayOf[-> { OpenAI::Models::Chat::ChatCompletionContentPartText }] end diff --git a/lib/openai/models/chat/chat_completion_prediction_content.rb b/lib/openai/models/chat/chat_completion_prediction_content.rb index 3669e9d3..df3dbe30 100644 --- a/lib/openai/models/chat/chat_completion_prediction_content.rb +++ b/lib/openai/models/chat/chat_completion_prediction_content.rb @@ -48,6 +48,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] ChatCompletionContentPartTextArray = OpenAI::Internal::Type::ArrayOf[-> { OpenAI::Models::Chat::ChatCompletionContentPartText }] end diff --git a/lib/openai/models/chat/chat_completion_system_message_param.rb b/lib/openai/models/chat/chat_completion_system_message_param.rb index 99e35629..7ef7fbfd 100644 --- a/lib/openai/models/chat/chat_completion_system_message_param.rb +++ b/lib/openai/models/chat/chat_completion_system_message_param.rb @@ -53,6 +53,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] ChatCompletionContentPartTextArray = OpenAI::Internal::Type::ArrayOf[-> { OpenAI::Models::Chat::ChatCompletionContentPartText }] end diff --git a/lib/openai/models/chat/chat_completion_tool_message_param.rb b/lib/openai/models/chat/chat_completion_tool_message_param.rb index e03505be..2ff0bf3b 100644 --- a/lib/openai/models/chat/chat_completion_tool_message_param.rb +++ b/lib/openai/models/chat/chat_completion_tool_message_param.rb @@ -44,6 +44,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] ChatCompletionContentPartTextArray = OpenAI::Internal::Type::ArrayOf[-> { OpenAI::Models::Chat::ChatCompletionContentPartText }] end diff --git a/lib/openai/models/chat/chat_completion_user_message_param.rb b/lib/openai/models/chat/chat_completion_user_message_param.rb index 3aa9532f..b412e5c9 100644 --- a/lib/openai/models/chat/chat_completion_user_message_param.rb +++ b/lib/openai/models/chat/chat_completion_user_message_param.rb @@ -52,6 +52,7 @@ module Content # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] ChatCompletionContentPartArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Chat::ChatCompletionContentPart }] end diff --git a/lib/openai/models/chat/completion_create_params.rb b/lib/openai/models/chat/completion_create_params.rb index 185edac2..ed12261d 100644 --- a/lib/openai/models/chat/completion_create_params.rb +++ b/lib/openai/models/chat/completion_create_params.rb @@ -587,6 +587,7 @@ module Stop # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] StringArray = OpenAI::Internal::Type::ArrayOf[String] end diff --git a/lib/openai/models/completion_create_params.rb b/lib/openai/models/completion_create_params.rb index c6f47865..d397fba1 100644 --- a/lib/openai/models/completion_create_params.rb +++ b/lib/openai/models/completion_create_params.rb @@ -281,10 +281,13 @@ module Prompt # @!method self.variants # @return [Array(String, Array, Array, Array>)] + # @type [OpenAI::Internal::Type::Converter] StringArray = OpenAI::Internal::Type::ArrayOf[String] + # @type [OpenAI::Internal::Type::Converter] IntegerArray = OpenAI::Internal::Type::ArrayOf[Integer] + # @type [OpenAI::Internal::Type::Converter] ArrayOfToken2DArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::ArrayOf[Integer]] end @@ -302,6 +305,7 @@ module Stop # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] StringArray = OpenAI::Internal::Type::ArrayOf[String] end end diff --git a/lib/openai/models/embedding_create_params.rb b/lib/openai/models/embedding_create_params.rb index f3fe5c40..bff4d83f 100644 --- a/lib/openai/models/embedding_create_params.rb +++ b/lib/openai/models/embedding_create_params.rb @@ -99,10 +99,13 @@ module Input # @!method self.variants # @return [Array(String, Array, Array, Array>)] + # @type [OpenAI::Internal::Type::Converter] StringArray = OpenAI::Internal::Type::ArrayOf[String] + # @type [OpenAI::Internal::Type::Converter] IntegerArray = OpenAI::Internal::Type::ArrayOf[Integer] + # @type [OpenAI::Internal::Type::Converter] ArrayOfToken2DArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::ArrayOf[Integer]] end diff --git a/lib/openai/models/image_edit_params.rb b/lib/openai/models/image_edit_params.rb index 33526447..e42475a3 100644 --- a/lib/openai/models/image_edit_params.rb +++ b/lib/openai/models/image_edit_params.rb @@ -125,6 +125,7 @@ module Image # @!method self.variants # @return [Array(StringIO, Array)] + # @type [OpenAI::Internal::Type::Converter] StringArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::FileInput] end diff --git a/lib/openai/models/moderation_create_params.rb b/lib/openai/models/moderation_create_params.rb index b6231c78..ae82c207 100644 --- a/lib/openai/models/moderation_create_params.rb +++ b/lib/openai/models/moderation_create_params.rb @@ -51,8 +51,10 @@ module Input # @!method self.variants # @return [Array(String, Array, Array)] + # @type [OpenAI::Internal::Type::Converter] StringArray = OpenAI::Internal::Type::ArrayOf[String] + # @type [OpenAI::Internal::Type::Converter] ModerationMultiModalInputArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::ModerationMultiModalInput }] end diff --git a/lib/openai/models/vector_store_search_params.rb b/lib/openai/models/vector_store_search_params.rb index 5eaa270d..17447b6d 100644 --- a/lib/openai/models/vector_store_search_params.rb +++ b/lib/openai/models/vector_store_search_params.rb @@ -66,6 +66,7 @@ module Query # @!method self.variants # @return [Array(String, Array)] + # @type [OpenAI::Internal::Type::Converter] StringArray = OpenAI::Internal::Type::ArrayOf[String] end diff --git a/lib/openai/request_options.rb b/lib/openai/request_options.rb index 4bd64d4b..d4a15822 100644 --- a/lib/openai/request_options.rb +++ b/lib/openai/request_options.rb @@ -65,10 +65,9 @@ def self.validate!(opts) # @return [Float, nil] optional :timeout, Float - # @!parse - # # @!method initialize(values = {}) - # # Returns a new instance of RequestOptions. - # # - # # @param values [Hash{Symbol=>Object}] + # @!method initialize(values = {}) + # Returns a new instance of RequestOptions. + # + # @param values [Hash{Symbol=>Object}] end end diff --git a/sig/openai/models/beta/thread_create_and_run_params.rbs b/sig/openai/models/beta/thread_create_and_run_params.rbs index 67ca7b95..5d78ca13 100644 --- a/sig/openai/models/beta/thread_create_and_run_params.rbs +++ b/sig/openai/models/beta/thread_create_and_run_params.rbs @@ -151,10 +151,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Beta::Threads::message_content_part_param]] - type message_content_part_param_array = - ::Array[OpenAI::Models::Beta::Threads::message_content_part_param] - - MessageContentPartParamArray: message_content_part_param_array + MessageContentPartParamArray: OpenAI::Internal::Type::Converter end type role = :user | :assistant diff --git a/sig/openai/models/beta/thread_create_params.rbs b/sig/openai/models/beta/thread_create_params.rbs index 96d0d366..08c6bdd2 100644 --- a/sig/openai/models/beta/thread_create_params.rbs +++ b/sig/openai/models/beta/thread_create_params.rbs @@ -67,10 +67,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Beta::Threads::message_content_part_param]] - type message_content_part_param_array = - ::Array[OpenAI::Models::Beta::Threads::message_content_part_param] - - MessageContentPartParamArray: message_content_part_param_array + MessageContentPartParamArray: OpenAI::Internal::Type::Converter end type role = :user | :assistant diff --git a/sig/openai/models/beta/threads/message_create_params.rbs b/sig/openai/models/beta/threads/message_create_params.rbs index 0b4397bf..fd5c2c49 100644 --- a/sig/openai/models/beta/threads/message_create_params.rbs +++ b/sig/openai/models/beta/threads/message_create_params.rbs @@ -42,10 +42,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Beta::Threads::message_content_part_param]] - type message_content_part_param_array = - ::Array[OpenAI::Models::Beta::Threads::message_content_part_param] - - MessageContentPartParamArray: message_content_part_param_array + MessageContentPartParamArray: OpenAI::Internal::Type::Converter end type role = :user | :assistant diff --git a/sig/openai/models/beta/threads/run_create_params.rbs b/sig/openai/models/beta/threads/run_create_params.rbs index f5462f0c..da318adb 100644 --- a/sig/openai/models/beta/threads/run_create_params.rbs +++ b/sig/openai/models/beta/threads/run_create_params.rbs @@ -126,10 +126,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Beta::Threads::message_content_part_param]] - type message_content_part_param_array = - ::Array[OpenAI::Models::Beta::Threads::message_content_part_param] - - MessageContentPartParamArray: message_content_part_param_array + MessageContentPartParamArray: OpenAI::Internal::Type::Converter end type role = :user | :assistant diff --git a/sig/openai/models/chat/chat_completion_assistant_message_param.rbs b/sig/openai/models/chat/chat_completion_assistant_message_param.rbs index 4f92813c..6016de8d 100644 --- a/sig/openai/models/chat/chat_completion_assistant_message_param.rbs +++ b/sig/openai/models/chat/chat_completion_assistant_message_param.rbs @@ -76,10 +76,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Content::array_of_content_part]] - type array_of_content_part_array = - ::Array[OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Content::array_of_content_part] - - ArrayOfContentPartArray: array_of_content_part_array + ArrayOfContentPartArray: OpenAI::Internal::Type::Converter end type function_call = { arguments: String, name: String } diff --git a/sig/openai/models/chat/chat_completion_developer_message_param.rbs b/sig/openai/models/chat/chat_completion_developer_message_param.rbs index b0dfdf86..ed1e4afb 100644 --- a/sig/openai/models/chat/chat_completion_developer_message_param.rbs +++ b/sig/openai/models/chat/chat_completion_developer_message_param.rbs @@ -35,10 +35,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText]] - type chat_completion_content_part_text_array = - ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText] - - ChatCompletionContentPartTextArray: chat_completion_content_part_text_array + ChatCompletionContentPartTextArray: OpenAI::Internal::Type::Converter end end end diff --git a/sig/openai/models/chat/chat_completion_prediction_content.rbs b/sig/openai/models/chat/chat_completion_prediction_content.rbs index 1f5c681a..ad9cdb21 100644 --- a/sig/openai/models/chat/chat_completion_prediction_content.rbs +++ b/sig/openai/models/chat/chat_completion_prediction_content.rbs @@ -29,10 +29,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText]] - type chat_completion_content_part_text_array = - ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText] - - ChatCompletionContentPartTextArray: chat_completion_content_part_text_array + ChatCompletionContentPartTextArray: OpenAI::Internal::Type::Converter end end end diff --git a/sig/openai/models/chat/chat_completion_system_message_param.rbs b/sig/openai/models/chat/chat_completion_system_message_param.rbs index 12811868..81cdf351 100644 --- a/sig/openai/models/chat/chat_completion_system_message_param.rbs +++ b/sig/openai/models/chat/chat_completion_system_message_param.rbs @@ -35,10 +35,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText]] - type chat_completion_content_part_text_array = - ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText] - - ChatCompletionContentPartTextArray: chat_completion_content_part_text_array + ChatCompletionContentPartTextArray: OpenAI::Internal::Type::Converter end end end diff --git a/sig/openai/models/chat/chat_completion_tool_message_param.rbs b/sig/openai/models/chat/chat_completion_tool_message_param.rbs index 7808c0a9..5b737943 100644 --- a/sig/openai/models/chat/chat_completion_tool_message_param.rbs +++ b/sig/openai/models/chat/chat_completion_tool_message_param.rbs @@ -33,10 +33,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText]] - type chat_completion_content_part_text_array = - ::Array[OpenAI::Models::Chat::ChatCompletionContentPartText] - - ChatCompletionContentPartTextArray: chat_completion_content_part_text_array + ChatCompletionContentPartTextArray: OpenAI::Internal::Type::Converter end end end diff --git a/sig/openai/models/chat/chat_completion_user_message_param.rbs b/sig/openai/models/chat/chat_completion_user_message_param.rbs index ea9b16d6..5f5c1a1c 100644 --- a/sig/openai/models/chat/chat_completion_user_message_param.rbs +++ b/sig/openai/models/chat/chat_completion_user_message_param.rbs @@ -35,10 +35,7 @@ module OpenAI def self?.variants: -> [String, ::Array[OpenAI::Models::Chat::chat_completion_content_part]] - type chat_completion_content_part_array = - ::Array[OpenAI::Models::Chat::chat_completion_content_part] - - ChatCompletionContentPartArray: chat_completion_content_part_array + ChatCompletionContentPartArray: OpenAI::Internal::Type::Converter end end end diff --git a/sig/openai/models/chat/completion_create_params.rbs b/sig/openai/models/chat/completion_create_params.rbs index 02d22187..1eb9953b 100644 --- a/sig/openai/models/chat/completion_create_params.rbs +++ b/sig/openai/models/chat/completion_create_params.rbs @@ -263,9 +263,7 @@ module OpenAI def self?.variants: -> [String, ::Array[String]] - type string_array = ::Array[String] - - StringArray: string_array + StringArray: OpenAI::Internal::Type::Converter end type web_search_options = diff --git a/sig/openai/models/completion_create_params.rbs b/sig/openai/models/completion_create_params.rbs index d4b9afbe..184a3c57 100644 --- a/sig/openai/models/completion_create_params.rbs +++ b/sig/openai/models/completion_create_params.rbs @@ -108,17 +108,11 @@ module OpenAI def self?.variants: -> [String, ::Array[String], ::Array[Integer], ::Array[::Array[Integer]]] - type string_array = ::Array[String] + StringArray: OpenAI::Internal::Type::Converter - StringArray: string_array + IntegerArray: OpenAI::Internal::Type::Converter - type integer_array = ::Array[Integer] - - IntegerArray: integer_array - - type array_of_token2_d_array = ::Array[::Array[Integer]] - - ArrayOfToken2DArray: array_of_token2_d_array + ArrayOfToken2DArray: OpenAI::Internal::Type::Converter end type stop = (String | ::Array[String])? @@ -128,9 +122,7 @@ module OpenAI def self?.variants: -> [String, ::Array[String]] - type string_array = ::Array[String] - - StringArray: string_array + StringArray: OpenAI::Internal::Type::Converter end end end diff --git a/sig/openai/models/embedding_create_params.rbs b/sig/openai/models/embedding_create_params.rbs index fc247341..16c3bd6d 100644 --- a/sig/openai/models/embedding_create_params.rbs +++ b/sig/openai/models/embedding_create_params.rbs @@ -51,17 +51,11 @@ module OpenAI def self?.variants: -> [String, ::Array[String], ::Array[Integer], ::Array[::Array[Integer]]] - type string_array = ::Array[String] + StringArray: OpenAI::Internal::Type::Converter - StringArray: string_array + IntegerArray: OpenAI::Internal::Type::Converter - type integer_array = ::Array[Integer] - - IntegerArray: integer_array - - type array_of_token2_d_array = ::Array[::Array[Integer]] - - ArrayOfToken2DArray: array_of_token2_d_array + ArrayOfToken2DArray: OpenAI::Internal::Type::Converter end type model = String | OpenAI::Models::embedding_model diff --git a/sig/openai/models/image_edit_params.rbs b/sig/openai/models/image_edit_params.rbs index 95e02a84..bf702f1e 100644 --- a/sig/openai/models/image_edit_params.rbs +++ b/sig/openai/models/image_edit_params.rbs @@ -69,9 +69,7 @@ module OpenAI def self?.variants: -> [StringIO, ::Array[StringIO]] - type string_array = ::Array[Pathname | StringIO | IO | OpenAI::FilePart] - - StringArray: string_array + StringArray: OpenAI::Internal::Type::Converter end type model = String | OpenAI::Models::image_model diff --git a/sig/openai/models/moderation_create_params.rbs b/sig/openai/models/moderation_create_params.rbs index e8c1e576..e6f8668e 100644 --- a/sig/openai/models/moderation_create_params.rbs +++ b/sig/openai/models/moderation_create_params.rbs @@ -37,14 +37,9 @@ module OpenAI def self?.variants: -> [String, ::Array[String], ::Array[OpenAI::Models::moderation_multi_modal_input]] - type string_array = ::Array[String] + StringArray: OpenAI::Internal::Type::Converter - StringArray: string_array - - type moderation_multi_modal_input_array = - ::Array[OpenAI::Models::moderation_multi_modal_input] - - ModerationMultiModalInputArray: moderation_multi_modal_input_array + ModerationMultiModalInputArray: OpenAI::Internal::Type::Converter end type model = String | OpenAI::Models::moderation_model diff --git a/sig/openai/models/vector_store_search_params.rbs b/sig/openai/models/vector_store_search_params.rbs index 823cd7bc..9d571eee 100644 --- a/sig/openai/models/vector_store_search_params.rbs +++ b/sig/openai/models/vector_store_search_params.rbs @@ -54,9 +54,7 @@ module OpenAI def self?.variants: -> [String, ::Array[String]] - type string_array = ::Array[String] - - StringArray: string_array + StringArray: OpenAI::Internal::Type::Converter end type filters = diff --git a/test/openai/file_part_test.rb b/test/openai/file_part_test.rb index 4136b1b6..96abf7cf 100644 --- a/test/openai/file_part_test.rb +++ b/test/openai/file_part_test.rb @@ -8,5 +8,6 @@ def test_to_json filepart = OpenAI::FilePart.new(StringIO.new(text)) assert_equal(text.to_json, filepart.to_json) + assert_equal(text.to_yaml, filepart.to_yaml) end end From 4918836aac697a899b19e4c3767126d0d86914d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:23:36 +0000 Subject: [PATCH 21/33] chore(internal): annotate request options with type aliases in sorbet --- lib/openai/models/function_parameters.rb | 1 + lib/openai/models/metadata.rb | 1 + lib/openai/models/responses/response_input.rb | 1 + .../response_input_message_content_list.rb | 1 + rbi/openai/internal/transport/base_client.rbi | 4 +-- .../internal/type/request_parameters.rbi | 2 +- rbi/openai/request_options.rbi | 2 ++ rbi/openai/resources/audio/speech.rbi | 2 +- rbi/openai/resources/audio/transcriptions.rbi | 4 +-- rbi/openai/resources/audio/translations.rbi | 2 +- rbi/openai/resources/batches.rbi | 24 +++------------- rbi/openai/resources/beta/assistants.rbi | 17 ++++------- rbi/openai/resources/beta/threads.rbi | 21 ++++---------- .../resources/beta/threads/messages.rbi | 18 ++++-------- rbi/openai/resources/beta/threads/runs.rbi | 24 ++++++---------- .../resources/beta/threads/runs/steps.rbi | 4 +-- rbi/openai/resources/chat/completions.rbi | 18 ++++-------- .../resources/chat/completions/messages.rbi | 2 +- rbi/openai/resources/completions.rbi | 4 +-- rbi/openai/resources/embeddings.rbi | 2 +- rbi/openai/resources/evals.rbi | 20 ++++--------- rbi/openai/resources/evals/runs.rbi | 22 ++++----------- .../resources/evals/runs/output_items.rbi | 4 +-- rbi/openai/resources/files.rbi | 28 ++++--------------- .../fine_tuning/checkpoints/permissions.rbi | 6 ++-- rbi/openai/resources/fine_tuning/jobs.rbi | 16 ++++------- .../fine_tuning/jobs/checkpoints.rbi | 2 +- rbi/openai/resources/images.rbi | 6 ++-- rbi/openai/resources/models.rbi | 21 ++------------ rbi/openai/resources/moderations.rbi | 2 +- rbi/openai/resources/responses.rbi | 14 +++------- .../resources/responses/input_items.rbi | 2 +- rbi/openai/resources/uploads.rbi | 12 ++------ rbi/openai/resources/uploads/parts.rbi | 2 +- rbi/openai/resources/vector_stores.rbi | 21 ++++---------- .../resources/vector_stores/file_batches.rbi | 16 +++-------- rbi/openai/resources/vector_stores/files.rbi | 24 ++++------------ sig/openai/models/function_parameters.rbs | 2 +- sig/openai/models/metadata.rbs | 2 +- .../models/responses/response_input.rbs | 2 +- .../response_input_message_content_list.rbs | 2 +- 41 files changed, 115 insertions(+), 265 deletions(-) diff --git a/lib/openai/models/function_parameters.rb b/lib/openai/models/function_parameters.rb index c32b337a..efd72125 100644 --- a/lib/openai/models/function_parameters.rb +++ b/lib/openai/models/function_parameters.rb @@ -2,6 +2,7 @@ module OpenAI module Models + # @type [OpenAI::Internal::Type::Converter] FunctionParameters = OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] end end diff --git a/lib/openai/models/metadata.rb b/lib/openai/models/metadata.rb index c6a6935d..7930ffac 100644 --- a/lib/openai/models/metadata.rb +++ b/lib/openai/models/metadata.rb @@ -2,6 +2,7 @@ module OpenAI module Models + # @type [OpenAI::Internal::Type::Converter] Metadata = OpenAI::Internal::Type::HashOf[String] end end diff --git a/lib/openai/models/responses/response_input.rb b/lib/openai/models/responses/response_input.rb index 591bab05..aa4de811 100644 --- a/lib/openai/models/responses/response_input.rb +++ b/lib/openai/models/responses/response_input.rb @@ -3,6 +3,7 @@ module OpenAI module Models module Responses + # @type [OpenAI::Internal::Type::Converter] ResponseInput = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Responses::ResponseInputItem }] end diff --git a/lib/openai/models/responses/response_input_message_content_list.rb b/lib/openai/models/responses/response_input_message_content_list.rb index a1362365..888f3f1c 100644 --- a/lib/openai/models/responses/response_input_message_content_list.rb +++ b/lib/openai/models/responses/response_input_message_content_list.rb @@ -3,6 +3,7 @@ module OpenAI module Models module Responses + # @type [OpenAI::Internal::Type::Converter] ResponseInputMessageContentList = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Models::Responses::ResponseInputContent }] end diff --git a/rbi/openai/internal/transport/base_client.rbi b/rbi/openai/internal/transport/base_client.rbi index fb87b782..612daee4 100644 --- a/rbi/openai/internal/transport/base_client.rbi +++ b/rbi/openai/internal/transport/base_client.rbi @@ -38,7 +38,7 @@ module OpenAI OpenAI::Internal::Type::BaseModel]] ), model: T.nilable(OpenAI::Internal::Type::Converter::Input), - options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + options: T.nilable(OpenAI::RequestOpts) } end @@ -194,7 +194,7 @@ module OpenAI OpenAI::Internal::Type::BaseModel]] ), model: T.nilable(OpenAI::Internal::Type::Converter::Input), - options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + options: T.nilable(OpenAI::RequestOpts) ) .returns(T.anything) end diff --git a/rbi/openai/internal/type/request_parameters.rbi b/rbi/openai/internal/type/request_parameters.rbi index 2a1c8d7f..1d86b7ab 100644 --- a/rbi/openai/internal/type/request_parameters.rbi +++ b/rbi/openai/internal/type/request_parameters.rbi @@ -6,7 +6,7 @@ module OpenAI # @api private module RequestParameters # Options to specify HTTP behaviour for this request. - sig { returns(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) } + sig { returns(OpenAI::RequestOpts) } attr_accessor :request_options # @api private diff --git a/rbi/openai/request_options.rbi b/rbi/openai/request_options.rbi index 9c3df5a0..2dc1eb77 100644 --- a/rbi/openai/request_options.rbi +++ b/rbi/openai/request_options.rbi @@ -1,6 +1,8 @@ # typed: strong module OpenAI + RequestOpts = T.type_alias { T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash) } + # Specify HTTP behaviour to use for a specific request. These options supplement # or override those provided at the client level. # diff --git a/rbi/openai/resources/audio/speech.rbi b/rbi/openai/resources/audio/speech.rbi index 2717898a..16739bc4 100644 --- a/rbi/openai/resources/audio/speech.rbi +++ b/rbi/openai/resources/audio/speech.rbi @@ -13,7 +13,7 @@ module OpenAI instructions: String, response_format: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol, speed: Float, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(StringIO) end diff --git a/rbi/openai/resources/audio/transcriptions.rbi b/rbi/openai/resources/audio/transcriptions.rbi index 45316428..b8fb2b38 100644 --- a/rbi/openai/resources/audio/transcriptions.rbi +++ b/rbi/openai/resources/audio/transcriptions.rbi @@ -19,7 +19,7 @@ module OpenAI temperature: Float, timestamp_granularities: T::Array[OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity::OrSymbol], stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(T.any(OpenAI::Models::Audio::Transcription, OpenAI::Models::Audio::TranscriptionVerbose)) end @@ -82,7 +82,7 @@ module OpenAI temperature: Float, timestamp_granularities: T::Array[OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity::OrSymbol], stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns( OpenAI::Internal::Stream[ diff --git a/rbi/openai/resources/audio/translations.rbi b/rbi/openai/resources/audio/translations.rbi index b9130883..b9675bf8 100644 --- a/rbi/openai/resources/audio/translations.rbi +++ b/rbi/openai/resources/audio/translations.rbi @@ -12,7 +12,7 @@ module OpenAI prompt: String, response_format: OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol, temperature: Float, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(T.any(OpenAI::Models::Audio::Translation, OpenAI::Models::Audio::TranslationVerbose)) end diff --git a/rbi/openai/resources/batches.rbi b/rbi/openai/resources/batches.rbi index 390a8fa9..f58e4e80 100644 --- a/rbi/openai/resources/batches.rbi +++ b/rbi/openai/resources/batches.rbi @@ -10,7 +10,7 @@ module OpenAI endpoint: OpenAI::Models::BatchCreateParams::Endpoint::OrSymbol, input_file_id: String, metadata: T.nilable(T::Hash[Symbol, String]), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Batch) end @@ -43,13 +43,7 @@ module OpenAI request_options: {} ); end # Retrieves a batch. - sig do - params( - batch_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::Batch) - end + sig { params(batch_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::Batch) } def retrieve( # The ID of the batch to retrieve. batch_id, @@ -57,11 +51,7 @@ module OpenAI ); end # List your organization's batches. sig do - params( - after: String, - limit: Integer, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(after: String, limit: Integer, request_options: OpenAI::RequestOpts) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Batch]) end def list( @@ -78,13 +68,7 @@ module OpenAI # Cancels an in-progress batch. The batch will be in status `cancelling` for up to # 10 minutes, before changing to `cancelled`, where it will have partial results # (if any) available in the output file. - sig do - params( - batch_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::Batch) - end + sig { params(batch_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::Batch) } def cancel( # The ID of the batch to cancel. batch_id, diff --git a/rbi/openai/resources/beta/assistants.rbi b/rbi/openai/resources/beta/assistants.rbi index 580fbcba..f58ad07a 100644 --- a/rbi/openai/resources/beta/assistants.rbi +++ b/rbi/openai/resources/beta/assistants.rbi @@ -33,7 +33,7 @@ module OpenAI ) ], top_p: T.nilable(Float), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Assistant) end @@ -109,11 +109,7 @@ module OpenAI ); end # Retrieves an assistant. sig do - params( - assistant_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::Beta::Assistant) + params(assistant_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::Beta::Assistant) end def retrieve( # The ID of the assistant to retrieve. @@ -150,7 +146,7 @@ module OpenAI ) ], top_p: T.nilable(Float), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Assistant) end @@ -233,7 +229,7 @@ module OpenAI before: String, limit: Integer, order: OpenAI::Models::Beta::AssistantListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Beta::Assistant]) end @@ -258,10 +254,7 @@ module OpenAI ); end # Delete an assistant. sig do - params( - assistant_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(assistant_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Beta::AssistantDeleted) end def delete( diff --git a/rbi/openai/resources/beta/threads.rbi b/rbi/openai/resources/beta/threads.rbi index 316bbca4..aa3e43b7 100644 --- a/rbi/openai/resources/beta/threads.rbi +++ b/rbi/openai/resources/beta/threads.rbi @@ -16,7 +16,7 @@ module OpenAI messages: T::Array[T.any(OpenAI::Models::Beta::ThreadCreateParams::Message, OpenAI::Internal::AnyHash)], metadata: T.nilable(T::Hash[Symbol, String]), tool_resources: T.nilable(T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources, OpenAI::Internal::AnyHash)), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Thread) end @@ -39,13 +39,7 @@ module OpenAI request_options: {} ); end # Retrieves a thread. - sig do - params( - thread_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::Beta::Thread) - end + sig { params(thread_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::Beta::Thread) } def retrieve( # The ID of the thread to retrieve. thread_id, @@ -57,7 +51,7 @@ module OpenAI thread_id: String, metadata: T.nilable(T::Hash[Symbol, String]), tool_resources: T.nilable(T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, OpenAI::Internal::AnyHash)), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Thread) end @@ -80,10 +74,7 @@ module OpenAI ); end # Delete a thread. sig do - params( - thread_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(thread_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Beta::ThreadDeleted) end def delete( @@ -137,7 +128,7 @@ module OpenAI T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, OpenAI::Internal::AnyHash) ), stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Threads::Run) end @@ -282,7 +273,7 @@ module OpenAI T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, OpenAI::Internal::AnyHash) ), stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns( OpenAI::Internal::Stream[ diff --git a/rbi/openai/resources/beta/threads/messages.rbi b/rbi/openai/resources/beta/threads/messages.rbi index 2d12cb7e..f17e3cfe 100644 --- a/rbi/openai/resources/beta/threads/messages.rbi +++ b/rbi/openai/resources/beta/threads/messages.rbi @@ -25,7 +25,7 @@ module OpenAI T::Array[T.any(OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment, OpenAI::Internal::AnyHash)] ), metadata: T.nilable(T::Hash[Symbol, String]), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Threads::Message) end @@ -55,11 +55,7 @@ module OpenAI ); end # Retrieve a message. sig do - params( - message_id: String, - thread_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(message_id: String, thread_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Beta::Threads::Message) end def retrieve( @@ -76,7 +72,7 @@ module OpenAI message_id: String, thread_id: String, metadata: T.nilable(T::Hash[Symbol, String]), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Threads::Message) end @@ -103,7 +99,7 @@ module OpenAI limit: Integer, order: OpenAI::Models::Beta::Threads::MessageListParams::Order::OrSymbol, run_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Beta::Threads::Message]) end @@ -133,11 +129,7 @@ module OpenAI ); end # Deletes a message. sig do - params( - message_id: String, - thread_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(message_id: String, thread_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Beta::Threads::MessageDeleted) end def delete( diff --git a/rbi/openai/resources/beta/threads/runs.rbi b/rbi/openai/resources/beta/threads/runs.rbi index e3a1216a..0148ff01 100644 --- a/rbi/openai/resources/beta/threads/runs.rbi +++ b/rbi/openai/resources/beta/threads/runs.rbi @@ -60,7 +60,7 @@ module OpenAI T.any(OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, OpenAI::Internal::AnyHash) ), stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Threads::Run) end @@ -230,7 +230,7 @@ module OpenAI T.any(OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, OpenAI::Internal::AnyHash) ), stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns( OpenAI::Internal::Stream[ @@ -379,11 +379,7 @@ module OpenAI ); end # Retrieves a run. sig do - params( - run_id: String, - thread_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(run_id: String, thread_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Beta::Threads::Run) end def retrieve( @@ -400,7 +396,7 @@ module OpenAI run_id: String, thread_id: String, metadata: T.nilable(T::Hash[Symbol, String]), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Threads::Run) end @@ -427,7 +423,7 @@ module OpenAI before: String, limit: Integer, order: OpenAI::Models::Beta::Threads::RunListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Beta::Threads::Run]) end @@ -454,11 +450,7 @@ module OpenAI ); end # Cancels a run that is `in_progress`. sig do - params( - run_id: String, - thread_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(run_id: String, thread_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Beta::Threads::Run) end def cancel( @@ -481,7 +473,7 @@ module OpenAI thread_id: String, tool_outputs: T::Array[T.any(OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput, OpenAI::Internal::AnyHash)], stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Threads::Run) end @@ -513,7 +505,7 @@ module OpenAI thread_id: String, tool_outputs: T::Array[T.any(OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput, OpenAI::Internal::AnyHash)], stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns( OpenAI::Internal::Stream[ diff --git a/rbi/openai/resources/beta/threads/runs/steps.rbi b/rbi/openai/resources/beta/threads/runs/steps.rbi index 949e7d14..4ffb638c 100644 --- a/rbi/openai/resources/beta/threads/runs/steps.rbi +++ b/rbi/openai/resources/beta/threads/runs/steps.rbi @@ -13,7 +13,7 @@ module OpenAI thread_id: String, run_id: String, include: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol], - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Beta::Threads::Runs::RunStep) end @@ -45,7 +45,7 @@ module OpenAI include: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol], limit: Integer, order: OpenAI::Models::Beta::Threads::Runs::StepListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Beta::Threads::Runs::RunStep]) end diff --git a/rbi/openai/resources/chat/completions.rbi b/rbi/openai/resources/chat/completions.rbi index 6a7ba0a2..9c73209e 100644 --- a/rbi/openai/resources/chat/completions.rbi +++ b/rbi/openai/resources/chat/completions.rbi @@ -82,7 +82,7 @@ module OpenAI user: String, web_search_options: T.any(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions, OpenAI::Internal::AnyHash), stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Chat::ChatCompletion) end @@ -355,7 +355,7 @@ module OpenAI user: String, web_search_options: T.any(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions, OpenAI::Internal::AnyHash), stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::Stream[OpenAI::Models::Chat::ChatCompletionChunk]) end @@ -556,10 +556,7 @@ module OpenAI # Get a stored chat completion. Only Chat Completions that have been created with # the `store` parameter set to `true` will be returned. sig do - params( - completion_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(completion_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Chat::ChatCompletion) end def retrieve( @@ -574,7 +571,7 @@ module OpenAI params( completion_id: String, metadata: T.nilable(T::Hash[Symbol, String]), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Chat::ChatCompletion) end @@ -599,7 +596,7 @@ module OpenAI metadata: T.nilable(T::Hash[Symbol, String]), model: String, order: OpenAI::Models::Chat::CompletionListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Chat::ChatCompletion]) end @@ -622,10 +619,7 @@ module OpenAI # Delete a stored chat completion. Only Chat Completions that have been created # with the `store` parameter set to `true` can be deleted. sig do - params( - completion_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(completion_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Chat::ChatCompletionDeleted) end def delete( diff --git a/rbi/openai/resources/chat/completions/messages.rbi b/rbi/openai/resources/chat/completions/messages.rbi index 53d6538e..c0c82fe6 100644 --- a/rbi/openai/resources/chat/completions/messages.rbi +++ b/rbi/openai/resources/chat/completions/messages.rbi @@ -13,7 +13,7 @@ module OpenAI after: String, limit: Integer, order: OpenAI::Models::Chat::Completions::MessageListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Chat::ChatCompletionStoreMessage]) end diff --git a/rbi/openai/resources/completions.rbi b/rbi/openai/resources/completions.rbi index 82e27795..b3576715 100644 --- a/rbi/openai/resources/completions.rbi +++ b/rbi/openai/resources/completions.rbi @@ -26,7 +26,7 @@ module OpenAI top_p: T.nilable(Float), user: String, stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Completion) end @@ -164,7 +164,7 @@ module OpenAI top_p: T.nilable(Float), user: String, stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::Stream[OpenAI::Models::Completion]) end diff --git a/rbi/openai/resources/embeddings.rbi b/rbi/openai/resources/embeddings.rbi index ae6d042f..26fa538b 100644 --- a/rbi/openai/resources/embeddings.rbi +++ b/rbi/openai/resources/embeddings.rbi @@ -11,7 +11,7 @@ module OpenAI dimensions: Integer, encoding_format: OpenAI::Models::EmbeddingCreateParams::EncodingFormat::OrSymbol, user: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::CreateEmbeddingResponse) end diff --git a/rbi/openai/resources/evals.rbi b/rbi/openai/resources/evals.rbi index ccf5a9f3..0f330e56 100644 --- a/rbi/openai/resources/evals.rbi +++ b/rbi/openai/resources/evals.rbi @@ -30,7 +30,7 @@ module OpenAI ], metadata: T.nilable(T::Hash[Symbol, String]), name: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::EvalCreateResponse) end @@ -52,11 +52,7 @@ module OpenAI ); end # Get an evaluation by ID. sig do - params( - eval_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::EvalRetrieveResponse) + params(eval_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::EvalRetrieveResponse) end def retrieve( # The ID of the evaluation to retrieve. @@ -69,7 +65,7 @@ module OpenAI eval_id: String, metadata: T.nilable(T::Hash[Symbol, String]), name: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::EvalUpdateResponse) end @@ -94,7 +90,7 @@ module OpenAI limit: Integer, order: OpenAI::Models::EvalListParams::Order::OrSymbol, order_by: OpenAI::Models::EvalListParams::OrderBy::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::EvalListResponse]) end @@ -112,13 +108,7 @@ module OpenAI request_options: {} ); end # Delete an evaluation. - sig do - params( - eval_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::EvalDeleteResponse) - end + sig { params(eval_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::EvalDeleteResponse) } def delete( # The ID of the evaluation to delete. eval_id, diff --git a/rbi/openai/resources/evals/runs.rbi b/rbi/openai/resources/evals/runs.rbi index 014d5734..86dad155 100644 --- a/rbi/openai/resources/evals/runs.rbi +++ b/rbi/openai/resources/evals/runs.rbi @@ -19,7 +19,7 @@ module OpenAI ), metadata: T.nilable(T::Hash[Symbol, String]), name: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Evals::RunCreateResponse) end @@ -41,11 +41,7 @@ module OpenAI ); end # Get an evaluation run by ID. sig do - params( - run_id: String, - eval_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(run_id: String, eval_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Evals::RunRetrieveResponse) end def retrieve( @@ -63,7 +59,7 @@ module OpenAI limit: Integer, order: OpenAI::Models::Evals::RunListParams::Order::OrSymbol, status: OpenAI::Models::Evals::RunListParams::Status::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Evals::RunListResponse]) end @@ -84,11 +80,7 @@ module OpenAI ); end # Delete an eval run. sig do - params( - run_id: String, - eval_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(run_id: String, eval_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Evals::RunDeleteResponse) end def delete( @@ -100,11 +92,7 @@ module OpenAI ); end # Cancel an ongoing evaluation run. sig do - params( - run_id: String, - eval_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(run_id: String, eval_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::Evals::RunCancelResponse) end def cancel( diff --git a/rbi/openai/resources/evals/runs/output_items.rbi b/rbi/openai/resources/evals/runs/output_items.rbi index 16053fa0..85f0767a 100644 --- a/rbi/openai/resources/evals/runs/output_items.rbi +++ b/rbi/openai/resources/evals/runs/output_items.rbi @@ -11,7 +11,7 @@ module OpenAI output_item_id: String, eval_id: String, run_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse) end @@ -33,7 +33,7 @@ module OpenAI limit: Integer, order: OpenAI::Models::Evals::Runs::OutputItemListParams::Order::OrSymbol, status: OpenAI::Models::Evals::Runs::OutputItemListParams::Status::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::Evals::Runs::OutputItemListResponse]) end diff --git a/rbi/openai/resources/files.rbi b/rbi/openai/resources/files.rbi index aa872185..4afa8467 100644 --- a/rbi/openai/resources/files.rbi +++ b/rbi/openai/resources/files.rbi @@ -28,7 +28,7 @@ module OpenAI params( file: T.any(Pathname, StringIO, IO, OpenAI::FilePart), purpose: OpenAI::Models::FilePurpose::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::FileObject) end @@ -43,13 +43,7 @@ module OpenAI request_options: {} ); end # Returns information about a specific file. - sig do - params( - file_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::FileObject) - end + sig { params(file_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::FileObject) } def retrieve( # The ID of the file to use for this request. file_id, @@ -62,7 +56,7 @@ module OpenAI limit: Integer, order: OpenAI::Models::FileListParams::Order::OrSymbol, purpose: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::FileObject]) end @@ -83,26 +77,14 @@ module OpenAI request_options: {} ); end # Delete a file. - sig do - params( - file_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::FileDeleted) - end + sig { params(file_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::FileDeleted) } def delete( # The ID of the file to use for this request. file_id, request_options: {} ); end # Returns the contents of the specified file. - sig do - params( - file_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(StringIO) - end + sig { params(file_id: String, request_options: OpenAI::RequestOpts).returns(StringIO) } def content( # The ID of the file to use for this request. file_id, diff --git a/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi b/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi index 64fb5a6a..1fa2933b 100644 --- a/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi +++ b/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi @@ -13,7 +13,7 @@ module OpenAI params( fine_tuned_model_checkpoint: String, project_ids: T::Array[String], - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::Page[OpenAI::Models::FineTuning::Checkpoints::PermissionCreateResponse]) end @@ -35,7 +35,7 @@ module OpenAI limit: Integer, order: OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveParams::Order::OrSymbol, project_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse) end @@ -60,7 +60,7 @@ module OpenAI params( permission_id: String, fine_tuned_model_checkpoint: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteResponse) end diff --git a/rbi/openai/resources/fine_tuning/jobs.rbi b/rbi/openai/resources/fine_tuning/jobs.rbi index b39d1d85..c0e05100 100644 --- a/rbi/openai/resources/fine_tuning/jobs.rbi +++ b/rbi/openai/resources/fine_tuning/jobs.rbi @@ -27,7 +27,7 @@ module OpenAI seed: T.nilable(Integer), suffix: T.nilable(String), validation_file: T.nilable(String), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::FineTuning::FineTuningJob) end @@ -96,10 +96,7 @@ module OpenAI # # [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning) sig do - params( - fine_tuning_job_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(fine_tuning_job_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::FineTuning::FineTuningJob) end def retrieve( @@ -113,7 +110,7 @@ module OpenAI after: String, limit: Integer, metadata: T.nilable(T::Hash[Symbol, String]), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::FineTuning::FineTuningJob]) end @@ -129,10 +126,7 @@ module OpenAI ); end # Immediately cancel a fine-tune job. sig do - params( - fine_tuning_job_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(fine_tuning_job_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::FineTuning::FineTuningJob) end def cancel( @@ -146,7 +140,7 @@ module OpenAI fine_tuning_job_id: String, after: String, limit: Integer, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::FineTuning::FineTuningJobEvent]) end diff --git a/rbi/openai/resources/fine_tuning/jobs/checkpoints.rbi b/rbi/openai/resources/fine_tuning/jobs/checkpoints.rbi index dfc6cee6..bf3ced26 100644 --- a/rbi/openai/resources/fine_tuning/jobs/checkpoints.rbi +++ b/rbi/openai/resources/fine_tuning/jobs/checkpoints.rbi @@ -11,7 +11,7 @@ module OpenAI fine_tuning_job_id: String, after: String, limit: Integer, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint]) end diff --git a/rbi/openai/resources/images.rbi b/rbi/openai/resources/images.rbi index f50d6486..13ac0077 100644 --- a/rbi/openai/resources/images.rbi +++ b/rbi/openai/resources/images.rbi @@ -12,7 +12,7 @@ module OpenAI response_format: T.nilable(OpenAI::Models::ImageCreateVariationParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageCreateVariationParams::Size::OrSymbol), user: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::ImagesResponse) end @@ -57,7 +57,7 @@ module OpenAI response_format: T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol), size: T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol), user: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::ImagesResponse) end @@ -116,7 +116,7 @@ module OpenAI size: T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol), style: T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol), user: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::ImagesResponse) end diff --git a/rbi/openai/resources/models.rbi b/rbi/openai/resources/models.rbi index 252a1dca..e403a7e3 100644 --- a/rbi/openai/resources/models.rbi +++ b/rbi/openai/resources/models.rbi @@ -5,13 +5,7 @@ module OpenAI class Models # Retrieves a model instance, providing basic information about the model such as # the owner and permissioning. - sig do - params( - model: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::Model) - end + sig { params(model: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::Model) } def retrieve( # The ID of the model to use for this request model, @@ -19,21 +13,12 @@ module OpenAI ); end # Lists the currently available models, and provides basic information about each # one such as the owner and availability. - sig do - params(request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash))) - .returns(OpenAI::Internal::Page[OpenAI::Models::Model]) - end + sig { params(request_options: OpenAI::RequestOpts).returns(OpenAI::Internal::Page[OpenAI::Models::Model]) } def list(request_options: {}); end # Delete a fine-tuned model. You must have the Owner role in your organization to # delete a model. - sig do - params( - model: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::ModelDeleted) - end + sig { params(model: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::ModelDeleted) } def delete( # The model to delete model, diff --git a/rbi/openai/resources/moderations.rbi b/rbi/openai/resources/moderations.rbi index b068d8e7..fe3696e7 100644 --- a/rbi/openai/resources/moderations.rbi +++ b/rbi/openai/resources/moderations.rbi @@ -19,7 +19,7 @@ module OpenAI ] ), model: T.any(String, OpenAI::Models::ModerationModel::OrSymbol), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::ModerationCreateResponse) end diff --git a/rbi/openai/resources/responses.rbi b/rbi/openai/resources/responses.rbi index b67ed0d1..ba349b4b 100644 --- a/rbi/openai/resources/responses.rbi +++ b/rbi/openai/resources/responses.rbi @@ -75,7 +75,7 @@ module OpenAI truncation: T.nilable(OpenAI::Models::Responses::ResponseCreateParams::Truncation::OrSymbol), user: String, stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Responses::Response) end @@ -276,7 +276,7 @@ module OpenAI truncation: T.nilable(OpenAI::Models::Responses::ResponseCreateParams::Truncation::OrSymbol), user: String, stream: T.noreturn, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns( OpenAI::Internal::Stream[ @@ -454,7 +454,7 @@ module OpenAI params( response_id: String, include: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol], - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Responses::Response) end @@ -467,13 +467,7 @@ module OpenAI request_options: {} ); end # Deletes a model response with the given ID. - sig do - params( - response_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .void - end + sig { params(response_id: String, request_options: OpenAI::RequestOpts).void } def delete( # The ID of the response to delete. response_id, diff --git a/rbi/openai/resources/responses/input_items.rbi b/rbi/openai/resources/responses/input_items.rbi index 0c70b7b0..b2d6a042 100644 --- a/rbi/openai/resources/responses/input_items.rbi +++ b/rbi/openai/resources/responses/input_items.rbi @@ -13,7 +13,7 @@ module OpenAI include: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol], limit: Integer, order: OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns( OpenAI::Internal::CursorPage[ diff --git a/rbi/openai/resources/uploads.rbi b/rbi/openai/resources/uploads.rbi index c397fdbf..ef17a778 100644 --- a/rbi/openai/resources/uploads.rbi +++ b/rbi/openai/resources/uploads.rbi @@ -31,7 +31,7 @@ module OpenAI filename: String, mime_type: String, purpose: OpenAI::Models::FilePurpose::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Upload) end @@ -53,13 +53,7 @@ module OpenAI request_options: {} ); end # Cancels the Upload. No Parts may be added after an Upload is cancelled. - sig do - params( - upload_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::Upload) - end + sig { params(upload_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::Upload) } def cancel( # The ID of the Upload. upload_id, @@ -83,7 +77,7 @@ module OpenAI upload_id: String, part_ids: T::Array[String], md5: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Upload) end diff --git a/rbi/openai/resources/uploads/parts.rbi b/rbi/openai/resources/uploads/parts.rbi index 867a760a..4534662a 100644 --- a/rbi/openai/resources/uploads/parts.rbi +++ b/rbi/openai/resources/uploads/parts.rbi @@ -19,7 +19,7 @@ module OpenAI params( upload_id: String, data: T.any(Pathname, StringIO, IO, OpenAI::FilePart), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::Uploads::UploadPart) end diff --git a/rbi/openai/resources/vector_stores.rbi b/rbi/openai/resources/vector_stores.rbi index 7658101e..6c6be823 100644 --- a/rbi/openai/resources/vector_stores.rbi +++ b/rbi/openai/resources/vector_stores.rbi @@ -21,7 +21,7 @@ module OpenAI file_ids: T::Array[String], metadata: T.nilable(T::Hash[Symbol, String]), name: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::VectorStore) end @@ -47,13 +47,7 @@ module OpenAI request_options: {} ); end # Retrieves a vector store. - sig do - params( - vector_store_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) - .returns(OpenAI::Models::VectorStore) - end + sig { params(vector_store_id: String, request_options: OpenAI::RequestOpts).returns(OpenAI::Models::VectorStore) } def retrieve( # The ID of the vector store to retrieve. vector_store_id, @@ -66,7 +60,7 @@ module OpenAI expires_after: T.nilable(T.any(OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, OpenAI::Internal::AnyHash)), metadata: T.nilable(T::Hash[Symbol, String]), name: T.nilable(String), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::VectorStore) end @@ -93,7 +87,7 @@ module OpenAI before: String, limit: Integer, order: OpenAI::Models::VectorStoreListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::VectorStore]) end @@ -118,10 +112,7 @@ module OpenAI ); end # Delete a vector store. sig do - params( - vector_store_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(vector_store_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::VectorStoreDeleted) end def delete( @@ -139,7 +130,7 @@ module OpenAI max_num_results: Integer, ranking_options: T.any(OpenAI::Models::VectorStoreSearchParams::RankingOptions, OpenAI::Internal::AnyHash), rewrite_query: T::Boolean, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::Page[OpenAI::Models::VectorStoreSearchResponse]) end diff --git a/rbi/openai/resources/vector_stores/file_batches.rbi b/rbi/openai/resources/vector_stores/file_batches.rbi index 8a6a5231..3ef38403 100644 --- a/rbi/openai/resources/vector_stores/file_batches.rbi +++ b/rbi/openai/resources/vector_stores/file_batches.rbi @@ -15,7 +15,7 @@ module OpenAI OpenAI::Internal::AnyHash, OpenAI::Models::StaticFileChunkingStrategyObjectParam ), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::VectorStores::VectorStoreFileBatch) end @@ -39,11 +39,7 @@ module OpenAI ); end # Retrieves a vector store file batch. sig do - params( - batch_id: String, - vector_store_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(batch_id: String, vector_store_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::VectorStores::VectorStoreFileBatch) end def retrieve( @@ -56,11 +52,7 @@ module OpenAI # Cancel a vector store file batch. This attempts to cancel the processing of # files in this batch as soon as possible. sig do - params( - batch_id: String, - vector_store_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(batch_id: String, vector_store_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::VectorStores::VectorStoreFileBatch) end def cancel( @@ -80,7 +72,7 @@ module OpenAI filter: OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter::OrSymbol, limit: Integer, order: OpenAI::Models::VectorStores::FileBatchListFilesParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::VectorStores::VectorStoreFile]) end diff --git a/rbi/openai/resources/vector_stores/files.rbi b/rbi/openai/resources/vector_stores/files.rbi index eb8c2391..e70c0adf 100644 --- a/rbi/openai/resources/vector_stores/files.rbi +++ b/rbi/openai/resources/vector_stores/files.rbi @@ -17,7 +17,7 @@ module OpenAI OpenAI::Internal::AnyHash, OpenAI::Models::StaticFileChunkingStrategyObjectParam ), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::VectorStores::VectorStoreFile) end @@ -41,11 +41,7 @@ module OpenAI ); end # Retrieves a vector store file. sig do - params( - file_id: String, - vector_store_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(file_id: String, vector_store_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::VectorStores::VectorStoreFile) end def retrieve( @@ -61,7 +57,7 @@ module OpenAI file_id: String, vector_store_id: String, attributes: T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)]), - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Models::VectorStores::VectorStoreFile) end @@ -87,7 +83,7 @@ module OpenAI filter: OpenAI::Models::VectorStores::FileListParams::Filter::OrSymbol, limit: Integer, order: OpenAI::Models::VectorStores::FileListParams::Order::OrSymbol, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) + request_options: OpenAI::RequestOpts ) .returns(OpenAI::Internal::CursorPage[OpenAI::Models::VectorStores::VectorStoreFile]) end @@ -119,11 +115,7 @@ module OpenAI # [delete file](https://platform.openai.com/docs/api-reference/files/delete) # endpoint. sig do - params( - file_id: String, - vector_store_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(file_id: String, vector_store_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Models::VectorStores::VectorStoreFileDeleted) end def delete( @@ -135,11 +127,7 @@ module OpenAI ); end # Retrieve the parsed contents of a vector store file. sig do - params( - file_id: String, - vector_store_id: String, - request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Internal::AnyHash)) - ) + params(file_id: String, vector_store_id: String, request_options: OpenAI::RequestOpts) .returns(OpenAI::Internal::Page[OpenAI::Models::VectorStores::FileContentResponse]) end def content( diff --git a/sig/openai/models/function_parameters.rbs b/sig/openai/models/function_parameters.rbs index 6dcb5bc1..9370883a 100644 --- a/sig/openai/models/function_parameters.rbs +++ b/sig/openai/models/function_parameters.rbs @@ -2,6 +2,6 @@ module OpenAI module Models type function_parameters = ::Hash[Symbol, top] - FunctionParameters: function_parameters + FunctionParameters: OpenAI::Internal::Type::Converter end end diff --git a/sig/openai/models/metadata.rbs b/sig/openai/models/metadata.rbs index 304e17b7..74e531c1 100644 --- a/sig/openai/models/metadata.rbs +++ b/sig/openai/models/metadata.rbs @@ -2,6 +2,6 @@ module OpenAI module Models type metadata = ::Hash[Symbol, String]? - Metadata: metadata + Metadata: OpenAI::Internal::Type::Converter end end diff --git a/sig/openai/models/responses/response_input.rbs b/sig/openai/models/responses/response_input.rbs index 2ca95b4d..494efa0c 100644 --- a/sig/openai/models/responses/response_input.rbs +++ b/sig/openai/models/responses/response_input.rbs @@ -4,7 +4,7 @@ module OpenAI type response_input = ::Array[OpenAI::Models::Responses::response_input_item] - ResponseInput: response_input + ResponseInput: OpenAI::Internal::Type::Converter end end end diff --git a/sig/openai/models/responses/response_input_message_content_list.rbs b/sig/openai/models/responses/response_input_message_content_list.rbs index d269f8ed..38dd2e85 100644 --- a/sig/openai/models/responses/response_input_message_content_list.rbs +++ b/sig/openai/models/responses/response_input_message_content_list.rbs @@ -4,7 +4,7 @@ module OpenAI type response_input_message_content_list = ::Array[OpenAI::Models::Responses::response_input_content] - ResponseInputMessageContentList: response_input_message_content_list + ResponseInputMessageContentList: OpenAI::Internal::Type::Converter end end end From 5c9767ed5d4204dd17bcda1b5a5b79d5e628e0e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 14:14:25 +0000 Subject: [PATCH 22/33] chore: add generator safe directory --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f93458e..97d0df78 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ This will install all the required dependencies. ## Modifying/Adding code -Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents `examples/` directory. +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/openai/helpers/` and `examples/` directory. ## Adding and running examples From 4244f8967d1583d97efa679d096eee04fd764240 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 15:14:57 +0000 Subject: [PATCH 23/33] chore: loosen rubocop rules that don't always make sense --- .rubocop.yml | 11 +++++++++++ Rakefile | 8 +++++++- test/openai/internal/type/base_model_test.rb | 2 -- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c88b94f1..315db278 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -64,11 +64,19 @@ Layout/MultilineMethodParameterLineBreaks: Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space +Lint/BooleanSymbol: + Enabled: false + # This option occasionally mangles identifier names Lint/DeprecatedConstants: Exclude: - "**/*.rbi" +# We use pattern assertion in tests to ensure correctness. +Lint/DuplicateMatchPattern: + Exclude: + - "test/**/*" + # Fairly useful in tests for pattern assertions. Lint/EmptyInPattern: Exclude: @@ -119,6 +127,9 @@ Metrics/ParameterLists: Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Enabled: false + # Need to preserve block identifier for documentation. Naming/BlockForwarding: Enabled: false diff --git a/Rakefile b/Rakefile index 2e5368f2..97b1805c 100644 --- a/Rakefile +++ b/Rakefile @@ -39,7 +39,13 @@ xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] desc("Lint `*.rb(i)`") multitask(:"lint:rubocop") do - lint = xargs + %w[rubocop --fail-level E] + (ENV.key?("CI") ? %w[--format github] : []) + rubocop = %w[rubocop --fail-level E] + rubocop += %w[--format github] if ENV.key?("CI") + + # some lines cannot be shortened + rubocop += %w[--except Lint/RedundantCopDisableDirective,Layout/LineLength] + + lint = xargs + rubocop sh("#{rubo_find.shelljoin} | #{lint.shelljoin}") end diff --git a/test/openai/internal/type/base_model_test.rb b/test/openai/internal/type/base_model_test.rb index 3f6e7420..f29a04c2 100644 --- a/test/openai/internal/type/base_model_test.rb +++ b/test/openai/internal/type/base_model_test.rb @@ -194,11 +194,9 @@ def test_coerce [E0.new(:one), "one"] => [{yes: 1}, :one], [E0.new(:two), "one"] => [{maybe: 1}, "one"], - # rubocop:disable Lint/BooleanSymbol [E1, true] => [{yes: 1}, true], [E1, false] => [{no: 1}, false], [E1, :true] => [{no: 1}, :true], - # rubocop:enable Lint/BooleanSymbol [E2, 1] => [{yes: 1}, 1], [E2, 1.0] => [{yes: 1}, 1], From 8a0bf703fc96d22831b38ddcef4aff3eb9bd301f Mon Sep 17 00:00:00 2001 From: Erik Berlin Date: Tue, 29 Apr 2025 15:15:51 -0700 Subject: [PATCH 24/33] Fix warning: JSON.fast_generate is deprecated Use JSON.generate instead. --- lib/openai/internal/util.rb | 6 +++--- test/openai/client_test.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/openai/internal/util.rb b/lib/openai/internal/util.rb index d2eb9c19..4722ccb2 100644 --- a/lib/openai/internal/util.rb +++ b/lib/openai/internal/util.rb @@ -515,7 +515,7 @@ class << self y << val.to_s else y << "Content-Type: application/json\r\n\r\n" - y << JSON.fast_generate(val) + y << JSON.generate(val) end y << "\r\n" end @@ -564,9 +564,9 @@ def encode_content(headers, body) case [content_type, body] in [%r{^application/(?:vnd\.api\+)?json}, Hash | Array | -> { primitive?(_1) }] - [headers, JSON.fast_generate(body)] + [headers, JSON.generate(body)] in [%r{^application/(?:x-)?jsonl}, Enumerable] unless body.is_a?(StringIO) || body.is_a?(IO) - [headers, body.lazy.map { JSON.fast_generate(_1) }] + [headers, body.lazy.map { JSON.generate(_1) }] in [%r{^multipart/form-data}, Hash | Pathname | StringIO | IO] boundary, strio = encode_multipart_streaming(body) headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} diff --git a/test/openai/client_test.rb b/test/openai/client_test.rb index 586ba30e..567c7840 100644 --- a/test/openai/client_test.rb +++ b/test/openai/client_test.rb @@ -37,7 +37,7 @@ class MockRequester def initialize(response_code, response_headers, response_data) @response_code = response_code @response_headers = response_headers - @response_data = JSON.fast_generate(response_data) + @response_data = JSON.generate(response_data) @attempts = [] end From 85e979631b691e5e8e278482b0fc98f7ddbbcafa Mon Sep 17 00:00:00 2001 From: Erik Berlin Date: Tue, 29 Apr 2025 16:08:57 -0700 Subject: [PATCH 25/33] Bump minimum supported Ruby version to 3.2 Ruby 3.1 is no longer supported as of March 31, 2025. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/create-releases.yml | 2 +- .github/workflows/publish-gem.yml | 2 +- .rubocop.yml | 2 +- .ruby-version | 2 +- README.md | 6 +++--- examples/advanced_streaming.rb | 4 ++-- lib/openai/internal/type/base_stream.rb | 4 ++-- openai.gemspec | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2c0c8f7..5923e599 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.1' + ruby-version: '3.2' - run: |- bundle install @@ -33,7 +33,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.1' + ruby-version: '3.2' - run: |- bundle install diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index c1ea30fa..b9e97dc6 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -29,7 +29,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.1' + ruby-version: '3.2' - run: |- bundle install diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 7502f1c2..0e942b1c 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -15,7 +15,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.1' + ruby-version: '3.2' - run: |- bundle install diff --git a/.rubocop.yml b/.rubocop.yml index c88b94f1..bb81142c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,7 +8,7 @@ AllCops: - "bin/*" NewCops: enable SuggestExtensions: false - TargetRubyVersion: 3.1.0 + TargetRubyVersion: 3.2 # Whether MFA is required or not should be left to the token configuration. Gemspec/RequireMFA: diff --git a/.ruby-version b/.ruby-version index fd2a0186..a3ec5a4b 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.0 +3.2 diff --git a/README.md b/README.md index 33a1ebe9..f1a0a15a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenAI Ruby API library -The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.1.0+ application. +The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.2+ application. ## Documentation @@ -91,7 +91,7 @@ end ### File uploads -Request parameters that correspond to file uploads can be passed as `StringIO`, or a [`Pathname`](https://rubyapi.org/3.1/o/pathname) instance. +Request parameters that correspond to file uploads can be passed as `StringIO`, or a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance. ```ruby require "pathname" @@ -271,7 +271,7 @@ This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` typ ## Requirements -Ruby 3.1.0 or higher. +Ruby 3.2 or higher. ## Contributing diff --git a/examples/advanced_streaming.rb b/examples/advanced_streaming.rb index 1d3cf073..75a656d7 100755 --- a/examples/advanced_streaming.rb +++ b/examples/advanced_streaming.rb @@ -17,7 +17,7 @@ temperature: 0.0 ) - # the `stream` itself is an `https://rubyapi.org/3.1/o/enumerable` + # the `stream` itself is an `https://rubyapi.org/3.2/o/enumerable` # which means that you can work with the stream almost as if it is an array all_choices = stream @@ -49,7 +49,7 @@ stream_of_choices = stream - # calling `#lazy` will return a deferred `https://rubyapi.org/3.1/o/enumerator/lazy` + # calling `#lazy` will return a deferred `https://rubyapi.org/3.2/o/enumerator/lazy` .lazy # each successive calls to methods that return another `enumerable` will not consume the stream # but rather, return a transformed stream. (see link above) diff --git a/lib/openai/internal/type/base_stream.rb b/lib/openai/internal/type/base_stream.rb index ebcb564c..58f90fc6 100644 --- a/lib/openai/internal/type/base_stream.rb +++ b/lib/openai/internal/type/base_stream.rb @@ -7,7 +7,7 @@ module Type # # This module provides a base implementation for streaming responses in the SDK. # - # @see https://rubyapi.org/3.1/o/enumerable + # @see https://rubyapi.org/3.2/o/enumerable module BaseStream include Enumerable @@ -22,7 +22,7 @@ class << self # # @return [Proc] # - # @see https://rubyapi.org/3.1/o/objectspace#method-c-define_finalizer + # @see https://rubyapi.org/3.2/o/objectspace#method-c-define_finalizer def defer_closing(stream) = ->(_id) { OpenAI::Internal::Util.close_fused!(stream) } end diff --git a/openai.gemspec b/openai.gemspec index 64c1b6d9..a26c3c68 100644 --- a/openai.gemspec +++ b/openai.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.metadata["homepage_uri"] = s.homepage s.metadata["source_code_uri"] = "https://github.com/openai/openai-ruby" s.metadata["rubygems_mfa_required"] = false.to_s - s.required_ruby_version = ">= 3.0.0" + s.required_ruby_version = ">= 3.2" s.files = Dir[ "lib/**/*.rb", From a6c76091c66abaf1c9bdfaaa348f9593639cadc4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:46:53 +0000 Subject: [PATCH 26/33] docs(readme): fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c092f5e..9e3e1aec 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ rescue OpenAI::Errors::APIError => e end ``` -Error codes are as followed: +Error codes are as follows: | Cause | Error Type | | ---------------- | -------------------------- | From 3be700f04d782b538fcde678016532cfbc2eb66d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:59:00 +0000 Subject: [PATCH 27/33] chore: migrate away from deprecated `JSON#fast_generate` --- Rakefile | 2 +- lib/openai/internal/util.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 97b1805c..df7a5b88 100644 --- a/Rakefile +++ b/Rakefile @@ -31,7 +31,7 @@ multitask(:test) do .map { "require_relative(#{_1.dump});" } .join - ruby(*%w[-e], rb, verbose: false) { fail unless _1 } + ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } end rubo_find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0] diff --git a/lib/openai/internal/util.rb b/lib/openai/internal/util.rb index d87a0000..0ecc6aca 100644 --- a/lib/openai/internal/util.rb +++ b/lib/openai/internal/util.rb @@ -493,7 +493,7 @@ class << self y << val.to_s else y << "Content-Type: application/json\r\n\r\n" - y << JSON.fast_generate(val) + y << JSON.generate(val) end y << "\r\n" end From c248f1522ed120fed49cb94a79a49cc8db146bf5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 15:38:43 +0000 Subject: [PATCH 28/33] chore: remove Gemfile.lock during bootstrap --- .github/workflows/ci.yml | 2 - .github/workflows/publish-gem.yml | 1 - .gitignore | 1 + .ruby-version | 2 +- Gemfile.lock | 47 ++++++++++---------- README.md | 4 +- Rakefile | 2 +- lib/openai/internal/transport/base_client.rb | 2 +- openai.gemspec | 2 +- rbi/openai/errors.rbi | 2 +- scripts/bootstrap | 1 + 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13505cd7..6026ce13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.2' - run: |- bundle install @@ -36,7 +35,6 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.2' - run: |- bundle install diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 0e942b1c..b3a5a647 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -15,7 +15,6 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: false - ruby-version: '3.2' - run: |- bundle install diff --git a/.gitignore b/.gitignore index 3d26ceed..edaa164e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ bin/tapioca Brewfile.lock.json doc/ +Gemfile.lock sorbet/tapioca/* diff --git a/.ruby-version b/.ruby-version index a3ec5a4b..944880fa 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2 +3.2.0 diff --git a/Gemfile.lock b/Gemfile.lock index 6a6143f4..e1fd6bb2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/stainless-api/syntax_tree-rbs.git - revision: 140eb3ba2ff4b959b345ac2a7927cd758a9f1284 + revision: c30b50219918be7cfe3ef803a00b59d1e77fcada branch: main specs: syntax_tree-rbs (1.0.0) @@ -17,7 +17,7 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (7.2.2.1) + activesupport (8.0.2) base64 benchmark (>= 0.3) bigdecimal @@ -29,6 +29,7 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) @@ -42,7 +43,7 @@ GEM benchmark (0.4.0) bigdecimal (3.1.9) concurrent-ruby (1.3.5) - connection_pool (2.5.0) + connection_pool (2.5.3) console (1.30.2) fiber-annotation fiber-local (~> 1.1) @@ -50,20 +51,20 @@ GEM crack (1.0.0) bigdecimal rexml - csv (3.3.3) + csv (3.3.4) drb (2.2.1) erubi (1.13.1) - ffi (1.17.1) + ffi (1.17.2-x86_64-linux-gnu) fiber-annotation (0.2.0) fiber-local (1.1.0) fiber-storage - fiber-storage (1.0.0) + fiber-storage (1.0.1) fileutils (1.7.3) hashdiff (1.1.2) i18n (1.14.7) concurrent-ruby (~> 1.0) io-event (1.10.0) - json (2.10.2) + json (2.11.3) language_server-protocol (3.17.0.4) lint_roller (1.1.0) listen (3.9.0) @@ -82,20 +83,20 @@ GEM minitest (~> 5.0) mutex_m (0.3.0) netrc (0.11.0) - parallel (1.26.3) - parser (3.3.7.4) + parallel (1.27.0) + parser (3.3.8.0) ast (~> 2.4.1) racc prettier_print (1.2.1) prism (1.4.0) - public_suffix (6.0.1) + public_suffix (6.0.2) racc (1.8.1) rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbi (0.3.1) + rbi (0.3.2) prism (~> 1.0) rbs (>= 3.4.4) sorbet-runtime (>= 0.5.9204) @@ -104,7 +105,7 @@ GEM redcarpet (3.6.1) regexp_parser (2.10.0) rexml (3.4.1) - rubocop (1.75.1) + rubocop (1.75.4) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -112,21 +113,21 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.43.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.43.0) + rubocop-ast (1.44.1) parser (>= 3.3.7.2) prism (~> 1.4) ruby-progressbar (1.13.0) securerandom (0.4.1) - sorbet (0.5.11966) - sorbet-static (= 0.5.11966) - sorbet-runtime (0.5.11966) - sorbet-static (0.5.11966-x86_64-linux) - sorbet-static-and-runtime (0.5.11966) - sorbet (= 0.5.11966) - sorbet-runtime (= 0.5.11966) + sorbet (0.5.12048) + sorbet-static (= 0.5.12048) + sorbet-runtime (0.5.12048) + sorbet-static (0.5.12048-x86_64-linux) + sorbet-static-and-runtime (0.5.12048) + sorbet (= 0.5.12048) + sorbet-runtime (= 0.5.12048) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -150,7 +151,7 @@ GEM strscan (>= 1.0.0) terminal-table (>= 2, < 5) uri (>= 0.12.0) - strscan (3.1.2) + strscan (3.1.4) syntax_tree (6.2.0) prettier_print (>= 1.2.0) tapioca (0.16.11) @@ -208,4 +209,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.3.3 + 2.4.1 diff --git a/README.md b/README.md index 9e3e1aec..ed33b344 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenAI Ruby API library -The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.2+ application. +The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.2.0+ application. ## Documentation @@ -271,7 +271,7 @@ This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` typ ## Requirements -Ruby 3.2 or higher. +Ruby 3.2.0 or higher. ## Contributing diff --git a/Rakefile b/Rakefile index df7a5b88..661da932 100644 --- a/Rakefile +++ b/Rakefile @@ -11,7 +11,7 @@ require "rubocop/rake_task" tapioca = "sorbet/tapioca" ignore_file = ".ignore" -CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file) +CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/ Gemfile.lock], *FileList["*.gem"], ignore_file) CLOBBER.push(*%w[sorbet/rbi/annotations/ sorbet/rbi/gems/], tapioca) diff --git a/lib/openai/internal/transport/base_client.rb b/lib/openai/internal/transport/base_client.rb index 5d77a764..b3bb579b 100644 --- a/lib/openai/internal/transport/base_client.rb +++ b/lib/openai/internal/transport/base_client.rb @@ -261,7 +261,7 @@ def initialize( headers["x-stainless-retry-count"] = "0" end - timeout = opts.fetch(:timeout, @timeout).to_f.clamp((0..)) + timeout = opts.fetch(:timeout, @timeout).to_f.clamp(0..) unless headers.key?("x-stainless-timeout") || timeout.zero? headers["x-stainless-timeout"] = timeout.to_s end diff --git a/openai.gemspec b/openai.gemspec index a26c3c68..cc0a7426 100644 --- a/openai.gemspec +++ b/openai.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.metadata["homepage_uri"] = s.homepage s.metadata["source_code_uri"] = "https://github.com/openai/openai-ruby" s.metadata["rubygems_mfa_required"] = false.to_s - s.required_ruby_version = ">= 3.2" + s.required_ruby_version = ">= 3.2.0" s.files = Dir[ "lib/**/*.rb", diff --git a/rbi/openai/errors.rbi b/rbi/openai/errors.rbi index 51d71f19..1eb51da4 100644 --- a/rbi/openai/errors.rbi +++ b/rbi/openai/errors.rbi @@ -164,7 +164,7 @@ module OpenAI end class InternalServerError < OpenAI::Errors::APIStatusError - HTTP_STATUS = T.let((500..), T::Range[Integer]) + HTTP_STATUS = T.let(500.., T::Range[Integer]) end end end diff --git a/scripts/bootstrap b/scripts/bootstrap index cc31aa85..9bf05537 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -13,4 +13,5 @@ fi echo "==> Installing Ruby dependencies…" +rm -fr -v -- Gemfile.lock exec -- bundle install "$@" From 2306cb447a81fd494a1a1696f99d90191103e187 Mon Sep 17 00:00:00 2001 From: dogisgreat Date: Thu, 1 May 2025 11:39:12 -0400 Subject: [PATCH 29/33] chore: remove Gemfile.lock --- Gemfile.lock | 212 --------------------------------------------------- 1 file changed, 212 deletions(-) delete mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index e1fd6bb2..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,212 +0,0 @@ -GIT - remote: https://github.com/stainless-api/syntax_tree-rbs.git - revision: c30b50219918be7cfe3ef803a00b59d1e77fcada - branch: main - specs: - syntax_tree-rbs (1.0.0) - prettier_print - rbs - syntax_tree (>= 2.0.1) - -PATH - remote: . - specs: - openai (0.1.0.pre.alpha.5) - connection_pool - -GEM - remote: https://rubygems.org/ - specs: - activesupport (8.0.2) - base64 - benchmark (>= 0.3) - bigdecimal - concurrent-ruby (~> 1.0, >= 1.3.1) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - logger (>= 1.4.2) - minitest (>= 5.1) - securerandom (>= 0.3) - tzinfo (~> 2.0, >= 2.0.5) - uri (>= 0.13.1) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - ast (2.4.3) - async (2.23.1) - console (~> 1.29) - fiber-annotation - io-event (~> 1.9) - metrics (~> 0.12) - traces (~> 0.15) - base64 (0.2.0) - benchmark (0.4.0) - bigdecimal (3.1.9) - concurrent-ruby (1.3.5) - connection_pool (2.5.3) - console (1.30.2) - fiber-annotation - fiber-local (~> 1.1) - json - crack (1.0.0) - bigdecimal - rexml - csv (3.3.4) - drb (2.2.1) - erubi (1.13.1) - ffi (1.17.2-x86_64-linux-gnu) - fiber-annotation (0.2.0) - fiber-local (1.1.0) - fiber-storage - fiber-storage (1.0.1) - fileutils (1.7.3) - hashdiff (1.1.2) - i18n (1.14.7) - concurrent-ruby (~> 1.0) - io-event (1.10.0) - json (2.11.3) - language_server-protocol (3.17.0.4) - lint_roller (1.1.0) - listen (3.9.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - logger (1.7.0) - metrics (0.12.2) - minitest (5.25.5) - minitest-focus (1.4.0) - minitest (>= 4, < 6) - minitest-hooks (1.5.2) - minitest (> 5.3) - minitest-proveit (1.0.0) - minitest (> 5, < 7) - minitest-rg (5.3.0) - minitest (~> 5.0) - mutex_m (0.3.0) - netrc (0.11.0) - parallel (1.27.0) - parser (3.3.8.0) - ast (~> 2.4.1) - racc - prettier_print (1.2.1) - prism (1.4.0) - public_suffix (6.0.2) - racc (1.8.1) - rainbow (3.1.1) - rake (13.2.1) - rb-fsevent (0.11.2) - rb-inotify (0.11.1) - ffi (~> 1.0) - rbi (0.3.2) - prism (~> 1.0) - rbs (>= 3.4.4) - sorbet-runtime (>= 0.5.9204) - rbs (3.9.2) - logger - redcarpet (3.6.1) - regexp_parser (2.10.0) - rexml (3.4.1) - rubocop (1.75.4) - json (~> 2.3) - language_server-protocol (~> 3.17.0.2) - lint_roller (~> 1.1.0) - parallel (~> 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) - parser (>= 3.3.7.2) - prism (~> 1.4) - ruby-progressbar (1.13.0) - securerandom (0.4.1) - sorbet (0.5.12048) - sorbet-static (= 0.5.12048) - sorbet-runtime (0.5.12048) - sorbet-static (0.5.12048-x86_64-linux) - sorbet-static-and-runtime (0.5.12048) - sorbet (= 0.5.12048) - sorbet-runtime (= 0.5.12048) - spoom (1.6.1) - erubi (>= 1.10.0) - prism (>= 0.28.0) - rbi (>= 0.2.3) - sorbet-static-and-runtime (>= 0.5.10187) - thor (>= 0.19.2) - steep (1.10.0) - activesupport (>= 5.1) - concurrent-ruby (>= 1.1.10) - csv (>= 3.0.9) - fileutils (>= 1.1.0) - json (>= 2.1.0) - language_server-protocol (>= 3.17.0.4, < 4.0) - listen (~> 3.0) - logger (>= 1.3.0) - mutex_m (>= 0.3.0) - parser (>= 3.1) - rainbow (>= 2.2.2, < 4.0) - rbs (~> 3.9) - securerandom (>= 0.1) - strscan (>= 1.0.0) - terminal-table (>= 2, < 5) - uri (>= 0.12.0) - strscan (3.1.4) - syntax_tree (6.2.0) - prettier_print (>= 1.2.0) - tapioca (0.16.11) - benchmark - bundler (>= 2.2.25) - netrc (>= 0.11.0) - parallel (>= 1.21.0) - rbi (~> 0.2) - sorbet-static-and-runtime (>= 0.5.11087) - spoom (>= 1.2.0) - thor (>= 1.2.0) - yard-sorbet - terminal-table (4.0.0) - unicode-display_width (>= 1.1.1, < 4) - thor (1.3.2) - traces (0.15.2) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - uri (1.0.3) - webmock (3.25.1) - addressable (>= 2.8.0) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.9.1) - yard (0.9.37) - yard-sorbet (0.9.0) - sorbet-runtime - yard - -PLATFORMS - x86_64-linux - -DEPENDENCIES - async - minitest - minitest-focus - minitest-hooks - minitest-proveit - minitest-rg - openai! - rake - rbs - redcarpet - rubocop - sorbet - steep - syntax_tree - syntax_tree-rbs! - tapioca - webmock - webrick - yard - -BUNDLED WITH - 2.4.1 From 1815c45472109efaf891e2296f37b83b2acf275d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 15:52:31 +0000 Subject: [PATCH 30/33] chore: reorganize type aliases --- lib/openai.rb | 1 + lib/openai/models/file_content.rb | 7 +++++++ rbi/openai/models/beta/threads/runs/run_step.rbi | 4 ++-- rbi/openai/models/beta/threads/runs/run_step_delta.rbi | 4 ++-- .../models/beta/threads/runs/run_step_delta_event.rbi | 4 ++-- .../beta/threads/runs/run_step_delta_message_delta.rbi | 4 ++-- rbi/openai/models/beta/threads/runs/run_step_include.rbi | 4 ++-- rbi/openai/models/chat/chat_completion.rbi | 4 ++-- .../chat/chat_completion_assistant_message_param.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_audio.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_audio_param.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_chunk.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_content_part.rbi | 4 ++-- .../models/chat/chat_completion_content_part_image.rbi | 4 ++-- .../chat/chat_completion_content_part_input_audio.rbi | 4 ++-- .../models/chat/chat_completion_content_part_refusal.rbi | 4 ++-- .../models/chat/chat_completion_content_part_text.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_deleted.rbi | 4 ++-- .../chat/chat_completion_developer_message_param.rbi | 4 ++-- .../models/chat/chat_completion_function_call_option.rbi | 4 ++-- .../models/chat/chat_completion_function_message_param.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_message.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_message_param.rbi | 4 ++-- .../models/chat/chat_completion_message_tool_call.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_modality.rbi | 4 ++-- .../models/chat/chat_completion_named_tool_choice.rbi | 4 ++-- .../models/chat/chat_completion_prediction_content.rbi | 4 ++-- .../models/chat/chat_completion_reasoning_effort.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_role.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_store_message.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_stream_options.rbi | 4 ++-- .../models/chat/chat_completion_system_message_param.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_token_logprob.rbi | 4 ++-- rbi/openai/models/chat/chat_completion_tool.rbi | 4 ++-- .../models/chat/chat_completion_tool_choice_option.rbi | 4 ++-- .../models/chat/chat_completion_tool_message_param.rbi | 4 ++-- .../models/chat/chat_completion_user_message_param.rbi | 4 ++-- rbi/openai/models/evals/eval_api_error.rbi | 4 ++-- rbi/openai/models/file_content.rbi | 7 +++++++ rbi/openai/models/fine_tuning/fine_tuning_job.rbi | 4 ++-- rbi/openai/models/fine_tuning/fine_tuning_job_event.rbi | 4 ++-- .../models/fine_tuning/fine_tuning_job_integration.rbi | 4 ++-- .../fine_tuning/fine_tuning_job_wandb_integration.rbi | 4 ++-- .../fine_tuning_job_wandb_integration_object.rbi | 4 ++-- rbi/openai/models/responses/response_item_list.rbi | 4 ++-- rbi/openai/models/uploads/upload_part.rbi | 4 ++-- rbi/openai/models/vector_stores/vector_store_file.rbi | 4 ++-- .../models/vector_stores/vector_store_file_batch.rbi | 4 ++-- .../models/vector_stores/vector_store_file_deleted.rbi | 4 ++-- sig/openai/models/file_content.rbs | 5 +++++ 50 files changed, 112 insertions(+), 92 deletions(-) create mode 100644 lib/openai/models/file_content.rb create mode 100644 rbi/openai/models/file_content.rbi create mode 100644 sig/openai/models/file_content.rbs diff --git a/lib/openai.rb b/lib/openai.rb index 0883b56f..0aadd7ca 100644 --- a/lib/openai.rb +++ b/lib/openai.rb @@ -251,6 +251,7 @@ require_relative "openai/models/eval_update_response" require_relative "openai/models/file_chunking_strategy" require_relative "openai/models/file_chunking_strategy_param" +require_relative "openai/models/file_content" require_relative "openai/models/file_content_params" require_relative "openai/models/file_create_params" require_relative "openai/models/file_deleted" diff --git a/lib/openai/models/file_content.rb b/lib/openai/models/file_content.rb new file mode 100644 index 00000000..0ffd9f84 --- /dev/null +++ b/lib/openai/models/file_content.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module OpenAI + module Models + FileContent = String + end +end diff --git a/rbi/openai/models/beta/threads/runs/run_step.rbi b/rbi/openai/models/beta/threads/runs/run_step.rbi index 0e70020b..86e8b940 100644 --- a/rbi/openai/models/beta/threads/runs/run_step.rbi +++ b/rbi/openai/models/beta/threads/runs/run_step.rbi @@ -4,6 +4,8 @@ module OpenAI module Models module Beta module Threads + RunStep = Runs::RunStep + module Runs class RunStep < OpenAI::Internal::Type::BaseModel # The identifier of the run step, which can be referenced in API endpoints. @@ -337,8 +339,6 @@ module OpenAI end end end - - RunStep = Runs::RunStep end end end diff --git a/rbi/openai/models/beta/threads/runs/run_step_delta.rbi b/rbi/openai/models/beta/threads/runs/run_step_delta.rbi index d151496b..e70a40af 100644 --- a/rbi/openai/models/beta/threads/runs/run_step_delta.rbi +++ b/rbi/openai/models/beta/threads/runs/run_step_delta.rbi @@ -4,6 +4,8 @@ module OpenAI module Models module Beta module Threads + RunStepDelta = Runs::RunStepDelta + module Runs class RunStepDelta < OpenAI::Internal::Type::BaseModel # The details of the run step. @@ -73,8 +75,6 @@ module OpenAI end end end - - RunStepDelta = Runs::RunStepDelta end end end diff --git a/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi b/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi index a9a700a4..3828467d 100644 --- a/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi +++ b/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi @@ -4,6 +4,8 @@ module OpenAI module Models module Beta module Threads + RunStepDeltaEvent = Runs::RunStepDeltaEvent + module Runs class RunStepDeltaEvent < OpenAI::Internal::Type::BaseModel # The identifier of the run step, which can be referenced in API endpoints. @@ -43,8 +45,6 @@ module OpenAI def to_hash; end end end - - RunStepDeltaEvent = Runs::RunStepDeltaEvent end end end diff --git a/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi b/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi index efe29b30..a05e1586 100644 --- a/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi +++ b/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi @@ -4,6 +4,8 @@ module OpenAI module Models module Beta module Threads + RunStepDeltaMessageDelta = Runs::RunStepDeltaMessageDelta + module Runs class RunStepDeltaMessageDelta < OpenAI::Internal::Type::BaseModel # Always `message_creation`. @@ -69,8 +71,6 @@ module OpenAI end end end - - RunStepDeltaMessageDelta = Runs::RunStepDeltaMessageDelta end end end diff --git a/rbi/openai/models/beta/threads/runs/run_step_include.rbi b/rbi/openai/models/beta/threads/runs/run_step_include.rbi index 1632e2a6..2b97eb05 100644 --- a/rbi/openai/models/beta/threads/runs/run_step_include.rbi +++ b/rbi/openai/models/beta/threads/runs/run_step_include.rbi @@ -4,6 +4,8 @@ module OpenAI module Models module Beta module Threads + RunStepInclude = Runs::RunStepInclude + module Runs module RunStepInclude extend OpenAI::Internal::Type::Enum @@ -21,8 +23,6 @@ module OpenAI def self.values; end end end - - RunStepInclude = Runs::RunStepInclude end end end diff --git a/rbi/openai/models/chat/chat_completion.rbi b/rbi/openai/models/chat/chat_completion.rbi index dbf3c910..9986624b 100644 --- a/rbi/openai/models/chat/chat_completion.rbi +++ b/rbi/openai/models/chat/chat_completion.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletion = Chat::ChatCompletion + module Chat class ChatCompletion < OpenAI::Internal::Type::BaseModel # A unique identifier for the chat completion. @@ -294,7 +296,5 @@ module OpenAI end end end - - ChatCompletion = Chat::ChatCompletion end end diff --git a/rbi/openai/models/chat/chat_completion_assistant_message_param.rbi b/rbi/openai/models/chat/chat_completion_assistant_message_param.rbi index a9321c4b..783cdfc2 100644 --- a/rbi/openai/models/chat/chat_completion_assistant_message_param.rbi +++ b/rbi/openai/models/chat/chat_completion_assistant_message_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionAssistantMessageParam = Chat::ChatCompletionAssistantMessageParam + module Chat class ChatCompletionAssistantMessageParam < OpenAI::Internal::Type::BaseModel # The role of the messages author, in this case `assistant`. @@ -242,7 +244,5 @@ module OpenAI end end end - - ChatCompletionAssistantMessageParam = Chat::ChatCompletionAssistantMessageParam end end diff --git a/rbi/openai/models/chat/chat_completion_audio.rbi b/rbi/openai/models/chat/chat_completion_audio.rbi index 3a562bd2..ce531040 100644 --- a/rbi/openai/models/chat/chat_completion_audio.rbi +++ b/rbi/openai/models/chat/chat_completion_audio.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionAudio = Chat::ChatCompletionAudio + module Chat class ChatCompletionAudio < OpenAI::Internal::Type::BaseModel # Unique identifier for this audio response. @@ -44,7 +46,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionAudio = Chat::ChatCompletionAudio end end diff --git a/rbi/openai/models/chat/chat_completion_audio_param.rbi b/rbi/openai/models/chat/chat_completion_audio_param.rbi index f8798fa0..2b135efe 100644 --- a/rbi/openai/models/chat/chat_completion_audio_param.rbi +++ b/rbi/openai/models/chat/chat_completion_audio_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionAudioParam = Chat::ChatCompletionAudioParam + module Chat class ChatCompletionAudioParam < OpenAI::Internal::Type::BaseModel # Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, @@ -87,7 +89,5 @@ module OpenAI end end end - - ChatCompletionAudioParam = Chat::ChatCompletionAudioParam end end diff --git a/rbi/openai/models/chat/chat_completion_chunk.rbi b/rbi/openai/models/chat/chat_completion_chunk.rbi index c4d28509..e5905846 100644 --- a/rbi/openai/models/chat/chat_completion_chunk.rbi +++ b/rbi/openai/models/chat/chat_completion_chunk.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionChunk = Chat::ChatCompletionChunk + module Chat class ChatCompletionChunk < OpenAI::Internal::Type::BaseModel # A unique identifier for the chat completion. Each chunk has the same ID. @@ -562,7 +564,5 @@ module OpenAI end end end - - ChatCompletionChunk = Chat::ChatCompletionChunk end end diff --git a/rbi/openai/models/chat/chat_completion_content_part.rbi b/rbi/openai/models/chat/chat_completion_content_part.rbi index d380d60e..beb80345 100644 --- a/rbi/openai/models/chat/chat_completion_content_part.rbi +++ b/rbi/openai/models/chat/chat_completion_content_part.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionContentPart = Chat::ChatCompletionContentPart + module Chat # Learn about # [text inputs](https://platform.openai.com/docs/guides/text-generation). @@ -88,7 +90,5 @@ module OpenAI def self.variants; end end end - - ChatCompletionContentPart = Chat::ChatCompletionContentPart end end diff --git a/rbi/openai/models/chat/chat_completion_content_part_image.rbi b/rbi/openai/models/chat/chat_completion_content_part_image.rbi index 8d2a8ddd..83ae49c3 100644 --- a/rbi/openai/models/chat/chat_completion_content_part_image.rbi +++ b/rbi/openai/models/chat/chat_completion_content_part_image.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionContentPartImage = Chat::ChatCompletionContentPartImage + module Chat class ChatCompletionContentPartImage < OpenAI::Internal::Type::BaseModel sig { returns(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL) } @@ -94,7 +96,5 @@ module OpenAI end end end - - ChatCompletionContentPartImage = Chat::ChatCompletionContentPartImage end end diff --git a/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi b/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi index 34e7e778..412e8c32 100644 --- a/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +++ b/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionContentPartInputAudio = Chat::ChatCompletionContentPartInputAudio + module Chat class ChatCompletionContentPartInputAudio < OpenAI::Internal::Type::BaseModel sig { returns(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio) } @@ -97,7 +99,5 @@ module OpenAI end end end - - ChatCompletionContentPartInputAudio = Chat::ChatCompletionContentPartInputAudio end end diff --git a/rbi/openai/models/chat/chat_completion_content_part_refusal.rbi b/rbi/openai/models/chat/chat_completion_content_part_refusal.rbi index 8088fdc0..4dbbaad1 100644 --- a/rbi/openai/models/chat/chat_completion_content_part_refusal.rbi +++ b/rbi/openai/models/chat/chat_completion_content_part_refusal.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionContentPartRefusal = Chat::ChatCompletionContentPartRefusal + module Chat class ChatCompletionContentPartRefusal < OpenAI::Internal::Type::BaseModel # The refusal message generated by the model. @@ -23,7 +25,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionContentPartRefusal = Chat::ChatCompletionContentPartRefusal end end diff --git a/rbi/openai/models/chat/chat_completion_content_part_text.rbi b/rbi/openai/models/chat/chat_completion_content_part_text.rbi index 8fecc89b..d9d89cc1 100644 --- a/rbi/openai/models/chat/chat_completion_content_part_text.rbi +++ b/rbi/openai/models/chat/chat_completion_content_part_text.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionContentPartText = Chat::ChatCompletionContentPartText + module Chat class ChatCompletionContentPartText < OpenAI::Internal::Type::BaseModel # The text content. @@ -25,7 +27,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionContentPartText = Chat::ChatCompletionContentPartText end end diff --git a/rbi/openai/models/chat/chat_completion_deleted.rbi b/rbi/openai/models/chat/chat_completion_deleted.rbi index e5083b94..344fb3ef 100644 --- a/rbi/openai/models/chat/chat_completion_deleted.rbi +++ b/rbi/openai/models/chat/chat_completion_deleted.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionDeleted = Chat::ChatCompletionDeleted + module Chat class ChatCompletionDeleted < OpenAI::Internal::Type::BaseModel # The ID of the chat completion that was deleted. @@ -29,7 +31,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionDeleted = Chat::ChatCompletionDeleted end end diff --git a/rbi/openai/models/chat/chat_completion_developer_message_param.rbi b/rbi/openai/models/chat/chat_completion_developer_message_param.rbi index ea4a6d05..7e1c7e21 100644 --- a/rbi/openai/models/chat/chat_completion_developer_message_param.rbi +++ b/rbi/openai/models/chat/chat_completion_developer_message_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionDeveloperMessageParam = Chat::ChatCompletionDeveloperMessageParam + module Chat class ChatCompletionDeveloperMessageParam < OpenAI::Internal::Type::BaseModel # The contents of the developer message. @@ -70,7 +72,5 @@ module OpenAI end end end - - ChatCompletionDeveloperMessageParam = Chat::ChatCompletionDeveloperMessageParam end end diff --git a/rbi/openai/models/chat/chat_completion_function_call_option.rbi b/rbi/openai/models/chat/chat_completion_function_call_option.rbi index 93220f0f..56f38623 100644 --- a/rbi/openai/models/chat/chat_completion_function_call_option.rbi +++ b/rbi/openai/models/chat/chat_completion_function_call_option.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionFunctionCallOption = Chat::ChatCompletionFunctionCallOption + module Chat class ChatCompletionFunctionCallOption < OpenAI::Internal::Type::BaseModel # The name of the function to call. @@ -19,7 +21,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionFunctionCallOption = Chat::ChatCompletionFunctionCallOption end end diff --git a/rbi/openai/models/chat/chat_completion_function_message_param.rbi b/rbi/openai/models/chat/chat_completion_function_message_param.rbi index dd32f6f7..4bfeb555 100644 --- a/rbi/openai/models/chat/chat_completion_function_message_param.rbi +++ b/rbi/openai/models/chat/chat_completion_function_message_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionFunctionMessageParam = Chat::ChatCompletionFunctionMessageParam + module Chat class ChatCompletionFunctionMessageParam < OpenAI::Internal::Type::BaseModel # The contents of the function message. @@ -29,7 +31,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionFunctionMessageParam = Chat::ChatCompletionFunctionMessageParam end end diff --git a/rbi/openai/models/chat/chat_completion_message.rbi b/rbi/openai/models/chat/chat_completion_message.rbi index dcffce2a..a1c9abf6 100644 --- a/rbi/openai/models/chat/chat_completion_message.rbi +++ b/rbi/openai/models/chat/chat_completion_message.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionMessage = Chat::ChatCompletionMessage + module Chat class ChatCompletionMessage < OpenAI::Internal::Type::BaseModel # The contents of the message. @@ -221,7 +223,5 @@ module OpenAI end end end - - ChatCompletionMessage = Chat::ChatCompletionMessage end end diff --git a/rbi/openai/models/chat/chat_completion_message_param.rbi b/rbi/openai/models/chat/chat_completion_message_param.rbi index 4c9296f5..8a340084 100644 --- a/rbi/openai/models/chat/chat_completion_message_param.rbi +++ b/rbi/openai/models/chat/chat_completion_message_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionMessageParam = Chat::ChatCompletionMessageParam + module Chat # Developer-provided instructions that the model should follow, regardless of # messages sent by the user. With o1 models and newer, `developer` messages @@ -18,7 +20,5 @@ module OpenAI def self.variants; end end end - - ChatCompletionMessageParam = Chat::ChatCompletionMessageParam end end diff --git a/rbi/openai/models/chat/chat_completion_message_tool_call.rbi b/rbi/openai/models/chat/chat_completion_message_tool_call.rbi index 77013f68..85d78135 100644 --- a/rbi/openai/models/chat/chat_completion_message_tool_call.rbi +++ b/rbi/openai/models/chat/chat_completion_message_tool_call.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionMessageToolCall = Chat::ChatCompletionMessageToolCall + module Chat class ChatCompletionMessageToolCall < OpenAI::Internal::Type::BaseModel # The ID of the tool call. @@ -76,7 +78,5 @@ module OpenAI end end end - - ChatCompletionMessageToolCall = Chat::ChatCompletionMessageToolCall end end diff --git a/rbi/openai/models/chat/chat_completion_modality.rbi b/rbi/openai/models/chat/chat_completion_modality.rbi index 0226b92f..de02e647 100644 --- a/rbi/openai/models/chat/chat_completion_modality.rbi +++ b/rbi/openai/models/chat/chat_completion_modality.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionModality = Chat::ChatCompletionModality + module Chat module ChatCompletionModality extend OpenAI::Internal::Type::Enum @@ -16,7 +18,5 @@ module OpenAI def self.values; end end end - - ChatCompletionModality = Chat::ChatCompletionModality end end diff --git a/rbi/openai/models/chat/chat_completion_named_tool_choice.rbi b/rbi/openai/models/chat/chat_completion_named_tool_choice.rbi index f7ef280e..4380546a 100644 --- a/rbi/openai/models/chat/chat_completion_named_tool_choice.rbi +++ b/rbi/openai/models/chat/chat_completion_named_tool_choice.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionNamedToolChoice = Chat::ChatCompletionNamedToolChoice + module Chat class ChatCompletionNamedToolChoice < OpenAI::Internal::Type::BaseModel sig { returns(OpenAI::Models::Chat::ChatCompletionNamedToolChoice::Function) } @@ -51,7 +53,5 @@ module OpenAI end end end - - ChatCompletionNamedToolChoice = Chat::ChatCompletionNamedToolChoice end end diff --git a/rbi/openai/models/chat/chat_completion_prediction_content.rbi b/rbi/openai/models/chat/chat_completion_prediction_content.rbi index 93fab93c..2bc5a26a 100644 --- a/rbi/openai/models/chat/chat_completion_prediction_content.rbi +++ b/rbi/openai/models/chat/chat_completion_prediction_content.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionPredictionContent = Chat::ChatCompletionPredictionContent + module Chat class ChatCompletionPredictionContent < OpenAI::Internal::Type::BaseModel # The content that should be matched when generating a model response. If @@ -61,7 +63,5 @@ module OpenAI end end end - - ChatCompletionPredictionContent = Chat::ChatCompletionPredictionContent end end diff --git a/rbi/openai/models/chat/chat_completion_reasoning_effort.rbi b/rbi/openai/models/chat/chat_completion_reasoning_effort.rbi index 479be67b..87be1185 100644 --- a/rbi/openai/models/chat/chat_completion_reasoning_effort.rbi +++ b/rbi/openai/models/chat/chat_completion_reasoning_effort.rbi @@ -2,10 +2,10 @@ module OpenAI module Models + ChatCompletionReasoningEffort = Chat::ChatCompletionReasoningEffort + module Chat ChatCompletionReasoningEffort = OpenAI::Models::ReasoningEffort end - - ChatCompletionReasoningEffort = Chat::ChatCompletionReasoningEffort end end diff --git a/rbi/openai/models/chat/chat_completion_role.rbi b/rbi/openai/models/chat/chat_completion_role.rbi index 9be9e3e1..46776b39 100644 --- a/rbi/openai/models/chat/chat_completion_role.rbi +++ b/rbi/openai/models/chat/chat_completion_role.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionRole = Chat::ChatCompletionRole + module Chat # The role of the author of a message module ChatCompletionRole @@ -21,7 +23,5 @@ module OpenAI def self.values; end end end - - ChatCompletionRole = Chat::ChatCompletionRole end end diff --git a/rbi/openai/models/chat/chat_completion_store_message.rbi b/rbi/openai/models/chat/chat_completion_store_message.rbi index 5af6dfc9..db4cc17e 100644 --- a/rbi/openai/models/chat/chat_completion_store_message.rbi +++ b/rbi/openai/models/chat/chat_completion_store_message.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionStoreMessage = Chat::ChatCompletionStoreMessage + module Chat class ChatCompletionStoreMessage < OpenAI::Models::Chat::ChatCompletionMessage # The identifier of the chat message. @@ -18,7 +20,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionStoreMessage = Chat::ChatCompletionStoreMessage end end diff --git a/rbi/openai/models/chat/chat_completion_stream_options.rbi b/rbi/openai/models/chat/chat_completion_stream_options.rbi index 08fdb738..8a28c8ab 100644 --- a/rbi/openai/models/chat/chat_completion_stream_options.rbi +++ b/rbi/openai/models/chat/chat_completion_stream_options.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionStreamOptions = Chat::ChatCompletionStreamOptions + module Chat class ChatCompletionStreamOptions < OpenAI::Internal::Type::BaseModel # If set, an additional chunk will be streamed before the `data: [DONE]` message. @@ -33,7 +35,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionStreamOptions = Chat::ChatCompletionStreamOptions end end diff --git a/rbi/openai/models/chat/chat_completion_system_message_param.rbi b/rbi/openai/models/chat/chat_completion_system_message_param.rbi index aeac775d..5578d9e7 100644 --- a/rbi/openai/models/chat/chat_completion_system_message_param.rbi +++ b/rbi/openai/models/chat/chat_completion_system_message_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionSystemMessageParam = Chat::ChatCompletionSystemMessageParam + module Chat class ChatCompletionSystemMessageParam < OpenAI::Internal::Type::BaseModel # The contents of the system message. @@ -70,7 +72,5 @@ module OpenAI end end end - - ChatCompletionSystemMessageParam = Chat::ChatCompletionSystemMessageParam end end diff --git a/rbi/openai/models/chat/chat_completion_token_logprob.rbi b/rbi/openai/models/chat/chat_completion_token_logprob.rbi index 00a79a48..f75eb74c 100644 --- a/rbi/openai/models/chat/chat_completion_token_logprob.rbi +++ b/rbi/openai/models/chat/chat_completion_token_logprob.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionTokenLogprob = Chat::ChatCompletionTokenLogprob + module Chat class ChatCompletionTokenLogprob < OpenAI::Internal::Type::BaseModel # The token. @@ -109,7 +111,5 @@ module OpenAI end end end - - ChatCompletionTokenLogprob = Chat::ChatCompletionTokenLogprob end end diff --git a/rbi/openai/models/chat/chat_completion_tool.rbi b/rbi/openai/models/chat/chat_completion_tool.rbi index 0b898367..54e45a9a 100644 --- a/rbi/openai/models/chat/chat_completion_tool.rbi +++ b/rbi/openai/models/chat/chat_completion_tool.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionTool = Chat::ChatCompletionTool + module Chat class ChatCompletionTool < OpenAI::Internal::Type::BaseModel sig { returns(OpenAI::Models::FunctionDefinition) } @@ -27,7 +29,5 @@ module OpenAI def to_hash; end end end - - ChatCompletionTool = Chat::ChatCompletionTool end end diff --git a/rbi/openai/models/chat/chat_completion_tool_choice_option.rbi b/rbi/openai/models/chat/chat_completion_tool_choice_option.rbi index fbdb6fda..090a8a1d 100644 --- a/rbi/openai/models/chat/chat_completion_tool_choice_option.rbi +++ b/rbi/openai/models/chat/chat_completion_tool_choice_option.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionToolChoiceOption = Chat::ChatCompletionToolChoiceOption + module Chat # Controls which (if any) tool is called by the model. `none` means the model will # not call any tool and instead generates a message. `auto` means the model can @@ -41,7 +43,5 @@ module OpenAI def self.variants; end end end - - ChatCompletionToolChoiceOption = Chat::ChatCompletionToolChoiceOption end end diff --git a/rbi/openai/models/chat/chat_completion_tool_message_param.rbi b/rbi/openai/models/chat/chat_completion_tool_message_param.rbi index b0ed167b..862e00bf 100644 --- a/rbi/openai/models/chat/chat_completion_tool_message_param.rbi +++ b/rbi/openai/models/chat/chat_completion_tool_message_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionToolMessageParam = Chat::ChatCompletionToolMessageParam + module Chat class ChatCompletionToolMessageParam < OpenAI::Internal::Type::BaseModel # The contents of the tool message. @@ -62,7 +64,5 @@ module OpenAI end end end - - ChatCompletionToolMessageParam = Chat::ChatCompletionToolMessageParam end end diff --git a/rbi/openai/models/chat/chat_completion_user_message_param.rbi b/rbi/openai/models/chat/chat_completion_user_message_param.rbi index 197c73d0..a9452e5c 100644 --- a/rbi/openai/models/chat/chat_completion_user_message_param.rbi +++ b/rbi/openai/models/chat/chat_completion_user_message_param.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ChatCompletionUserMessageParam = Chat::ChatCompletionUserMessageParam + module Chat class ChatCompletionUserMessageParam < OpenAI::Internal::Type::BaseModel # The contents of the user message. @@ -116,7 +118,5 @@ module OpenAI end end end - - ChatCompletionUserMessageParam = Chat::ChatCompletionUserMessageParam end end diff --git a/rbi/openai/models/evals/eval_api_error.rbi b/rbi/openai/models/evals/eval_api_error.rbi index 20859d95..906200ec 100644 --- a/rbi/openai/models/evals/eval_api_error.rbi +++ b/rbi/openai/models/evals/eval_api_error.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + EvalAPIError = Evals::EvalAPIError + module Evals class EvalAPIError < OpenAI::Internal::Type::BaseModel # The error code. @@ -24,7 +26,5 @@ module OpenAI def to_hash; end end end - - EvalAPIError = Evals::EvalAPIError end end diff --git a/rbi/openai/models/file_content.rbi b/rbi/openai/models/file_content.rbi new file mode 100644 index 00000000..92b8b41a --- /dev/null +++ b/rbi/openai/models/file_content.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module OpenAI + module Models + FileContent = String + end +end diff --git a/rbi/openai/models/fine_tuning/fine_tuning_job.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job.rbi index b9a0f929..3036f3a4 100644 --- a/rbi/openai/models/fine_tuning/fine_tuning_job.rbi +++ b/rbi/openai/models/fine_tuning/fine_tuning_job.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + FineTuningJob = FineTuning::FineTuningJob + module FineTuning class FineTuningJob < OpenAI::Internal::Type::BaseModel # The object identifier, which can be referenced in the API endpoints. @@ -697,7 +699,5 @@ module OpenAI end end end - - FineTuningJob = FineTuning::FineTuningJob end end diff --git a/rbi/openai/models/fine_tuning/fine_tuning_job_event.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_event.rbi index bae007c6..f034e524 100644 --- a/rbi/openai/models/fine_tuning/fine_tuning_job_event.rbi +++ b/rbi/openai/models/fine_tuning/fine_tuning_job_event.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + FineTuningJobEvent = FineTuning::FineTuningJobEvent + module FineTuning class FineTuningJobEvent < OpenAI::Internal::Type::BaseModel # The object identifier. @@ -113,7 +115,5 @@ module OpenAI end end end - - FineTuningJobEvent = FineTuning::FineTuningJobEvent end end diff --git a/rbi/openai/models/fine_tuning/fine_tuning_job_integration.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_integration.rbi index 8a6c1da1..9ae1ecd5 100644 --- a/rbi/openai/models/fine_tuning/fine_tuning_job_integration.rbi +++ b/rbi/openai/models/fine_tuning/fine_tuning_job_integration.rbi @@ -2,10 +2,10 @@ module OpenAI module Models + FineTuningJobIntegration = FineTuning::FineTuningJobIntegration + module FineTuning FineTuningJobIntegration = OpenAI::Models::FineTuning::FineTuningJobWandbIntegrationObject end - - FineTuningJobIntegration = FineTuning::FineTuningJobIntegration end end diff --git a/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi index f177e1fc..fb541aa4 100644 --- a/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi +++ b/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + FineTuningJobWandbIntegration = FineTuning::FineTuningJobWandbIntegration + module FineTuning class FineTuningJobWandbIntegration < OpenAI::Internal::Type::BaseModel # The name of the project that the new run will be created under. @@ -63,7 +65,5 @@ module OpenAI def to_hash; end end end - - FineTuningJobWandbIntegration = FineTuning::FineTuningJobWandbIntegration end end diff --git a/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi b/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi index 2b2e10d9..c17319c1 100644 --- a/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi +++ b/rbi/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + FineTuningJobWandbIntegrationObject = FineTuning::FineTuningJobWandbIntegrationObject + module FineTuning class FineTuningJobWandbIntegrationObject < OpenAI::Internal::Type::BaseModel # The type of the integration being enabled for the fine-tuning job @@ -41,7 +43,5 @@ module OpenAI def to_hash; end end end - - FineTuningJobWandbIntegrationObject = FineTuning::FineTuningJobWandbIntegrationObject end end diff --git a/rbi/openai/models/responses/response_item_list.rbi b/rbi/openai/models/responses/response_item_list.rbi index 60f9ee2b..d83e183d 100644 --- a/rbi/openai/models/responses/response_item_list.rbi +++ b/rbi/openai/models/responses/response_item_list.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + ResponseItemList = Responses::ResponseItemList + module Responses class ResponseItemList < OpenAI::Internal::Type::BaseModel # A list of items used to generate this response. @@ -100,7 +102,5 @@ module OpenAI def to_hash; end end end - - ResponseItemList = Responses::ResponseItemList end end diff --git a/rbi/openai/models/uploads/upload_part.rbi b/rbi/openai/models/uploads/upload_part.rbi index 17a8849b..79bf9d95 100644 --- a/rbi/openai/models/uploads/upload_part.rbi +++ b/rbi/openai/models/uploads/upload_part.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + UploadPart = Uploads::UploadPart + module Uploads class UploadPart < OpenAI::Internal::Type::BaseModel # The upload Part unique identifier, which can be referenced in API endpoints. @@ -38,7 +40,5 @@ module OpenAI def to_hash; end end end - - UploadPart = Uploads::UploadPart end end diff --git a/rbi/openai/models/vector_stores/vector_store_file.rbi b/rbi/openai/models/vector_stores/vector_store_file.rbi index 168da5d5..79686b0f 100644 --- a/rbi/openai/models/vector_stores/vector_store_file.rbi +++ b/rbi/openai/models/vector_stores/vector_store_file.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + VectorStoreFile = VectorStores::VectorStoreFile + module VectorStores class VectorStoreFile < OpenAI::Internal::Type::BaseModel # The identifier, which can be referenced in API endpoints. @@ -220,7 +222,5 @@ module OpenAI end end end - - VectorStoreFile = VectorStores::VectorStoreFile end end diff --git a/rbi/openai/models/vector_stores/vector_store_file_batch.rbi b/rbi/openai/models/vector_stores/vector_store_file_batch.rbi index 18461980..8712684e 100644 --- a/rbi/openai/models/vector_stores/vector_store_file_batch.rbi +++ b/rbi/openai/models/vector_stores/vector_store_file_batch.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + VectorStoreFileBatch = VectorStores::VectorStoreFileBatch + module VectorStores class VectorStoreFileBatch < OpenAI::Internal::Type::BaseModel # The identifier, which can be referenced in API endpoints. @@ -160,7 +162,5 @@ module OpenAI end end end - - VectorStoreFileBatch = VectorStores::VectorStoreFileBatch end end diff --git a/rbi/openai/models/vector_stores/vector_store_file_deleted.rbi b/rbi/openai/models/vector_stores/vector_store_file_deleted.rbi index 9642c9d5..769eeefd 100644 --- a/rbi/openai/models/vector_stores/vector_store_file_deleted.rbi +++ b/rbi/openai/models/vector_stores/vector_store_file_deleted.rbi @@ -2,6 +2,8 @@ module OpenAI module Models + VectorStoreFileDeleted = VectorStores::VectorStoreFileDeleted + module VectorStores class VectorStoreFileDeleted < OpenAI::Internal::Type::BaseModel sig { returns(String) } @@ -20,7 +22,5 @@ module OpenAI def to_hash; end end end - - VectorStoreFileDeleted = VectorStores::VectorStoreFileDeleted end end diff --git a/sig/openai/models/file_content.rbs b/sig/openai/models/file_content.rbs new file mode 100644 index 00000000..947667c0 --- /dev/null +++ b/sig/openai/models/file_content.rbs @@ -0,0 +1,5 @@ +module OpenAI + module Models + class FileContent = String + end +end From 8c5e78a1b2374c072c590f859008f69bd8d46d63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 18:38:45 +0000 Subject: [PATCH 31/33] chore: re-export top level models under library namespace --- lib/openai/models.rb | 193 ++++++++++++++++++++++++++++++++++++++++++ rbi/openai/models.rbi | 191 +++++++++++++++++++++++++++++++++++++++++ sig/openai/models.rbs | 189 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 573 insertions(+) create mode 100644 lib/openai/models.rb create mode 100644 rbi/openai/models.rbi create mode 100644 sig/openai/models.rbs diff --git a/lib/openai/models.rb b/lib/openai/models.rb new file mode 100644 index 00000000..2a0f2cef --- /dev/null +++ b/lib/openai/models.rb @@ -0,0 +1,193 @@ +# frozen_string_literal: true + +module OpenAI + AllModels = OpenAI::Models::AllModels + + Audio = OpenAI::Models::Audio + + AudioModel = OpenAI::Models::AudioModel + + AudioResponseFormat = OpenAI::Models::AudioResponseFormat + + AutoFileChunkingStrategyParam = OpenAI::Models::AutoFileChunkingStrategyParam + + Batch = OpenAI::Models::Batch + + BatchCancelParams = OpenAI::Models::BatchCancelParams + + BatchCreateParams = OpenAI::Models::BatchCreateParams + + BatchError = OpenAI::Models::BatchError + + BatchListParams = OpenAI::Models::BatchListParams + + BatchRequestCounts = OpenAI::Models::BatchRequestCounts + + BatchRetrieveParams = OpenAI::Models::BatchRetrieveParams + + Beta = OpenAI::Models::Beta + + Chat = OpenAI::Models::Chat + + ChatModel = OpenAI::Models::ChatModel + + ComparisonFilter = OpenAI::Models::ComparisonFilter + + Completion = OpenAI::Models::Completion + + CompletionChoice = OpenAI::Models::CompletionChoice + + CompletionCreateParams = OpenAI::Models::CompletionCreateParams + + CompletionUsage = OpenAI::Models::CompletionUsage + + CompoundFilter = OpenAI::Models::CompoundFilter + + CreateEmbeddingResponse = OpenAI::Models::CreateEmbeddingResponse + + Embedding = OpenAI::Models::Embedding + + EmbeddingCreateParams = OpenAI::Models::EmbeddingCreateParams + + EmbeddingModel = OpenAI::Models::EmbeddingModel + + ErrorObject = OpenAI::Models::ErrorObject + + EvalCreateParams = OpenAI::Models::EvalCreateParams + + EvalCustomDataSourceConfig = OpenAI::Models::EvalCustomDataSourceConfig + + EvalDeleteParams = OpenAI::Models::EvalDeleteParams + + EvalLabelModelGrader = OpenAI::Models::EvalLabelModelGrader + + EvalListParams = OpenAI::Models::EvalListParams + + EvalRetrieveParams = OpenAI::Models::EvalRetrieveParams + + Evals = OpenAI::Models::Evals + + EvalStoredCompletionsDataSourceConfig = OpenAI::Models::EvalStoredCompletionsDataSourceConfig + + EvalStringCheckGrader = OpenAI::Models::EvalStringCheckGrader + + EvalTextSimilarityGrader = OpenAI::Models::EvalTextSimilarityGrader + + EvalUpdateParams = OpenAI::Models::EvalUpdateParams + + FileChunkingStrategy = OpenAI::Models::FileChunkingStrategy + + FileChunkingStrategyParam = OpenAI::Models::FileChunkingStrategyParam + + FileContent = OpenAI::Models::FileContent + + FileContentParams = OpenAI::Models::FileContentParams + + FileCreateParams = OpenAI::Models::FileCreateParams + + FileDeleted = OpenAI::Models::FileDeleted + + FileDeleteParams = OpenAI::Models::FileDeleteParams + + FileListParams = OpenAI::Models::FileListParams + + FileObject = OpenAI::Models::FileObject + + FilePurpose = OpenAI::Models::FilePurpose + + FileRetrieveParams = OpenAI::Models::FileRetrieveParams + + FineTuning = OpenAI::Models::FineTuning + + FunctionDefinition = OpenAI::Models::FunctionDefinition + + # @type [OpenAI::Internal::Type::Converter] + FunctionParameters = OpenAI::Models::FunctionParameters + + Image = OpenAI::Models::Image + + ImageCreateVariationParams = OpenAI::Models::ImageCreateVariationParams + + ImageEditParams = OpenAI::Models::ImageEditParams + + ImageGenerateParams = OpenAI::Models::ImageGenerateParams + + ImageModel = OpenAI::Models::ImageModel + + ImagesResponse = OpenAI::Models::ImagesResponse + + # @type [OpenAI::Internal::Type::Converter] + Metadata = OpenAI::Models::Metadata + + Model = OpenAI::Models::Model + + ModelDeleted = OpenAI::Models::ModelDeleted + + ModelDeleteParams = OpenAI::Models::ModelDeleteParams + + ModelListParams = OpenAI::Models::ModelListParams + + ModelRetrieveParams = OpenAI::Models::ModelRetrieveParams + + Moderation = OpenAI::Models::Moderation + + ModerationCreateParams = OpenAI::Models::ModerationCreateParams + + ModerationImageURLInput = OpenAI::Models::ModerationImageURLInput + + ModerationModel = OpenAI::Models::ModerationModel + + ModerationMultiModalInput = OpenAI::Models::ModerationMultiModalInput + + ModerationTextInput = OpenAI::Models::ModerationTextInput + + OtherFileChunkingStrategyObject = OpenAI::Models::OtherFileChunkingStrategyObject + + Reasoning = OpenAI::Models::Reasoning + + ReasoningEffort = OpenAI::Models::ReasoningEffort + + ResponseFormatJSONObject = OpenAI::Models::ResponseFormatJSONObject + + ResponseFormatJSONSchema = OpenAI::Models::ResponseFormatJSONSchema + + ResponseFormatText = OpenAI::Models::ResponseFormatText + + Responses = OpenAI::Models::Responses + + ResponsesModel = OpenAI::Models::ResponsesModel + + StaticFileChunkingStrategy = OpenAI::Models::StaticFileChunkingStrategy + + StaticFileChunkingStrategyObject = OpenAI::Models::StaticFileChunkingStrategyObject + + StaticFileChunkingStrategyObjectParam = OpenAI::Models::StaticFileChunkingStrategyObjectParam + + Upload = OpenAI::Models::Upload + + UploadCancelParams = OpenAI::Models::UploadCancelParams + + UploadCompleteParams = OpenAI::Models::UploadCompleteParams + + UploadCreateParams = OpenAI::Models::UploadCreateParams + + Uploads = OpenAI::Models::Uploads + + VectorStore = OpenAI::Models::VectorStore + + VectorStoreCreateParams = OpenAI::Models::VectorStoreCreateParams + + VectorStoreDeleted = OpenAI::Models::VectorStoreDeleted + + VectorStoreDeleteParams = OpenAI::Models::VectorStoreDeleteParams + + VectorStoreListParams = OpenAI::Models::VectorStoreListParams + + VectorStoreRetrieveParams = OpenAI::Models::VectorStoreRetrieveParams + + VectorStores = OpenAI::Models::VectorStores + + VectorStoreSearchParams = OpenAI::Models::VectorStoreSearchParams + + VectorStoreUpdateParams = OpenAI::Models::VectorStoreUpdateParams +end diff --git a/rbi/openai/models.rbi b/rbi/openai/models.rbi new file mode 100644 index 00000000..b72b3e70 --- /dev/null +++ b/rbi/openai/models.rbi @@ -0,0 +1,191 @@ +# typed: strong + +module OpenAI + AllModels = OpenAI::Models::AllModels + + Audio = OpenAI::Models::Audio + + AudioModel = OpenAI::Models::AudioModel + + AudioResponseFormat = OpenAI::Models::AudioResponseFormat + + AutoFileChunkingStrategyParam = OpenAI::Models::AutoFileChunkingStrategyParam + + Batch = OpenAI::Models::Batch + + BatchCancelParams = OpenAI::Models::BatchCancelParams + + BatchCreateParams = OpenAI::Models::BatchCreateParams + + BatchError = OpenAI::Models::BatchError + + BatchListParams = OpenAI::Models::BatchListParams + + BatchRequestCounts = OpenAI::Models::BatchRequestCounts + + BatchRetrieveParams = OpenAI::Models::BatchRetrieveParams + + Beta = OpenAI::Models::Beta + + Chat = OpenAI::Models::Chat + + ChatModel = OpenAI::Models::ChatModel + + ComparisonFilter = OpenAI::Models::ComparisonFilter + + Completion = OpenAI::Models::Completion + + CompletionChoice = OpenAI::Models::CompletionChoice + + CompletionCreateParams = OpenAI::Models::CompletionCreateParams + + CompletionUsage = OpenAI::Models::CompletionUsage + + CompoundFilter = OpenAI::Models::CompoundFilter + + CreateEmbeddingResponse = OpenAI::Models::CreateEmbeddingResponse + + Embedding = OpenAI::Models::Embedding + + EmbeddingCreateParams = OpenAI::Models::EmbeddingCreateParams + + EmbeddingModel = OpenAI::Models::EmbeddingModel + + ErrorObject = OpenAI::Models::ErrorObject + + EvalCreateParams = OpenAI::Models::EvalCreateParams + + EvalCustomDataSourceConfig = OpenAI::Models::EvalCustomDataSourceConfig + + EvalDeleteParams = OpenAI::Models::EvalDeleteParams + + EvalLabelModelGrader = OpenAI::Models::EvalLabelModelGrader + + EvalListParams = OpenAI::Models::EvalListParams + + EvalRetrieveParams = OpenAI::Models::EvalRetrieveParams + + Evals = OpenAI::Models::Evals + + EvalStoredCompletionsDataSourceConfig = OpenAI::Models::EvalStoredCompletionsDataSourceConfig + + EvalStringCheckGrader = OpenAI::Models::EvalStringCheckGrader + + EvalTextSimilarityGrader = OpenAI::Models::EvalTextSimilarityGrader + + EvalUpdateParams = OpenAI::Models::EvalUpdateParams + + FileChunkingStrategy = OpenAI::Models::FileChunkingStrategy + + FileChunkingStrategyParam = OpenAI::Models::FileChunkingStrategyParam + + FileContent = OpenAI::Models::FileContent + + FileContentParams = OpenAI::Models::FileContentParams + + FileCreateParams = OpenAI::Models::FileCreateParams + + FileDeleted = OpenAI::Models::FileDeleted + + FileDeleteParams = OpenAI::Models::FileDeleteParams + + FileListParams = OpenAI::Models::FileListParams + + FileObject = OpenAI::Models::FileObject + + FilePurpose = OpenAI::Models::FilePurpose + + FileRetrieveParams = OpenAI::Models::FileRetrieveParams + + FineTuning = OpenAI::Models::FineTuning + + FunctionDefinition = OpenAI::Models::FunctionDefinition + + FunctionParameters = T.let(OpenAI::Models::FunctionParameters, OpenAI::Internal::Type::Converter) + + Image = OpenAI::Models::Image + + ImageCreateVariationParams = OpenAI::Models::ImageCreateVariationParams + + ImageEditParams = OpenAI::Models::ImageEditParams + + ImageGenerateParams = OpenAI::Models::ImageGenerateParams + + ImageModel = OpenAI::Models::ImageModel + + ImagesResponse = OpenAI::Models::ImagesResponse + + Metadata = T.let(OpenAI::Models::Metadata, OpenAI::Internal::Type::Converter) + + Model = OpenAI::Models::Model + + ModelDeleted = OpenAI::Models::ModelDeleted + + ModelDeleteParams = OpenAI::Models::ModelDeleteParams + + ModelListParams = OpenAI::Models::ModelListParams + + ModelRetrieveParams = OpenAI::Models::ModelRetrieveParams + + Moderation = OpenAI::Models::Moderation + + ModerationCreateParams = OpenAI::Models::ModerationCreateParams + + ModerationImageURLInput = OpenAI::Models::ModerationImageURLInput + + ModerationModel = OpenAI::Models::ModerationModel + + ModerationMultiModalInput = OpenAI::Models::ModerationMultiModalInput + + ModerationTextInput = OpenAI::Models::ModerationTextInput + + OtherFileChunkingStrategyObject = OpenAI::Models::OtherFileChunkingStrategyObject + + Reasoning = OpenAI::Models::Reasoning + + ReasoningEffort = OpenAI::Models::ReasoningEffort + + ResponseFormatJSONObject = OpenAI::Models::ResponseFormatJSONObject + + ResponseFormatJSONSchema = OpenAI::Models::ResponseFormatJSONSchema + + ResponseFormatText = OpenAI::Models::ResponseFormatText + + Responses = OpenAI::Models::Responses + + ResponsesModel = OpenAI::Models::ResponsesModel + + StaticFileChunkingStrategy = OpenAI::Models::StaticFileChunkingStrategy + + StaticFileChunkingStrategyObject = OpenAI::Models::StaticFileChunkingStrategyObject + + StaticFileChunkingStrategyObjectParam = OpenAI::Models::StaticFileChunkingStrategyObjectParam + + Upload = OpenAI::Models::Upload + + UploadCancelParams = OpenAI::Models::UploadCancelParams + + UploadCompleteParams = OpenAI::Models::UploadCompleteParams + + UploadCreateParams = OpenAI::Models::UploadCreateParams + + Uploads = OpenAI::Models::Uploads + + VectorStore = OpenAI::Models::VectorStore + + VectorStoreCreateParams = OpenAI::Models::VectorStoreCreateParams + + VectorStoreDeleted = OpenAI::Models::VectorStoreDeleted + + VectorStoreDeleteParams = OpenAI::Models::VectorStoreDeleteParams + + VectorStoreListParams = OpenAI::Models::VectorStoreListParams + + VectorStoreRetrieveParams = OpenAI::Models::VectorStoreRetrieveParams + + VectorStores = OpenAI::Models::VectorStores + + VectorStoreSearchParams = OpenAI::Models::VectorStoreSearchParams + + VectorStoreUpdateParams = OpenAI::Models::VectorStoreUpdateParams +end diff --git a/sig/openai/models.rbs b/sig/openai/models.rbs new file mode 100644 index 00000000..7802cabe --- /dev/null +++ b/sig/openai/models.rbs @@ -0,0 +1,189 @@ +module OpenAI + module AllModels = OpenAI::Models::AllModels + + module Audio = OpenAI::Models::Audio + + module AudioModel = OpenAI::Models::AudioModel + + module AudioResponseFormat = OpenAI::Models::AudioResponseFormat + + class AutoFileChunkingStrategyParam = OpenAI::Models::AutoFileChunkingStrategyParam + + class Batch = OpenAI::Models::Batch + + class BatchCancelParams = OpenAI::Models::BatchCancelParams + + class BatchCreateParams = OpenAI::Models::BatchCreateParams + + class BatchError = OpenAI::Models::BatchError + + class BatchListParams = OpenAI::Models::BatchListParams + + class BatchRequestCounts = OpenAI::Models::BatchRequestCounts + + class BatchRetrieveParams = OpenAI::Models::BatchRetrieveParams + + module Beta = OpenAI::Models::Beta + + module Chat = OpenAI::Models::Chat + + module ChatModel = OpenAI::Models::ChatModel + + class ComparisonFilter = OpenAI::Models::ComparisonFilter + + class Completion = OpenAI::Models::Completion + + class CompletionChoice = OpenAI::Models::CompletionChoice + + class CompletionCreateParams = OpenAI::Models::CompletionCreateParams + + class CompletionUsage = OpenAI::Models::CompletionUsage + + class CompoundFilter = OpenAI::Models::CompoundFilter + + class CreateEmbeddingResponse = OpenAI::Models::CreateEmbeddingResponse + + class Embedding = OpenAI::Models::Embedding + + class EmbeddingCreateParams = OpenAI::Models::EmbeddingCreateParams + + module EmbeddingModel = OpenAI::Models::EmbeddingModel + + class ErrorObject = OpenAI::Models::ErrorObject + + class EvalCreateParams = OpenAI::Models::EvalCreateParams + + class EvalCustomDataSourceConfig = OpenAI::Models::EvalCustomDataSourceConfig + + class EvalDeleteParams = OpenAI::Models::EvalDeleteParams + + class EvalLabelModelGrader = OpenAI::Models::EvalLabelModelGrader + + class EvalListParams = OpenAI::Models::EvalListParams + + class EvalRetrieveParams = OpenAI::Models::EvalRetrieveParams + + module Evals = OpenAI::Models::Evals + + class EvalStoredCompletionsDataSourceConfig = OpenAI::Models::EvalStoredCompletionsDataSourceConfig + + class EvalStringCheckGrader = OpenAI::Models::EvalStringCheckGrader + + class EvalTextSimilarityGrader = OpenAI::Models::EvalTextSimilarityGrader + + class EvalUpdateParams = OpenAI::Models::EvalUpdateParams + + module FileChunkingStrategy = OpenAI::Models::FileChunkingStrategy + + module FileChunkingStrategyParam = OpenAI::Models::FileChunkingStrategyParam + + class FileContent = OpenAI::Models::FileContent + + class FileContentParams = OpenAI::Models::FileContentParams + + class FileCreateParams = OpenAI::Models::FileCreateParams + + class FileDeleted = OpenAI::Models::FileDeleted + + class FileDeleteParams = OpenAI::Models::FileDeleteParams + + class FileListParams = OpenAI::Models::FileListParams + + class FileObject = OpenAI::Models::FileObject + + module FilePurpose = OpenAI::Models::FilePurpose + + class FileRetrieveParams = OpenAI::Models::FileRetrieveParams + + module FineTuning = OpenAI::Models::FineTuning + + class FunctionDefinition = OpenAI::Models::FunctionDefinition + + FunctionParameters: OpenAI::Internal::Type::Converter + + class Image = OpenAI::Models::Image + + class ImageCreateVariationParams = OpenAI::Models::ImageCreateVariationParams + + class ImageEditParams = OpenAI::Models::ImageEditParams + + class ImageGenerateParams = OpenAI::Models::ImageGenerateParams + + module ImageModel = OpenAI::Models::ImageModel + + class ImagesResponse = OpenAI::Models::ImagesResponse + + Metadata: OpenAI::Internal::Type::Converter + + class Model = OpenAI::Models::Model + + class ModelDeleted = OpenAI::Models::ModelDeleted + + class ModelDeleteParams = OpenAI::Models::ModelDeleteParams + + class ModelListParams = OpenAI::Models::ModelListParams + + class ModelRetrieveParams = OpenAI::Models::ModelRetrieveParams + + class Moderation = OpenAI::Models::Moderation + + class ModerationCreateParams = OpenAI::Models::ModerationCreateParams + + class ModerationImageURLInput = OpenAI::Models::ModerationImageURLInput + + module ModerationModel = OpenAI::Models::ModerationModel + + module ModerationMultiModalInput = OpenAI::Models::ModerationMultiModalInput + + class ModerationTextInput = OpenAI::Models::ModerationTextInput + + class OtherFileChunkingStrategyObject = OpenAI::Models::OtherFileChunkingStrategyObject + + class Reasoning = OpenAI::Models::Reasoning + + module ReasoningEffort = OpenAI::Models::ReasoningEffort + + class ResponseFormatJSONObject = OpenAI::Models::ResponseFormatJSONObject + + class ResponseFormatJSONSchema = OpenAI::Models::ResponseFormatJSONSchema + + class ResponseFormatText = OpenAI::Models::ResponseFormatText + + module Responses = OpenAI::Models::Responses + + module ResponsesModel = OpenAI::Models::ResponsesModel + + class StaticFileChunkingStrategy = OpenAI::Models::StaticFileChunkingStrategy + + class StaticFileChunkingStrategyObject = OpenAI::Models::StaticFileChunkingStrategyObject + + class StaticFileChunkingStrategyObjectParam = OpenAI::Models::StaticFileChunkingStrategyObjectParam + + class Upload = OpenAI::Models::Upload + + class UploadCancelParams = OpenAI::Models::UploadCancelParams + + class UploadCompleteParams = OpenAI::Models::UploadCompleteParams + + class UploadCreateParams = OpenAI::Models::UploadCreateParams + + module Uploads = OpenAI::Models::Uploads + + class VectorStore = OpenAI::Models::VectorStore + + class VectorStoreCreateParams = OpenAI::Models::VectorStoreCreateParams + + class VectorStoreDeleted = OpenAI::Models::VectorStoreDeleted + + class VectorStoreDeleteParams = OpenAI::Models::VectorStoreDeleteParams + + class VectorStoreListParams = OpenAI::Models::VectorStoreListParams + + class VectorStoreRetrieveParams = OpenAI::Models::VectorStoreRetrieveParams + + module VectorStores = OpenAI::Models::VectorStores + + class VectorStoreSearchParams = OpenAI::Models::VectorStoreSearchParams + + class VectorStoreUpdateParams = OpenAI::Models::VectorStoreUpdateParams +end From 8e8464e2b6d9dc814c68f0e20268a2eafba37361 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 21:45:07 +0000 Subject: [PATCH 32/33] chore: always check if current page is empty in `next_page?` --- lib/openai/internal/cursor_page.rb | 4 ++-- lib/openai/internal/page.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/openai/internal/cursor_page.rb b/lib/openai/internal/cursor_page.rb index 3cb0654b..5f68a217 100644 --- a/lib/openai/internal/cursor_page.rb +++ b/lib/openai/internal/cursor_page.rb @@ -66,8 +66,8 @@ def initialize(client:, req:, headers:, page_data:) super case page_data - in {data: Array | nil => data} - @data = data&.map { OpenAI::Internal::Type::Converter.coerce(@model, _1) } + in {data: Array => data} + @data = data.map { OpenAI::Internal::Type::Converter.coerce(@model, _1) } else end @has_more = page_data[:has_more] diff --git a/lib/openai/internal/page.rb b/lib/openai/internal/page.rb index f3792c4c..36c350a4 100644 --- a/lib/openai/internal/page.rb +++ b/lib/openai/internal/page.rb @@ -60,8 +60,8 @@ def initialize(client:, req:, headers:, page_data:) super case page_data - in {data: Array | nil => data} - @data = data&.map { OpenAI::Internal::Type::Converter.coerce(@model, _1) } + in {data: Array => data} + @data = data.map { OpenAI::Internal::Type::Converter.coerce(@model, _1) } else end @object = page_data[:object] From 4b1544c67db6b910b2f6ffb4a84a425a71e3eb33 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 21:45:37 +0000 Subject: [PATCH 33/33] release: 0.1.0-alpha.6 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 49 +++++++++++++++++++++++++++++++++++ lib/openai/version.rb | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e8285b71..4f9005ea 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.5" + ".": "0.1.0-alpha.6" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c505717e..e8dd761a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## 0.1.0-alpha.6 (2025-05-01) + +Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/openai/openai-ruby/compare/v0.1.0-alpha.5...v0.1.0-alpha.6) + +### Features + +* **api:** adding new image model support ([641f4eb](https://github.com/openai/openai-ruby/commit/641f4eb0fadf75909a32dc48644bf0e220fbbe81)) +* support specifying content-type with FilePart class ([ece942c](https://github.com/openai/openai-ruby/commit/ece942cb2c7982ed73e20321318a0f8634c22023)) +* support webmock for testing ([9e1a0f1](https://github.com/openai/openai-ruby/commit/9e1a0f1db37f0778063c2a417a55ac04fee1f1b2)) + + +### Bug Fixes + +* ensure gem release is unaffected by renaming ([513acd8](https://github.com/openai/openai-ruby/commit/513acd850f86110f1820a97468f50baf3a3ae0b3)) +* fix workflow syntax ([b5d45ce](https://github.com/openai/openai-ruby/commit/b5d45ce80ebfc7811446c134a1925fb0731f7971)) +* JSON.fast_generate is deprecated ([591fdf0](https://github.com/openai/openai-ruby/commit/591fdf0174765fce77b857b02006efd5b37fe073)) +* make a typo for `FilePart.content` ([c78ea0f](https://github.com/openai/openai-ruby/commit/c78ea0fad674def58c3d15eec516a18149777d09)) + + +### Chores + +* add generator safe directory ([5c9767e](https://github.com/openai/openai-ruby/commit/5c9767ed5d4204dd17bcda1b5a5b79d5e628e0e1)) +* always check if current page is empty in `next_page?` ([8e8464e](https://github.com/openai/openai-ruby/commit/8e8464e2b6d9dc814c68f0e20268a2eafba37361)) +* broadly detect json family of content-type headers ([77f7239](https://github.com/openai/openai-ruby/commit/77f7239e03a45323f70baee9d1430ecec242705c)) +* bump minimum supported Ruby version to 3.2 ([41ce053](https://github.com/openai/openai-ruby/commit/41ce0535c5f7a7304c744d5e7b43a728d360c54f)) +* **ci:** add timeout thresholds for CI jobs ([6fba7b2](https://github.com/openai/openai-ruby/commit/6fba7b2a1d4043b3ee41f49da43a50c305d613d3)) +* **ci:** only use depot for staging repos ([57a10b0](https://github.com/openai/openai-ruby/commit/57a10b07135a824e8eee35e57a1d78f223befef9)) +* **ci:** run on more branches and use depot runners ([0ae14a8](https://github.com/openai/openai-ruby/commit/0ae14a87ecc37f73077f0aaa442047452a6503b6)) +* consistently use string in examples, even for enums ([cec4b05](https://github.com/openai/openai-ruby/commit/cec4b051bb0f4357032779cde2c11babe4196fcd)) +* explicitly mark apis public under `Internal` module ([ca0d841](https://github.com/openai/openai-ruby/commit/ca0d841a571433528ae15974041c5ea142f9109e)) +* **internal:** annotate request options with type aliases in sorbet ([4918836](https://github.com/openai/openai-ruby/commit/4918836aac697a899b19e4c3767126d0d86914d4)) +* **internal:** improve response envelope unwrap functionality ([a05d2c5](https://github.com/openai/openai-ruby/commit/a05d2c5d16ce052c1fb84005739e6b6d853f5e8e)) +* **internal:** minor type annotation improvements ([67b0e35](https://github.com/openai/openai-ruby/commit/67b0e35c2c8d48c50c71c20a71304896a63f6b44)) +* **internal:** remove unnecessary `rbi/lib` folder ([df9e099](https://github.com/openai/openai-ruby/commit/df9e0991a3aac2a5a480bfb3cf622139ca1b1373)) +* **internal:** version bump ([ef2a5d4](https://github.com/openai/openai-ruby/commit/ef2a5d46f21a0df6b4b6ebc4e9d4dd4f6a6a6e5f)) +* loosen rubocop rules that don't always make sense ([4244f89](https://github.com/openai/openai-ruby/commit/4244f8967d1583d97efa679d096eee04fd764240)) +* migrate away from deprecated `JSON#fast_generate` ([3be700f](https://github.com/openai/openai-ruby/commit/3be700f04d782b538fcde678016532cfbc2eb66d)) +* more accurate type annotations and aliases ([04b111d](https://github.com/openai/openai-ruby/commit/04b111dcdc2c5d458159be87a180174243a9d058)) +* re-export top level models under library namespace ([8c5e78a](https://github.com/openai/openai-ruby/commit/8c5e78a1b2374c072c590f859008f69bd8d46d63)) +* remove Gemfile.lock ([2306cb4](https://github.com/openai/openai-ruby/commit/2306cb447a81fd494a1a1696f99d90191103e187)) +* remove Gemfile.lock during bootstrap ([c248f15](https://github.com/openai/openai-ruby/commit/c248f1522ed120fed49cb94a79a49cc8db146bf5)) +* reorganize type aliases ([1815c45](https://github.com/openai/openai-ruby/commit/1815c45472109efaf891e2296f37b83b2acf275d)) +* show truncated parameter docs in yard ([bf84473](https://github.com/openai/openai-ruby/commit/bf844738622cd1c9a5c31bffc1e5378c132c31fd)) + + +### Documentation + +* **readme:** fix typo ([a6c7609](https://github.com/openai/openai-ruby/commit/a6c76091c66abaf1c9bdfaaa348f9593639cadc4)) + ## 0.1.0-alpha.5 (2025-04-18) Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/openai/openai-ruby/compare/v0.1.0-alpha.4...v0.1.0-alpha.5) diff --git a/lib/openai/version.rb b/lib/openai/version.rb index c92a3443..b37ab573 100644 --- a/lib/openai/version.rb +++ b/lib/openai/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OpenAI - VERSION = "0.1.0.pre.alpha.5" + VERSION = "0.1.0.pre.alpha.6" end