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_name ⇒ Object

Returns the value of attribute adapter_class_name

Returns:

  • (Object) —

    the current value of adapter_class_name



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def adapter_class_name
  @adapter_class_name
end

#api_name ⇒ Object

Returns the value of attribute api_name

Returns:

  • (Object) —

    the current value of api_name



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def api_name
  @api_name
end

#capabilities ⇒ Object

Returns the value of attribute capabilities

Returns:

  • (Object) —

    the current value of capabilities



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def capabilities
  @capabilities
end

#display_name ⇒ Object

Returns the value of attribute display_name

Returns:

  • (Object) —

    the current value of display_name



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def display_name
  @display_name
end

#endpoint ⇒ Object

Returns the value of attribute endpoint

Returns:

  • (Object) —

    the current value of endpoint



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def endpoint
  @endpoint
end

#key ⇒ Object

Returns the value of attribute key

Returns:

  • (Object) —

    the current value of key



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def key
  @key
end

#key_base ⇒ Object

Returns the value of attribute key_base

Returns:

  • (Object) —

    the current value of key_base



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def key_base
  @key_base
end

#lifecycle ⇒ Object

Returns the value of attribute lifecycle

Returns:

  • (Object) —

    the current value of lifecycle



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def lifecycle
  @lifecycle
end

#max_completion_tokens ⇒ Object

Returns the value of attribute max_completion_tokens

Returns:

  • (Object) —

    the current value of max_completion_tokens



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def max_completion_tokens
  @max_completion_tokens
end

#pricing ⇒ Object

Returns the value of attribute pricing

Returns:

  • (Object) —

    the current value of pricing



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def pricing
  @pricing
end

#provider_name ⇒ Object

Returns the value of attribute provider_name

Returns:

  • (Object) —

    the current value of provider_name



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def provider_name
  @provider_name
end

#source_path ⇒ Object

Returns the value of attribute source_path

Returns:

  • (Object) —

    the current value of source_path



90
91
92
# File 'lib/raif/model_manifest.rb', line 90

def source_path
  @source_path
end

Instance Method Details

#active? ⇒ Boolean

Returns:

  • (Boolean)


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

def active? = status == :active

#claimed_value(capability) ⇒ Object



117
118
119
120
121
122
123
124
# File 'lib/raif/model_manifest.rb', line 117

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)


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

def deprecated? = status == :deprecated

#retired? ⇒ Boolean

Returns:

  • (Boolean)


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

def retired? = status == :retired

#smokable_capabilities ⇒ Object

Capabilities the smoke runner would test for this entry: "completion" always, plus every smoke 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.



109
110
111
112
113
114
115
# File 'lib/raif/model_manifest.rb', line 109

def smokable_capabilities
  caps = ["completion"]
  caps += SMOKE_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

#status ⇒ Object



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

def status = lifecycle.fetch(:status)