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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions rbi/lib/openai/client.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ module OpenAI

# @api private
sig { override.returns(T::Hash[String, String]) }
private def auth_headers
end
private def auth_headers; end

# Creates and returns a new client for interacting with the API.
sig do
Expand Down Expand Up @@ -94,7 +93,6 @@ module OpenAI
timeout: DEFAULT_TIMEOUT_IN_SECONDS,
initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY,
max_retry_delay: DEFAULT_MAX_RETRY_DELAY
)
end
); end
end
end
9 changes: 3 additions & 6 deletions rbi/lib/openai/errors.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ module OpenAI
)
.returns(T.attached_class)
end
def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
end
def self.new(url:, status: nil, body: nil, request: nil, response: nil, message: nil); end
end

class APIConnectionError < OpenAI::Errors::APIError
Expand Down Expand Up @@ -107,8 +106,7 @@ module OpenAI
)
.returns(T.attached_class)
end
def self.for(url:, status:, body:, request:, response:, message: nil)
end
def self.for(url:, status:, body:, request:, response:, message: nil); end

sig { returns(Integer) }
attr_accessor :status
Expand All @@ -134,8 +132,7 @@ module OpenAI
)
.returns(T.attached_class)
end
def self.new(url:, status:, body:, request:, response:, message: nil)
end
def self.new(url:, status:, body:, request:, response:, message: nil); end
end

class BadRequestError < OpenAI::Errors::APIStatusError
Expand Down
3 changes: 1 addition & 2 deletions rbi/lib/openai/internal/cursor_page.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module OpenAI
attr_accessor :has_more

sig { returns(String) }
def inspect
end
def inspect; end
end
end
end
3 changes: 1 addition & 2 deletions rbi/lib/openai/internal/page.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module OpenAI
attr_accessor :object

sig { returns(String) }
def inspect
end
def inspect; end
end
end
end
3 changes: 1 addition & 2 deletions rbi/lib/openai/internal/stream.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ module OpenAI

# @api private
sig { override.returns(T::Enumerable[Elem]) }
private def iterator
end
private def iterator; end
end
end
end
38 changes: 12 additions & 26 deletions rbi/lib/openai/internal/transport/base_client.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ module OpenAI
class << self
# @api private
sig { params(req: OpenAI::Internal::Transport::BaseClient::RequestComponentsShape).void }
def validate!(req)
end
def validate!(req); end

# @api private
sig do
Expand All @@ -68,8 +67,7 @@ module OpenAI
)
).returns(T::Boolean)
end
def should_retry?(status, headers:)
end
def should_retry?(status, headers:); end

# @api private
sig do
Expand All @@ -80,8 +78,7 @@ module OpenAI
)
.returns(OpenAI::Internal::Transport::BaseClient::RequestInputShape)
end
def follow_redirect(request, status:, response_headers:)
end
def follow_redirect(request, status:, response_headers:); end

# @api private
sig do
Expand All @@ -91,8 +88,7 @@ module OpenAI
)
.void
end
def reap_connection!(status, stream:)
end
def reap_connection!(status, stream:); end
end

# @api private
Expand Down Expand Up @@ -121,18 +117,14 @@ module OpenAI
max_retry_delay: 0.0,
headers: {},
idempotency_header: nil
)
end

); end
# @api private
sig { overridable.returns(T::Hash[String, String]) }
private def auth_headers
end
private def auth_headers; end

# @api private
sig { returns(String) }
private def generate_idempotency_key
end
private def generate_idempotency_key; end

# @api private
sig do
Expand All @@ -143,13 +135,11 @@ module OpenAI
)
.returns(OpenAI::Internal::Transport::BaseClient::RequestInputShape)
end
private def build_request(req, opts)
end
private def build_request(req, opts); end

# @api private
sig { params(headers: T::Hash[String, String], retry_count: Integer).returns(Float) }
private def retry_delay(headers, retry_count:)
end
private def retry_delay(headers, retry_count:); end

# @api private
sig do
Expand All @@ -161,8 +151,7 @@ module OpenAI
)
.returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
end
private def send_request(request, redirect_count:, retry_count:, send_retry_header:)
end
private def send_request(request, redirect_count:, retry_count:, send_retry_header:); end

# Execute the request specified by `req`. This is the method that all resource
# methods call into.
Expand Down Expand Up @@ -206,12 +195,9 @@ module OpenAI
stream: nil,
model: OpenAI::Internal::Type::Unknown,
options: {}
)
end

); end
sig { returns(String) }
def inspect
end
def inspect; end
end
end
end
Expand Down
18 changes: 6 additions & 12 deletions rbi/lib/openai/internal/transport/pooled_net_requester.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ module OpenAI
class << self
# @api private
sig { params(url: URI::Generic).returns(Net::HTTP) }
def connect(url)
end
def connect(url); end

# @api private
sig { params(conn: Net::HTTP, deadline: Float).void }
def calibrate_socket_timeout(conn, deadline)
end
def calibrate_socket_timeout(conn, deadline); end

# @api private
sig do
Expand All @@ -39,27 +37,23 @@ module OpenAI
)
.returns(Net::HTTPGenericRequest)
end
def build_request(request, &blk)
end
def build_request(request, &blk); end
end

# @api private
sig { params(url: URI::Generic, deadline: Float, blk: T.proc.params(arg0: Net::HTTP).void).void }
private def with_pool(url, deadline:, &blk)
end
private def with_pool(url, deadline:, &blk); end

# @api private
sig do
params(request: OpenAI::Internal::Transport::PooledNetRequester::RequestShape)
.returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
end
def execute(request)
end
def execute(request); end

# @api private
sig { params(size: Integer).returns(T.attached_class) }
def self.new(size: Etc.nprocessors)
end
def self.new(size: Etc.nprocessors); end
end
end
end
Expand Down
24 changes: 8 additions & 16 deletions rbi/lib/openai/internal/type/array_of.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ module OpenAI
)
.returns(T.attached_class)
end
def self.[](type_info, spec = {})
end
def self.[](type_info, spec = {}); end

sig(:final) { params(other: T.anything).returns(T::Boolean) }
def ===(other)
end
def ===(other); end

sig(:final) { params(other: T.anything).returns(T::Boolean) }
def ==(other)
end
def ==(other); end

# @api private
sig(:final) do
Expand All @@ -46,27 +43,23 @@ module OpenAI
state: OpenAI::Internal::Type::Converter::State)
.returns(T.any(T::Array[T.anything], T.anything))
end
def coerce(value, state:)
end
def coerce(value, state:); end

# @api private
sig(:final) do
override
.params(value: T.any(T::Array[T.anything], T.anything))
.returns(T.any(T::Array[T.anything], T.anything))
end
def dump(value)
end
def dump(value); end

# @api private
sig(:final) { returns(Elem) }
protected def item_type
end
protected def item_type; end

# @api private
sig(:final) { returns(T::Boolean) }
protected def nilable?
end
protected def nilable?; end

# @api private
sig(:final) do
Expand All @@ -80,8 +73,7 @@ module OpenAI
)
.void
end
def initialize(type_info, spec = {})
end
def initialize(type_info, spec = {}); end
end
end
end
Expand Down
Loading