Class: Copilot::ModelInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/copilot/types.rb

Overview

Information about an available model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#billingObject

Returns the value of attribute billing

Returns:

  • (Object)

    the current value of billing



423
424
425
# File 'lib/copilot/types.rb', line 423

def billing
  @billing
end

#capabilitiesObject

Returns the value of attribute capabilities

Returns:

  • (Object)

    the current value of capabilities



423
424
425
# File 'lib/copilot/types.rb', line 423

def capabilities
  @capabilities
end

#default_reasoning_effortObject

Returns the value of attribute default_reasoning_effort

Returns:

  • (Object)

    the current value of default_reasoning_effort



423
424
425
# File 'lib/copilot/types.rb', line 423

def default_reasoning_effort
  @default_reasoning_effort
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



423
424
425
# File 'lib/copilot/types.rb', line 423

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



423
424
425
# File 'lib/copilot/types.rb', line 423

def name
  @name
end

#policyObject

Returns the value of attribute policy

Returns:

  • (Object)

    the current value of policy



423
424
425
# File 'lib/copilot/types.rb', line 423

def policy
  @policy
end

#supported_reasoning_effortsObject

Returns the value of attribute supported_reasoning_efforts

Returns:

  • (Object)

    the current value of supported_reasoning_efforts



423
424
425
# File 'lib/copilot/types.rb', line 423

def supported_reasoning_efforts
  @supported_reasoning_efforts
end

Class Method Details

.from_hash(h) ⇒ Object



428
429
430
431
432
433
434
435
436
437
438
# File 'lib/copilot/types.rb', line 428

def self.from_hash(h)
  new(
    id: h["id"],
    name: h["name"],
    capabilities: ModelCapabilities.from_hash(h["capabilities"] || {}),
    policy: h["policy"] ? ModelPolicy.from_hash(h["policy"]) : nil,
    billing: h["billing"] ? ModelBilling.from_hash(h["billing"]) : nil,
    supported_reasoning_efforts: h["supportedReasoningEfforts"],
    default_reasoning_effort: h["defaultReasoningEffort"]
  )
end