Class: LLM::Response::Output

Inherits:
LLM::Response show all
Defined in:
lib/llm/response/output.rb

Instance Method Summary collapse

Methods inherited from LLM::Response

#body, #initialize

Constructor Details

This class inherits a constructor from LLM::Response

Instance Method Details

#idString

Returns the id of the response

Returns:

  • (String)

    Returns the id of the response



8
9
10
# File 'lib/llm/response/output.rb', line 8

def id
  parsed[:id]
end

#modelString

Returns the model name

Returns:

  • (String)

    Returns the model name



15
16
17
# File 'lib/llm/response/output.rb', line 15

def model
  parsed[:model]
end

#outputsArray<LLM::Message>

Returns:



21
22
23
# File 'lib/llm/response/output.rb', line 21

def outputs
  parsed[:outputs]
end

#input_tokensInteger

Returns the input token count

Returns:

  • (Integer)

    Returns the input token count



28
29
30
# File 'lib/llm/response/output.rb', line 28

def input_tokens
  parsed[:input_tokens]
end

#output_tokensInteger

Returns the output token count

Returns:

  • (Integer)

    Returns the output token count



35
36
37
# File 'lib/llm/response/output.rb', line 35

def output_tokens
  parsed[:output_tokens]
end

#total_tokensInteger

Returns the total count of tokens

Returns:

  • (Integer)

    Returns the total count of tokens



42
43
44
# File 'lib/llm/response/output.rb', line 42

def total_tokens
  parsed[:total_tokens]
end