Class: TurnKit::ToolExecution
- Inherits:
-
Object
- Object
- TurnKit::ToolExecution
- Defined in:
- lib/turnkit/tool_execution.rb
Constant Summary collapse
- STATUSES =
Record::TOOL_EXECUTION_STATUSES
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#completed_at ⇒ Object
readonly
Returns the value of attribute completed_at.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tool_call_id ⇒ Object
readonly
Returns the value of attribute tool_call_id.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
-
#turn_id ⇒ Object
readonly
Returns the value of attribute turn_id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ToolExecution
constructor
A new instance of ToolExecution.
Constructor Details
#initialize(attributes = {}) ⇒ ToolExecution
Returns a new instance of ToolExecution.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/turnkit/tool_execution.rb', line 10 def initialize(attributes = {}) attrs = attributes.transform_keys(&:to_s) @id = attrs.fetch("id") @turn_id = attrs.fetch("turn_id") @tool_call_id = attrs.fetch("tool_call_id") @tool_name = attrs.fetch("tool_name") @status = attrs.fetch("status") @arguments = attrs["arguments"] || {} @result = attrs["result"] @error = attrs["error"] @started_at = attrs["started_at"] @completed_at = attrs["completed_at"] end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
8 9 10 |
# File 'lib/turnkit/tool_execution.rb', line 8 def arguments @arguments end |
#completed_at ⇒ Object (readonly)
Returns the value of attribute completed_at.
8 9 10 |
# File 'lib/turnkit/tool_execution.rb', line 8 def completed_at @completed_at end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
8 9 10 |
# File 'lib/turnkit/tool_execution.rb', line 8 def error @error end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/turnkit/tool_execution.rb', line 7 def id @id end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/turnkit/tool_execution.rb', line 8 def result @result end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
8 9 10 |
# File 'lib/turnkit/tool_execution.rb', line 8 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/turnkit/tool_execution.rb', line 7 def status @status end |
#tool_call_id ⇒ Object (readonly)
Returns the value of attribute tool_call_id.
7 8 9 |
# File 'lib/turnkit/tool_execution.rb', line 7 def tool_call_id @tool_call_id end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
7 8 9 |
# File 'lib/turnkit/tool_execution.rb', line 7 def tool_name @tool_name end |
#turn_id ⇒ Object (readonly)
Returns the value of attribute turn_id.
7 8 9 |
# File 'lib/turnkit/tool_execution.rb', line 7 def turn_id @turn_id end |