Class: TurnKit::ToolExecution

Inherits:
Object
  • Object
show all
Defined in:
lib/turnkit/tool_execution.rb

Constant Summary collapse

STATUSES =
Record::TOOL_EXECUTION_STATUSES

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argumentsObject (readonly)

Returns the value of attribute arguments.



8
9
10
# File 'lib/turnkit/tool_execution.rb', line 8

def arguments
  @arguments
end

#completed_atObject (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

#errorObject (readonly)

Returns the value of attribute error.



8
9
10
# File 'lib/turnkit/tool_execution.rb', line 8

def error
  @error
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/turnkit/tool_execution.rb', line 7

def id
  @id
end

#resultObject (readonly)

Returns the value of attribute result.



8
9
10
# File 'lib/turnkit/tool_execution.rb', line 8

def result
  @result
end

#started_atObject (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

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/turnkit/tool_execution.rb', line 7

def status
  @status
end

#tool_call_idObject (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_nameObject (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_idObject (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