Class: Arcp::Job::EventBody::ToolResult
- Inherits:
-
Data
- Object
- Data
- Arcp::Job::EventBody::ToolResult
- Defined in:
- lib/arcp/job/event_body/tool_result.rb
Instance Attribute Summary collapse
-
#call_id ⇒ Object
readonly
Returns the value of attribute call_id.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#call_id ⇒ Object (readonly)
Returns the value of attribute call_id
6 7 8 |
# File 'lib/arcp/job/event_body/tool_result.rb', line 6 def call_id @call_id end |
#error ⇒ Object (readonly)
Returns the value of attribute error
6 7 8 |
# File 'lib/arcp/job/event_body/tool_result.rb', line 6 def error @error end |
#result ⇒ Object (readonly)
Returns the value of attribute result
6 7 8 |
# File 'lib/arcp/job/event_body/tool_result.rb', line 6 def result @result end |
Class Method Details
.from_h(h) ⇒ Object
7 8 9 10 |
# File 'lib/arcp/job/event_body/tool_result.rb', line 7 def self.from_h(h) h = h.transform_keys(&:to_s) new(call_id: h.fetch('call_id'), result: h['result'], error: h['error']) end |
Instance Method Details
#ok? ⇒ Boolean
19 |
# File 'lib/arcp/job/event_body/tool_result.rb', line 19 def ok? = error.nil? |
#to_h ⇒ Object
12 13 14 15 16 17 |
# File 'lib/arcp/job/event_body/tool_result.rb', line 12 def to_h out = { 'call_id' => call_id } out['result'] = result if result out['error'] = error if error out end |