Class: Riffer::Messages::Tool

Inherits:
Base
  • Object
show all
Defined in:
lib/riffer/messages/tool.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#content

Instance Method Summary collapse

Constructor Details

#initialize(content, tool_call_id:, name:) ⇒ Tool

Returns a new instance of Tool.



6
7
8
9
10
# File 'lib/riffer/messages/tool.rb', line 6

def initialize(content, tool_call_id:, name:)
  super(content)
  @tool_call_id = tool_call_id
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/riffer/messages/tool.rb', line 4

def name
  @name
end

#tool_call_idObject (readonly)

Returns the value of attribute tool_call_id.



4
5
6
# File 'lib/riffer/messages/tool.rb', line 4

def tool_call_id
  @tool_call_id
end

Instance Method Details

#roleObject



12
13
14
# File 'lib/riffer/messages/tool.rb', line 12

def role
  "tool"
end

#to_hObject



16
17
18
# File 'lib/riffer/messages/tool.rb', line 16

def to_h
  {role: role, content: content, tool_call_id: tool_call_id, name: name}
end