Class: SwarmSDK::Models::ModelInfo
- Inherits:
-
Object
- Object
- SwarmSDK::Models::ModelInfo
- Defined in:
- lib/swarm_sdk/models.rb
Overview
Model information wrapper providing method access to model data
Wraps the raw Hash from models.json to provide RubyLLM::Model::Info-like interface for compatibility with code expecting method access.
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
readonly
Returns the value of attribute capabilities.
-
#context_window ⇒ Object
readonly
Returns the value of attribute context_window.
-
#family ⇒ Object
readonly
Returns the value of attribute family.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#knowledge_cutoff ⇒ Object
readonly
Returns the value of attribute knowledge_cutoff.
-
#max_output_tokens ⇒ Object
readonly
Returns the value of attribute max_output_tokens.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#modalities ⇒ Object
readonly
Returns the value of attribute modalities.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pricing ⇒ Object
readonly
Returns the value of attribute pricing.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(data) ⇒ ModelInfo
constructor
Create a ModelInfo from a Hash.
Constructor Details
#initialize(data) ⇒ ModelInfo
Create a ModelInfo from a Hash
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/swarm_sdk/models.rb', line 46 def initialize(data) @id = data["id"] || data[:id] @name = data["name"] || data[:name] @provider = data["provider"] || data[:provider] @family = data["family"] || data[:family] @context_window = data["context_window"] || data[:context_window] @max_output_tokens = data["max_output_tokens"] || data[:max_output_tokens] @knowledge_cutoff = data["knowledge_cutoff"] || data[:knowledge_cutoff] @modalities = data["modalities"] || data[:modalities] @capabilities = data["capabilities"] || data[:capabilities] @pricing = data["pricing"] || data[:pricing] = data["metadata"] || data[:metadata] end |
Instance Attribute Details
#capabilities ⇒ Object (readonly)
Returns the value of attribute capabilities.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def capabilities @capabilities end |
#context_window ⇒ Object (readonly)
Returns the value of attribute context_window.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def context_window @context_window end |
#family ⇒ Object (readonly)
Returns the value of attribute family.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def family @family end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def id @id end |
#knowledge_cutoff ⇒ Object (readonly)
Returns the value of attribute knowledge_cutoff.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def knowledge_cutoff @knowledge_cutoff end |
#max_output_tokens ⇒ Object (readonly)
Returns the value of attribute max_output_tokens.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def max_output_tokens @max_output_tokens end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def end |
#modalities ⇒ Object (readonly)
Returns the value of attribute modalities.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def modalities @modalities end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def name @name end |
#pricing ⇒ Object (readonly)
Returns the value of attribute pricing.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def pricing @pricing end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
31 32 33 |
# File 'lib/swarm_sdk/models.rb', line 31 def provider @provider end |