Class: DeepAgentsRb::Tools::ToolMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/deepagents/deepagentsrb/tools.rb

Overview

Tool message class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, tool_call_id:) ⇒ ToolMessage



43
44
45
46
# File 'lib/deepagents/deepagentsrb/tools.rb', line 43

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



41
42
43
# File 'lib/deepagents/deepagentsrb/tools.rb', line 41

def content
  @content
end

#tool_call_idObject (readonly)

Returns the value of attribute tool_call_id.



41
42
43
# File 'lib/deepagents/deepagentsrb/tools.rb', line 41

def tool_call_id
  @tool_call_id
end

Instance Method Details

#to_hObject



48
49
50
51
52
53
54
# File 'lib/deepagents/deepagentsrb/tools.rb', line 48

def to_h
  {
    role: "tool",
    content: @content,
    tool_call_id: @tool_call_id
  }
end