Class: RubyLLM::ModelInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/model_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, display_name:, provider:, context_window:, max_tokens:, supports_vision:, supports_functions:, supports_json_mode:, input_price_per_million:, output_price_per_million:, metadata: {}) ⇒ ModelInfo

Returns a new instance of ModelInfo.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ruby_llm/model_info.rb', line 9

def initialize(id:, created_at:, display_name:, provider:, context_window:, max_tokens:, supports_vision:,
               supports_functions:, supports_json_mode:, input_price_per_million:, output_price_per_million:, metadata: {})
  @id = id
  @created_at = created_at
  @display_name = display_name
  @provider = provider
  @metadata = 
  @context_window = context_window
  @max_tokens = max_tokens
  @supports_vision = supports_vision
  @supports_functions = supports_functions
  @supports_json_mode = supports_json_mode
  @input_price_per_million = input_price_per_million
  @output_price_per_million = output_price_per_million
end

Instance Attribute Details

#context_windowObject (readonly)

Returns the value of attribute context_window.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def context_window
  @context_window
end

#created_atObject (readonly)

Returns the value of attribute created_at.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def created_at
  @created_at
end

#display_nameObject (readonly)

Returns the value of attribute display_name.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def display_name
  @display_name
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def id
  @id
end

#input_price_per_millionObject (readonly)

Returns the value of attribute input_price_per_million.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def input_price_per_million
  @input_price_per_million
end

#max_tokensObject (readonly)

Returns the value of attribute max_tokens.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def max_tokens
  @max_tokens
end

#metadataObject (readonly)

Returns the value of attribute metadata.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def 
  @metadata
end

#output_price_per_millionObject (readonly)

Returns the value of attribute output_price_per_million.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def output_price_per_million
  @output_price_per_million
end

#providerObject (readonly)

Returns the value of attribute provider.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def provider
  @provider
end

#supports_functionsObject (readonly)

Returns the value of attribute supports_functions.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def supports_functions
  @supports_functions
end

#supports_json_modeObject (readonly)

Returns the value of attribute supports_json_mode.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def supports_json_mode
  @supports_json_mode
end

#supports_visionObject (readonly)

Returns the value of attribute supports_vision.



5
6
7
# File 'lib/ruby_llm/model_info.rb', line 5

def supports_vision
  @supports_vision
end

Instance Method Details

#to_hObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ruby_llm/model_info.rb', line 25

def to_h
  {
    id: id,
    created_at: created_at,
    display_name: display_name,
    provider: provider,
    metadata: ,
    context_window: context_window,
    max_tokens: max_tokens,
    supports_vision: supports_vision,
    supports_functions: supports_functions,
    supports_json_mode: supports_json_mode,
    input_price_per_million: input_price_per_million,
    output_price_per_million: output_price_per_million
  }
end