Class: TurnKit::Result
- Inherits:
-
Object
- Object
- TurnKit::Result
- Defined in:
- lib/turnkit/result.rb
Instance Attribute Summary collapse
-
#finish_reason ⇒ Object
readonly
Returns the value of attribute finish_reason.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#tool_calls ⇒ Object
readonly
Returns the value of attribute tool_calls.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
-
#initialize(text: "", tool_calls: [], usage: Usage.new, model: nil, finish_reason: nil) ⇒ Result
constructor
A new instance of Result.
- #tool_calls? ⇒ Boolean
Constructor Details
#initialize(text: "", tool_calls: [], usage: Usage.new, model: nil, finish_reason: nil) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 12 13 |
# File 'lib/turnkit/result.rb', line 7 def initialize(text: "", tool_calls: [], usage: Usage.new, model: nil, finish_reason: nil) @text = text.to_s @tool_calls = Array(tool_calls) @usage = usage || Usage.new @model = model @finish_reason = finish_reason end |
Instance Attribute Details
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
5 6 7 |
# File 'lib/turnkit/result.rb', line 5 def finish_reason @finish_reason end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
5 6 7 |
# File 'lib/turnkit/result.rb', line 5 def model @model end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/turnkit/result.rb', line 5 def text @text end |
#tool_calls ⇒ Object (readonly)
Returns the value of attribute tool_calls.
5 6 7 |
# File 'lib/turnkit/result.rb', line 5 def tool_calls @tool_calls end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
5 6 7 |
# File 'lib/turnkit/result.rb', line 5 def usage @usage end |
Instance Method Details
#tool_calls? ⇒ Boolean
15 16 17 |
# File 'lib/turnkit/result.rb', line 15 def tool_calls? tool_calls.any? end |