Class: Nanobot::Providers::LLMResponse
- Inherits:
-
Struct
- Object
- Struct
- Nanobot::Providers::LLMResponse
- Defined in:
- lib/nanobot/providers/base.rb
Overview
LLMResponse represents the response from an LLM
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#finish_reason ⇒ Object
Returns the value of attribute finish_reason.
-
#tool_calls ⇒ Object
Returns the value of attribute tool_calls.
Instance Method Summary collapse
-
#initialize(content: nil, tool_calls: nil, finish_reason: nil) ⇒ LLMResponse
constructor
A new instance of LLMResponse.
- #tool_calls? ⇒ Boolean
Constructor Details
#initialize(content: nil, tool_calls: nil, finish_reason: nil) ⇒ LLMResponse
Returns a new instance of LLMResponse.
10 11 12 13 14 15 16 |
# File 'lib/nanobot/providers/base.rb', line 10 def initialize(content: nil, tool_calls: nil, finish_reason: nil) super( content: content || '', tool_calls: tool_calls || [], finish_reason: finish_reason ) end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content
9 10 11 |
# File 'lib/nanobot/providers/base.rb', line 9 def content @content end |
#finish_reason ⇒ Object
Returns the value of attribute finish_reason
9 10 11 |
# File 'lib/nanobot/providers/base.rb', line 9 def finish_reason @finish_reason end |
#tool_calls ⇒ Object
Returns the value of attribute tool_calls
9 10 11 |
# File 'lib/nanobot/providers/base.rb', line 9 def tool_calls @tool_calls end |
Instance Method Details
#tool_calls? ⇒ Boolean
18 19 20 |
# File 'lib/nanobot/providers/base.rb', line 18 def tool_calls? tool_calls && !tool_calls.empty? end |