Class: Raif::ModelManifest::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/raif/model_manifest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#adapter_class_nameObject

Returns the value of attribute adapter_class_name

Returns:

  • (Object)

    the current value of adapter_class_name



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def adapter_class_name
  @adapter_class_name
end

#api_nameObject

Returns the value of attribute api_name

Returns:

  • (Object)

    the current value of api_name



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def api_name
  @api_name
end

#capabilitiesObject

Returns the value of attribute capabilities

Returns:

  • (Object)

    the current value of capabilities



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def capabilities
  @capabilities
end

#display_nameObject

Returns the value of attribute display_name

Returns:

  • (Object)

    the current value of display_name



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def display_name
  @display_name
end

#endpointObject

Returns the value of attribute endpoint

Returns:

  • (Object)

    the current value of endpoint



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def endpoint
  @endpoint
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def key
  @key
end

#key_baseObject

Returns the value of attribute key_base

Returns:

  • (Object)

    the current value of key_base



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def key_base
  @key_base
end

#lifecycleObject

Returns the value of attribute lifecycle

Returns:

  • (Object)

    the current value of lifecycle



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def lifecycle
  @lifecycle
end

#max_completion_tokensObject

Returns the value of attribute max_completion_tokens

Returns:

  • (Object)

    the current value of max_completion_tokens



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def max_completion_tokens
  @max_completion_tokens
end

#pricingObject

Returns the value of attribute pricing

Returns:

  • (Object)

    the current value of pricing



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def pricing
  @pricing
end

#provider_nameObject

Returns the value of attribute provider_name

Returns:

  • (Object)

    the current value of provider_name



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def provider_name
  @provider_name
end

#source_pathObject

Returns the value of attribute source_path

Returns:

  • (Object)

    the current value of source_path



78
79
80
# File 'lib/raif/model_manifest.rb', line 78

def source_path
  @source_path
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


85
# File 'lib/raif/model_manifest.rb', line 85

def active? = status == :active

#claimed_value(capability) ⇒ Object



105
106
107
108
109
110
111
112
# File 'lib/raif/model_manifest.rb', line 105

def claimed_value(capability)
  case capability.to_s
  when "completion" then true
  when "streaming_tool_calls" then capabilities[:streaming] && capabilities[:native_tool_use]
  when "provider_managed_tools" then capabilities[:provider_managed_tools]
  else capabilities[capability.to_sym]
  end
end

#deprecated?Boolean

Returns:

  • (Boolean)


86
# File 'lib/raif/model_manifest.rb', line 86

def deprecated? = status == :deprecated

#retired?Boolean

Returns:

  • (Boolean)


87
# File 'lib/raif/model_manifest.rb', line 87

def retired? = status == :retired

#smokable_capabilitiesObject

Capabilities the smoke runner would test for this entry: "completion" always, plus every schema capability, plus the derived streaming_tool_calls whenever native tool use is claimed (even if streaming itself is claimed false, so --only streaming_tool_calls still works as a diagnostic on a streaming-disabled model).

Names are strings here and in claimed_value because that is what the smoke CLI passes around; the capabilities they read are symbol-keyed.



97
98
99
100
101
102
103
# File 'lib/raif/model_manifest.rb', line 97

def smokable_capabilities
  caps = ["completion"]
  caps += CAPABILITY_KEYS.reject { |c| c == :provider_managed_tools }.map(&:to_s)
  caps << "provider_managed_tools" if capabilities[:provider_managed_tools]&.any?
  caps << "streaming_tool_calls" if capabilities[:native_tool_use]
  caps
end

#statusObject



84
# File 'lib/raif/model_manifest.rb', line 84

def status = lifecycle.fetch(:status)