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
87 88 89 |
# File 'lib/console_agent/providers/base.rb', line 87 def input_tokens @input_tokens end |
#output_tokens ⇒ Object
Returns the value of attribute output_tokens
87 88 89 |
# File 'lib/console_agent/providers/base.rb', line 87 def output_tokens @output_tokens end |
#stop_reason ⇒ Object
Returns the value of attribute stop_reason
87 88 89 |
# File 'lib/console_agent/providers/base.rb', line 87 def stop_reason @stop_reason end |
#text ⇒ Object
Returns the value of attribute text
87 88 89 |
# File 'lib/console_agent/providers/base.rb', line 87 def text @text end |
#tool_calls ⇒ Object
Returns the value of attribute tool_calls
87 88 89 |
# File 'lib/console_agent/providers/base.rb', line 87 def tool_calls @tool_calls end |
Instance Method Details
#tool_use? ⇒ Boolean
92 93 94 |
# File 'lib/console_agent/providers/base.rb', line 92 def tool_use? stop_reason == :tool_use && tool_calls && !tool_calls.empty? end |
#total_tokens ⇒ Object
88 89 90 |
# File 'lib/console_agent/providers/base.rb', line 88 def total_tokens (input_tokens || 0) + (output_tokens || 0) end |