Class: OpenRouter::ToolResult
- Inherits:
-
Object
- Object
- OpenRouter::ToolResult
- Includes:
- ToolResultBase
- Defined in:
- lib/open_router/tool_call.rb
Overview
Represents the result of executing a Chat Completions tool call
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#tool_call ⇒ Object
readonly
Returns the value of attribute tool_call.
Instance Method Summary collapse
-
#initialize(tool_call, result = nil, error = nil) ⇒ ToolResult
constructor
A new instance of ToolResult.
-
#to_message ⇒ Object
Convert to message format for conversation continuation.
Methods included from ToolResultBase
#failure?, included, #success?
Constructor Details
#initialize(tool_call, result = nil, error = nil) ⇒ ToolResult
Returns a new instance of ToolResult.
123 124 125 126 127 |
# File 'lib/open_router/tool_call.rb', line 123 def initialize(tool_call, result = nil, error = nil) @tool_call = tool_call @result = result @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
121 122 123 |
# File 'lib/open_router/tool_call.rb', line 121 def error @error end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
121 122 123 |
# File 'lib/open_router/tool_call.rb', line 121 def result @result end |
#tool_call ⇒ Object (readonly)
Returns the value of attribute tool_call.
121 122 123 |
# File 'lib/open_router/tool_call.rb', line 121 def tool_call @tool_call end |
Instance Method Details
#to_message ⇒ Object
Convert to message format for conversation continuation
130 131 132 |
# File 'lib/open_router/tool_call.rb', line 130 def @tool_call.(@error || @result) end |