Class: ConsoleAgent::Providers::ChatResult
- Inherits:
-
Struct
- Object
- Struct
- ConsoleAgent::Providers::ChatResult
- Defined in:
- lib/console_agent/providers/base.rb
Instance Attribute Summary collapse
-
#input_tokens ⇒ Object
Returns the value of attribute input_tokens.
-
#output_tokens ⇒ Object
Returns the value of attribute output_tokens.
-
#stop_reason ⇒ Object
Returns the value of attribute stop_reason.
-
#text ⇒ Object
Returns the value of attribute text.
-
#tool_calls ⇒ Object
Returns the value of attribute tool_calls.
Instance Method Summary collapse
Instance Attribute Details
#input_tokens ⇒ Object
Returns the value of attribute input_tokens
83 84 85 |
# File 'lib/console_agent/providers/base.rb', line 83 def input_tokens @input_tokens end |
#output_tokens ⇒ Object
Returns the value of attribute output_tokens
83 84 85 |
# File 'lib/console_agent/providers/base.rb', line 83 def output_tokens @output_tokens end |
#stop_reason ⇒ Object
Returns the value of attribute stop_reason
83 84 85 |
# File 'lib/console_agent/providers/base.rb', line 83 def stop_reason @stop_reason end |
#text ⇒ Object
Returns the value of attribute text
83 84 85 |
# File 'lib/console_agent/providers/base.rb', line 83 def text @text end |
#tool_calls ⇒ Object
Returns the value of attribute tool_calls
83 84 85 |
# File 'lib/console_agent/providers/base.rb', line 83 def tool_calls @tool_calls end |
Instance Method Details
#tool_use? ⇒ Boolean
88 89 90 |
# File 'lib/console_agent/providers/base.rb', line 88 def tool_use? stop_reason == :tool_use && tool_calls && !tool_calls.empty? end |
#total_tokens ⇒ Object
84 85 86 |
# File 'lib/console_agent/providers/base.rb', line 84 def total_tokens (input_tokens || 0) + (output_tokens || 0) end |