Class: Smith::Models::Profile

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

Overview

Immutable capability record for a model id. Holds only inherent provider/model properties — never pricing, never API keys, never request-specific data. Library-shipped rules live in Smith::Models::Inference (pattern-based).

Fields:

model_id                   — canonical id ("claude-opus-4-7")
provider                   — :anthropic | :openai | :gemini | :xai | ...
thinking_shape             — nil | :budget_tokens | :reasoning_effort | :adaptive
  nil               — model has no thinking concept (don't send thinking)
  :budget_tokens    — RubyLLM's default Anthropic shape (Opus 4.6, Sonnet 4.x)
  :reasoning_effort — OpenAI-style reasoning_effort string
  :adaptive         — Opus 4.7+ adaptive shape (output_config.effort)
accepts_temperature        — false → normalizer strips @temperature
tools_with_thinking_native — true → tools + thinking on default endpoint OK
tools_with_thinking_route  — nil | :responses (which endpoint to route to
                             when both tools + thinking are present and
                             native combo is unsupported)

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



23
24
25
# File 'lib/smith/models/profile.rb', line 23

def accepts_temperature
  @accepts_temperature
end

#model_idObject (readonly)

Returns the value of attribute model_id

Returns:

  • (Object)

    the current value of model_id



23
24
25
# File 'lib/smith/models/profile.rb', line 23

def model_id
  @model_id
end

#providerObject (readonly)

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



23
24
25
# File 'lib/smith/models/profile.rb', line 23

def provider
  @provider
end

#thinking_shapeObject (readonly)

Returns the value of attribute thinking_shape

Returns:

  • (Object)

    the current value of thinking_shape



23
24
25
# File 'lib/smith/models/profile.rb', line 23

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



23
24
25
# File 'lib/smith/models/profile.rb', line 23

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



23
24
25
# File 'lib/smith/models/profile.rb', line 23

def tools_with_thinking_route
  @tools_with_thinking_route
end

Instance Method Details

#endpoint_modeObject

Derived from tools_with_thinking_route. Exposed on Profile (not on Tool::Compatibility) so the Profile is a self-contained capability record without cross-namespace dependency.



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

def endpoint_mode
  tools_with_thinking_route == :responses ? :responses : :chat_completions
end