Class: OpenAI::Models::Model

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/model.rb,
sig/openai/models/model.rbs

Overview

See Also:

  • OpenAI::Resources::Models#retrieve

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, created:, owned_by:, shutdown_date: nil, object: :model) ⇒ Object

Parameters:

  • id —

    The model identifier, which can be referenced in the API endpoints.

  • created —

    The Unix timestamp (in seconds) when the model was created.

  • owned_by —

    The organization that owns the model.

  • shutdown_date (defaults to: nil) —

    The date when the model will shut down, or null if not announced.

  • object (defaults to: :model) —

    The object type, which is always "model".



# File 'lib/openai/models/model.rb', line 37

Instance Attribute Details

#created ⇒ Integer

The Unix timestamp (in seconds) when the model was created.

Returns:

  • (Integer)


17
# File 'lib/openai/models/model.rb', line 17

required :created, Integer

#id ⇒ String

The model identifier, which can be referenced in the API endpoints.

Returns:

  • (String)


11
# File 'lib/openai/models/model.rb', line 11

required :id, String

#object ⇒ :model

The object type, which is always "model".

Returns:

  • (:model)


23
# File 'lib/openai/models/model.rb', line 23

required :object, const: :model

#owned_by ⇒ String

The organization that owns the model.

Returns:

  • (String)


29
# File 'lib/openai/models/model.rb', line 29

required :owned_by, String

#shutdown_date ⇒ Date?

The date when the model will shut down, or null if not announced.

Returns:

  • (Date, nil)


35
# File 'lib/openai/models/model.rb', line 35

optional :shutdown_date, Date, nil?: true

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


46
# File 'sig/openai/models/model.rbs', line 46

def to_hash: -> {