Skip to content

Commit 908c441

Browse files
author
jer
committed
feat(agents-as-tools): pr comments
1 parent 4bb1540 commit 908c441

File tree

4 files changed

+718
-573
lines changed

4 files changed

+718
-573
lines changed

src/strands/tools/agent_tool_wrapper.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, agent: "Agent"):
2929
self._description = agent.description or ""
3030

3131
def _validate_agent(self) -> None:
32-
# Check if agent has the required attributes and they are properly set
32+
"""Check if agent has the required attributes and they are properly set."""
3333
if (
3434
not hasattr(self._agent, "name")
3535
or not hasattr(self._agent, "description")
@@ -57,10 +57,8 @@ def tool_spec(self) -> ToolSpec:
5757
description=self._description,
5858
inputSchema={
5959
"type": "object",
60-
"properties": {
61-
"query": {"type": "string", "description": "The query or task to send to the sub-agent"}
62-
},
63-
"required": ["query"],
60+
"properties": {"prompt": {"type": "string", "description": "The prompt to send to the sub-agent"}},
61+
"required": ["prompt"],
6462
},
6563
)
6664

@@ -81,11 +79,11 @@ async def stream(self, tool_use: ToolUse, invocation_state: dict[str, Any], **kw
8179
Tool events with the last being the tool result
8280
"""
8381
try:
84-
# Extract the query from tool input
85-
query = tool_use["input"].get("query", "")
82+
# Extract the prompt from tool input
83+
prompt = tool_use["input"].get("prompt", "")
8684

8785
# Invoke the sub-agent
88-
result = await self._agent.invoke_async(query)
86+
result = await self._agent.invoke_async(prompt)
8987

9088
# Convert agent response to tool result format
9189
tool_result = ToolResult(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy