Class: Arcp::Job::EventBody::ToolCall

Inherits:
Data
  • Object
show all
Defined in:
lib/arcp/job/event_body/tool_call.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



6
7
8
# File 'lib/arcp/job/event_body/tool_call.rb', line 6

def args
  @args
end

#call_idObject (readonly)

Returns the value of attribute call_id

Returns:

  • (Object)

    the current value of call_id



6
7
8
# File 'lib/arcp/job/event_body/tool_call.rb', line 6

def call_id
  @call_id
end

#toolObject (readonly)

Returns the value of attribute tool

Returns:

  • (Object)

    the current value of tool



6
7
8
# File 'lib/arcp/job/event_body/tool_call.rb', line 6

def tool
  @tool
end

Class Method Details

.from_h(h) ⇒ Object



7
8
9
10
# File 'lib/arcp/job/event_body/tool_call.rb', line 7

def self.from_h(h)
  h = h.transform_keys(&:to_s)
  new(call_id: h.fetch('call_id'), tool: h.fetch('tool'), args: h['args'] || {})
end

Instance Method Details

#to_hObject



12
# File 'lib/arcp/job/event_body/tool_call.rb', line 12

def to_h = { 'call_id' => call_id, 'tool' => tool, 'args' => args }