Class: Intelligence::MessageContent::ToolResult
- Defined in:
- lib/intelligence/message_content/tool_result.rb
Instance Attribute Summary collapse
-
#tool_call_id ⇒ Object
readonly
Returns the value of attribute tool_call_id.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
-
#tool_result ⇒ Object
readonly
Returns the value of attribute tool_result.
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Intelligence::MessageContent::Base
Instance Attribute Details
#tool_call_id ⇒ Object (readonly)
Returns the value of attribute tool_call_id.
12 13 14 |
# File 'lib/intelligence/message_content/tool_result.rb', line 12 def tool_call_id @tool_call_id end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
13 14 15 |
# File 'lib/intelligence/message_content/tool_result.rb', line 13 def tool_name @tool_name end |
#tool_result ⇒ Object (readonly)
Returns the value of attribute tool_result.
14 15 16 |
# File 'lib/intelligence/message_content/tool_result.rb', line 14 def tool_result @tool_result end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/intelligence/message_content/tool_result.rb', line 21 def to_h { type: :tool_result, tool_call_id: tool_call_id, tool_name: tool_name, tool_result: tool_result }.compact end |
#valid? ⇒ Boolean
16 17 18 19 |
# File 'lib/intelligence/message_content/tool_result.rb', line 16 def valid? tool_call_id && !tool_call_id.empty? && tool_name && !tool_name.empty? end |