Module: RubyLLM::ActiveRecord::ModelMethods

Extended by:
ActiveSupport::Concern
Defined in:
lib/ruby_llm/active_record/model_methods.rb

Overview

Methods mixed into model registry models.

Instance Method Summary collapse

Instance Method Details

#to_llmObject



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/ruby_llm/active_record/model_methods.rb', line 60

def to_llm
  RubyLLM::Model::Info.new(
    id: model_id,
    name: name,
    provider: provider,
    family: family,
    created_at: model_created_at,
    context_window: context_window,
    max_output_tokens: max_output_tokens,
    knowledge_cutoff: knowledge_cutoff,
    modalities: modalities&.deep_symbolize_keys || {},
    capabilities: capabilities,
    pricing: pricing&.deep_symbolize_keys || {},
    metadata: &.deep_symbolize_keys || {}
  )
end