Class: RubyCanUseLLM::Response
- Inherits:
-
Object
- Object
- RubyCanUseLLM::Response
- Defined in:
- lib/rubycanusellm/response.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#input_tokens ⇒ Object
readonly
Returns the value of attribute input_tokens.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#output_tokens ⇒ Object
readonly
Returns the value of attribute output_tokens.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#tool_calls ⇒ Object
readonly
Returns the value of attribute tool_calls.
Instance Method Summary collapse
-
#initialize(content:, model:, input_tokens:, output_tokens:, raw:, tool_calls: nil) ⇒ Response
constructor
A new instance of Response.
- #tool_call? ⇒ Boolean
- #total_tokens ⇒ Object
Constructor Details
#initialize(content:, model:, input_tokens:, output_tokens:, raw:, tool_calls: nil) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 13 14 |
# File 'lib/rubycanusellm/response.rb', line 7 def initialize(content:, model:, input_tokens:, output_tokens:, raw:, tool_calls: nil) @content = content @model = model @input_tokens = input_tokens @output_tokens = output_tokens @tool_calls = tool_calls @raw = raw end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/rubycanusellm/response.rb', line 5 def content @content end |
#input_tokens ⇒ Object (readonly)
Returns the value of attribute input_tokens.
5 6 7 |
# File 'lib/rubycanusellm/response.rb', line 5 def input_tokens @input_tokens end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
5 6 7 |
# File 'lib/rubycanusellm/response.rb', line 5 def model @model end |
#output_tokens ⇒ Object (readonly)
Returns the value of attribute output_tokens.
5 6 7 |
# File 'lib/rubycanusellm/response.rb', line 5 def output_tokens @output_tokens end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/rubycanusellm/response.rb', line 5 def raw @raw end |
#tool_calls ⇒ Object (readonly)
Returns the value of attribute tool_calls.
5 6 7 |
# File 'lib/rubycanusellm/response.rb', line 5 def tool_calls @tool_calls end |
Instance Method Details
#tool_call? ⇒ Boolean
16 17 18 |
# File 'lib/rubycanusellm/response.rb', line 16 def tool_call? !tool_calls.nil? && !tool_calls.empty? end |
#total_tokens ⇒ Object
20 21 22 |
# File 'lib/rubycanusellm/response.rb', line 20 def total_tokens input_tokens + output_tokens end |