Skip to content

Commit 6343a54

Browse files
committed
Trying to get the docs to ship
1 parent feaba6a commit 6343a54

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ AllCops:
1111
TargetRubyVersion: 3.3
1212
NewCops: enable
1313
SuggestExtensions: false
14+
Exclude:
15+
- "test/dummy/tmp/**/*"
16+
- "node_modules/**/*"
17+
- "vendor/**/*"
1418

1519
Style/StringLiterals:
1620
EnforcedStyle: double_quotes

lib/active_agent/providers/common/messages/_types.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,15 @@ def split_content_blocks(message)
142142
Common::Messages::Assistant.new(role: "assistant", content: block[:text], name: message.name)
143143
when "tool_use"
144144
# Create a message with tool use info as string representation
145-
tool_info = "[Tool Use: #{block[:name]}]\nID: #{block[:id]}\nInput: #{JSON.pretty_generate(block[:input])}"
145+
input = block[:input]
146+
input_str = input.nil? || input.empty? ? "{}" : JSON.pretty_generate(input)
147+
tool_info = "[Tool Use: #{block[:name]}]\nID: #{block[:id]}\nInput: #{input_str}"
146148
Common::Messages::Assistant.new(role: "assistant", content: tool_info, name: message.name)
147149
when "mcp_tool_use"
148150
# Create a message with MCP tool use info
149-
tool_info = "[MCP Tool Use: #{block[:name]}]\nID: #{block[:id]}\nServer: #{block[:server_name]}\nInput: #{JSON.pretty_generate(block[:input] || {})}"
151+
input = block[:input]
152+
input_str = input.nil? || input.empty? ? "{}" : JSON.pretty_generate(input)
153+
tool_info = "[MCP Tool Use: #{block[:name]}]\nID: #{block[:id]}\nServer: #{block[:server_name]}\nInput: #{input_str}"
150154
Common::Messages::Assistant.new(role: "assistant", content: tool_info, name: message.name)
151155
when "mcp_tool_result"
152156
# Create a message with MCP tool result

0 commit comments

Comments
 (0)