Class: Smith::Models::Inference::Rule

Inherits:
Data
  • Object
show all
Defined in:
lib/smith/models/inference.rb

Overview

A single rule maps a model_id matcher to capability values. The matcher is a Proc[String -> Boolean] — regex match OR version-aware predicate (e.g., Opus 4.7+).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accepts_temperatureObject (readonly)

Returns the value of attribute accepts_temperature

Returns:

  • (Object)

    the current value of accepts_temperature



26
27
28
# File 'lib/smith/models/inference.rb', line 26

def accepts_temperature
  @accepts_temperature
end

#matcherObject (readonly)

Returns the value of attribute matcher

Returns:

  • (Object)

    the current value of matcher



26
27
28
# File 'lib/smith/models/inference.rb', line 26

def matcher
  @matcher
end

#providerObject (readonly)

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



26
27
28
# File 'lib/smith/models/inference.rb', line 26

def provider
  @provider
end

#thinking_shapeObject (readonly)

Returns the value of attribute thinking_shape

Returns:

  • (Object)

    the current value of thinking_shape



26
27
28
# File 'lib/smith/models/inference.rb', line 26

def thinking_shape
  @thinking_shape
end

#tools_with_thinking_nativeObject (readonly)

Returns the value of attribute tools_with_thinking_native

Returns:

  • (Object)

    the current value of tools_with_thinking_native



26
27
28
# File 'lib/smith/models/inference.rb', line 26

def tools_with_thinking_native
  @tools_with_thinking_native
end

#tools_with_thinking_routeObject (readonly)

Returns the value of attribute tools_with_thinking_route

Returns:

  • (Object)

    the current value of tools_with_thinking_route



26
27
28
# File 'lib/smith/models/inference.rb', line 26

def tools_with_thinking_route
  @tools_with_thinking_route
end

Instance Method Details

#matches?(model_id) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/smith/models/inference.rb', line 34

def matches?(model_id)
  matcher.call(model_id.to_s)
end

#to_profile(model_id) ⇒ Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/smith/models/inference.rb', line 38

def to_profile(model_id)
  Profile.new(
    model_id: model_id.to_s,
    provider: provider,
    thinking_shape: thinking_shape,
    accepts_temperature: accepts_temperature,
    tools_with_thinking_native: tools_with_thinking_native,
    tools_with_thinking_route: tools_with_thinking_route
  )
end