Class: Phronomy::Agent::ToolApprovalRequest::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/phronomy/agent/tool_approval_request.rb

Overview

One ToolInvocation included in a batch approval request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool_invocation_id:, tool_call_id:, tool_name:, arguments:, facts:, reason:, origin:, metadata:) ⇒ Item

Returns a new instance of Item.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/phronomy/agent/tool_approval_request.rb', line 27

def initialize(
  tool_invocation_id:,
  tool_call_id:,
  tool_name:,
  arguments:,
  facts:,
  reason:,
  origin:,
  metadata:
)
  @tool_invocation_id = tool_invocation_id.to_s.freeze
  @tool_call_id = tool_call_id&.to_s&.freeze
  @tool_name = tool_name.to_s.freeze
  @arguments = immutable_copy(arguments)
  @facts = immutable_copy(facts)
  @reason = reason&.to_s&.freeze
  @origin = origin.to_sym
  @metadata = immutable_copy()
  freeze
end

Instance Attribute Details

#argumentsObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def arguments
  @arguments
end

#factsObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def facts
  @facts
end

#metadataObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def 
  @metadata
end

#originObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def origin
  @origin
end

#reasonObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def reason
  @reason
end

#tool_call_idObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def tool_call_id
  @tool_call_id
end

#tool_invocation_idObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def tool_invocation_id
  @tool_invocation_id
end

#tool_nameObject (readonly)



18
19
20
# File 'lib/phronomy/agent/tool_approval_request.rb', line 18

def tool_name
  @tool_name
end

Instance Method Details

#to_hObject



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/phronomy/agent/tool_approval_request.rb', line 48

def to_h
  {
    tool_invocation_id: @tool_invocation_id,
    tool_call_id: @tool_call_id,
    tool_name: @tool_name,
    arguments: @arguments,
    facts: @facts,
    reason: @reason,
    origin: @origin,
    metadata: @metadata
  }
end