Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ Layout/MultilineMethodParameterLineBreaks:
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

# This option occasionally mangles identifier names
Lint/DeprecatedConstants:
Exclude:
- "**/*.rbi"

# Fairly useful in tests for pattern assertions.
Lint/EmptyInPattern:
Exclude:
Expand Down
2 changes: 0 additions & 2 deletions lib/openai/base_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module OpenAI
# @api private
#
# @abstract
module Converter
# rubocop:disable Lint/UnusedMethodArgument

Expand Down
2 changes: 0 additions & 2 deletions lib/openai/base_page.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

module OpenAI
# @abstract
#
# @example
# ```ruby
# if page.has_next?
Expand Down
2 changes: 0 additions & 2 deletions lib/openai/extern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module OpenAI
# @api private
#
# @abstract
module Extern
end
end
2 changes: 0 additions & 2 deletions lib/openai/request_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module OpenAI
# @api private
#
# @abstract
module RequestParameters
# @!parse
# # Options to specify HTTP behaviour for this request.
Expand Down
1 change: 1 addition & 0 deletions rbi/lib/openai/base_client.rbi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# typed: strong

module OpenAI
# @api private
class BaseClient
abstract!

Expand Down
13 changes: 11 additions & 2 deletions rbi/lib/openai/base_model.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
module OpenAI
# @api private
module Converter
abstract!

Input = T.type_alias { T.any(OpenAI::Converter, T::Class[T.anything]) }

# @api private
Expand Down Expand Up @@ -78,6 +76,8 @@ module OpenAI
end
end

# @api private
#
# When we don't know what to expect for the value.
class Unknown
extend OpenAI::Converter
Expand Down Expand Up @@ -115,6 +115,8 @@ module OpenAI
end
end

# @api private
#
# Ruby has no Boolean class; this is something for models to refer to.
class BooleanModel
extend OpenAI::Converter
Expand Down Expand Up @@ -156,6 +158,8 @@ module OpenAI
end
end

# @api private
#
# A value from among a specified list of options. OpenAPI enum values map to Ruby
# values in the SDK as follows:
#
Expand Down Expand Up @@ -217,6 +221,7 @@ module OpenAI
end
end

# @api private
class Union
extend OpenAI::Converter

Expand Down Expand Up @@ -294,6 +299,8 @@ module OpenAI
end
end

# @api private
#
# Array of items of a given type.
class ArrayOf
include OpenAI::Converter
Expand Down Expand Up @@ -359,6 +366,8 @@ module OpenAI
end
end

# @api private
#
# Hash of items of a given type.
class HashOf
include OpenAI::Converter
Expand Down
2 changes: 0 additions & 2 deletions rbi/lib/openai/base_page.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module OpenAI
module BasePage
abstract!

Elem = type_member(:out)

sig { overridable.returns(T::Boolean) }
Expand Down
1 change: 0 additions & 1 deletion rbi/lib/openai/extern.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
module OpenAI
# @api private
module Extern
abstract!
end
end
1 change: 1 addition & 0 deletions rbi/lib/openai/pooled_net_requester.rbi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# typed: strong

module OpenAI
# @api private
class PooledNetRequester
RequestShape = T.type_alias do
{method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float}
Expand Down
2 changes: 0 additions & 2 deletions rbi/lib/openai/request_options.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
module OpenAI
# @api private
module RequestParameters
abstract!

# Options to specify HTTP behaviour for this request.
sig { returns(T.any(OpenAI::RequestOptions, T::Hash[Symbol, T.anything])) }
def request_options
Expand Down
2 changes: 2 additions & 0 deletions rbi/lib/openai/util.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ module OpenAI
end
end

# @api private
#
# An adapter that satisfies the IO interface required by `::IO.copy_stream`
class ReadIOAdapter
# @api private
Expand Down