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, #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

Describes an OpenAI model offering that can be used with the API.

Parameters:

  • id (String)

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

  • created (Integer)

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

  • owned_by (String)

    The organization that owns the model.

  • shutdown_date (Date, nil) (defaults to: nil)

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

  • object (Symbol, :model) (defaults to: :model)

    The object type, which is always "model".



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

Instance Attribute Details

#createdInteger

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

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :created, Integer

#idString

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

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#objectSymbol, :model

The object type, which is always "model".

Parameters:

  • value (:model)

Returns:

  • (Symbol, :model)


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

required :object, const: :model

#owned_byString

The organization that owns the model.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :owned_by, String

#shutdown_dateDate?

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

Parameters:

  • value (Date, nil)

Returns:

  • (Date, nil)


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

optional :shutdown_date, Date, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {