Class: Roast::Cogs::Agent::Providers::Claude::ToolUse

Inherits:
Object
  • Object
show all
Defined in:
lib/roast/cogs/agent/providers/claude/tool_use.rb

Constant Summary collapse

TRUNCATE_LIMIT =

Truncate long formatted tool-use strings to keep terminal output to generally one line, accounting for logger prefixing.

45

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, input:) ⇒ ToolUse

: (name: Symbol, input: Hash[Symbol, untyped]) -> void



17
18
19
20
# File 'lib/roast/cogs/agent/providers/claude/tool_use.rb', line 17

def initialize(name:, input:)
  @name = name
  @input = input
end

Instance Attribute Details

#inputObject (readonly)

: Hash[Symbol, untyped]



14
15
16
# File 'lib/roast/cogs/agent/providers/claude/tool_use.rb', line 14

def input
  @input
end

#nameObject (readonly)

: Symbol



11
12
13
# File 'lib/roast/cogs/agent/providers/claude/tool_use.rb', line 11

def name
  @name
end

Instance Method Details

#formatObject

: () -> String



23
24
25
26
27
28
# File 'lib/roast/cogs/agent/providers/claude/tool_use.rb', line 23

def format
  format_method_name = "format_#{name}".to_sym
  return send(format_method_name) if respond_to?(format_method_name, true)

  format_unknown
end