Skip to content

release: 0.1.0-beta.1 #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
64a2a6e
Update create-releases.yml
meorphis Apr 19, 2025
2653f09
Update create-releases.yml
meorphis Apr 19, 2025
e9ce032
Update create-releases.yml
meorphis Apr 19, 2025
b5d45ce
fix: fix workflow syntax
meorphis Apr 19, 2025
ef2a5d4
chore(internal): version bump
stainless-app[bot] Apr 21, 2025
ca0d841
chore: explicitly mark apis public under `Internal` module
stainless-app[bot] Apr 19, 2025
67b0e35
chore(internal): minor type annotation improvements
stainless-app[bot] Apr 21, 2025
6fba7b2
chore(ci): add timeout thresholds for CI jobs
stainless-app[bot] Apr 22, 2025
641f4eb
feat(api): adding new image model support
stainless-app[bot] Apr 23, 2025
0ae14a8
chore(ci): run on more branches and use depot runners
stainless-app[bot] Apr 23, 2025
57a10b0
chore(ci): only use depot for staging repos
stainless-app[bot] Apr 23, 2025
77f7239
chore: broadly detect json family of content-type headers
stainless-app[bot] Apr 23, 2025
9e1a0f1
feat: support webmock for testing
stainless-app[bot] Apr 24, 2025
bf84473
chore: show truncated parameter docs in yard
stainless-app[bot] Apr 24, 2025
ece942c
feat: support specifying content-type with FilePart class
stainless-app[bot] Apr 24, 2025
cec4b05
chore: consistently use string in examples, even for enums
stainless-app[bot] Apr 24, 2025
a05d2c5
chore(internal): improve response envelope unwrap functionality
stainless-app[bot] Apr 24, 2025
513acd8
fix: ensure gem release is unaffected by renaming
stainless-app[bot] Apr 25, 2025
c78ea0f
fix: make a typo for `FilePart.content`
stainless-app[bot] Apr 25, 2025
df9e099
chore(internal): remove unnecessary `rbi/lib` folder
stainless-app[bot] Apr 26, 2025
04b111d
chore: more accurate type annotations and aliases
stainless-app[bot] Apr 26, 2025
4918836
chore(internal): annotate request options with type aliases in sorbet
stainless-app[bot] Apr 26, 2025
5c9767e
chore: add generator safe directory
stainless-app[bot] Apr 28, 2025
4244f89
chore: loosen rubocop rules that don't always make sense
stainless-app[bot] Apr 29, 2025
8a0bf70
Fix warning: JSON.fast_generate is deprecated
sferik Apr 29, 2025
85e9796
Bump minimum supported Ruby version to 3.2
sferik Apr 29, 2025
67c9304
Merge branch 'next' into ruby-3.2
ms-jpq Apr 30, 2025
41ce053
chore: bump minimum supported Ruby version to 3.2
ms-jpq Apr 30, 2025
0d8300b
Merge branch 'next' into fix_warnings
ms-jpq Apr 30, 2025
591fdf0
fix: JSON.fast_generate is deprecated
ms-jpq Apr 30, 2025
a6c7609
docs(readme): fix typo
stainless-app[bot] Apr 30, 2025
3be700f
chore: migrate away from deprecated `JSON#fast_generate`
stainless-app[bot] Apr 30, 2025
c248f15
chore: remove Gemfile.lock during bootstrap
stainless-app[bot] May 1, 2025
2306cb4
chore: remove Gemfile.lock
ms-jpq May 1, 2025
1815c45
chore: reorganize type aliases
stainless-app[bot] May 1, 2025
8c5e78a
chore: re-export top level models under library namespace
stainless-app[bot] May 1, 2025
8e8464e
chore: always check if current page is empty in `next_page?`
stainless-app[bot] May 1, 2025
c5b4f52
chore: validate request option coercion correctness
stainless-app[bot] May 1, 2025
7720dca
chore: ensure examples have busybox compat shebangs
ms-jpq May 1, 2025
d64d928
Remove unnecessary require statement
sferik May 2, 2025
a613a39
feat: initial structured outputs support (#565)
ms-jpq May 2, 2025
f3fc915
chore(internal): codegen related update
stainless-app[bot] May 6, 2025
c4565ed
feat(api): add image sizes, reasoning encryption
stainless-app[bot] May 2, 2025
7d8ee4f
docs: illustrate environmental defaults for auth variables
stainless-app[bot] May 5, 2025
71cf48f
chore(internal): codegen related update
stainless-app[bot] May 5, 2025
ebf0cae
chore(internal): codegen related update
stainless-app[bot] May 6, 2025
6784709
fix(internal): fix formatting script for macos
stainless-app[bot] May 6, 2025
139a140
chore(internal): codegen related update
stainless-app[bot] May 6, 2025
9a2827b
chore: revert ignoring Gemfile.lock
stainless-app[bot] May 6, 2025
3d51f78
fix(internal): ensure formatting always uses c.utf-8 locale
stainless-app[bot] May 7, 2025
65834c6
feat(api): Add reinforcement fine-tuning api support
stainless-app[bot] May 8, 2025
813a19d
Merge pull request #137 from sferik/remove_unnecessary_require_statement
ms-jpq May 12, 2025
0ef168a
feat: support sorbet aliases at the runtime
stainless-app[bot] May 12, 2025
918ac6b
chore: fix misc linting / minor issues
stainless-app[bot] May 12, 2025
734833c
feat: expose recursive `#to_h` conversion
stainless-app[bot] May 12, 2025
d3c5587
chore(internal): touch up formatting
ms-jpq May 12, 2025
1d53fee
feat: expose base client options as read only attributes
stainless-app[bot] May 12, 2025
3fc0971
feat: bump default connection pool size limit to minimum of 99
stainless-app[bot] May 14, 2025
f3c721e
docs: rewrite much of README.md for readability
stainless-app[bot] May 14, 2025
39d155f
docs: fix out of place README snippet
ms-jpq May 14, 2025
c4989d6
feat(api): manual updates
stainless-app[bot] May 15, 2025
bb21f9e
release: 0.1.0-beta.1
stainless-app[bot] May 16, 2025
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
Prev Previous commit
Next Next commit
chore: explicitly mark apis public under Internal module
  • Loading branch information
stainless-app[bot] committed Apr 21, 2025
commit ca0d841a571433528ae15974041c5ea142f9109e
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--type-name-tag generic:Generic
--default-return void
--markup markdown
--markup-provider redcarpet
--exclude /rbi
Expand Down
8 changes: 4 additions & 4 deletions lib/openai/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion lib/openai/internal.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

module OpenAI
# @api private
module Internal
OMIT =
Object.new.tap do
Expand Down
6 changes: 6 additions & 0 deletions lib/openai/internal/type/array_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -44,6 +48,8 @@ def ==(other)
# rubocop:enable Layout/LineLength
end

# @api public
#
# @return [Integer]
def hash = [self.class, item_type].hash

Expand Down
18 changes: 17 additions & 1 deletion lib/openai/internal/type/base_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,30 @@ def optional(name_sym, type_info, spec = {})
@mode = nil
end

# @api public
#
# @param other [Object]
#
# @return [Boolean]
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

Expand Down Expand Up @@ -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.
#
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions lib/openai/internal/type/base_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<Elem>]
Expand Down
8 changes: 8 additions & 0 deletions lib/openai/internal/type/base_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)

Expand All @@ -34,6 +38,8 @@ def close = OpenAI::Internal::Util.close_fused!(@iterator)
# @return [Enumerable<generic<Elem>>]
private def iterator = (raise NotImplementedError)

# @api public
#
# @param blk [Proc]
#
# @yieldparam [generic<Elem>]
Expand All @@ -45,6 +51,8 @@ def each(&blk)
@iterator.each(&blk)
end

# @api public
#
# @return [Enumerator<generic<Elem>>]
def to_enum = @iterator

Expand Down
4 changes: 4 additions & 0 deletions lib/openai/internal/type/boolean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 6 additions & 0 deletions lib/openai/internal/type/enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ module Enum
# @return [Array<NilClass, Boolean, Integer, Float, Symbol>]
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]
Expand All @@ -62,6 +66,8 @@ def ==(other)
# rubocop:enable Style/CaseEquality
end

# @api public
#
# @return [Integer]
def hash = values.to_set.hash

Expand Down
6 changes: 6 additions & 0 deletions lib/openai/internal/type/hash_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class HashOf
# @option spec [Boolean] :"nil?"
def self.[](...) = new(...)

# @api public
#
# @param other [Object]
#
# @return [Boolean]
Expand All @@ -50,6 +52,8 @@ def ===(other)
end
end

# @api public
#
# @param other [Object]
#
# @return [Boolean]
Expand All @@ -59,6 +63,8 @@ def ==(other)
# rubocop:enable Layout/LineLength
end

# @api public
#
# @return [Integer]
def hash = [self.class, item_type].hash

Expand Down
4 changes: 4 additions & 0 deletions lib/openai/internal/type/io_like.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class IOLike

private_class_method :new

# @api public
#
# @param other [Object]
#
# @return [Boolean]
Expand All @@ -25,6 +27,8 @@ def self.===(other)
end
end

# @api public
#
# @param other [Object]
#
# @return [Boolean]
Expand Down
6 changes: 6 additions & 0 deletions lib/openai/internal/type/union.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -121,13 +123,17 @@ def ===(other)
end
end

# @api public
#
# @param other [Object]
#
# @return [Boolean]
def ==(other)
OpenAI::Internal::Type::Union === other && other.derefed_variants == derefed_variants
end

# @api public
#
# @return [Integer]
def hash = variants.hash

Expand Down
4 changes: 4 additions & 0 deletions lib/openai/internal/type/unknown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/openai/models/chat/chat_completion_chunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/openai/models/chat/chat_completion_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
6 changes: 6 additions & 0 deletions lib/openai/models/chat/completion_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions lib/openai/models/file_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
#
Expand All @@ -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`.
#
Expand Down
Loading