Skip to content

Commit ddc141e

Browse files
authored
Merge pull request #3 from yanliqing/feature/params-description-fix
fix some descriptions about fastanp params
2 parents 7d1d49d + 9e02a2b commit ddc141e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/local_agent_use_llm.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ def _build_system_prompt(self) -> str:
8585
return (
8686
f"You are an orchestration agent controlling ANPCrawler to interact with a remote ANP "
8787
f"service located at {self.agent_description_url}. Always begin by calling the fetch_text tool on the "
88-
f"agent description URL {self.agent_description_url} to discover available interfaces. When invoking "
89-
f"execute_tool_call, wrap remote parameters inside the 'params' key if required by the "
90-
f"target interface. Respond with concise JSON-formattable conclusions once you have the "
88+
f"agent description URL {self.agent_description_url} to discover available interfaces. "
89+
f"CRITICAL: When invoking execute_tool_call, you MUST wrap ALL parameters inside a 'params' key. "
90+
f"For example, to call echo with message 'Hello', use: "
91+
f'{{"tool_name": "echo", "arguments": {{"params": {{"message": "Hello"}}}}}}. '
92+
f"The 'arguments' field must always be an object containing a 'params' key. "
93+
f"Respond with concise JSON-formattable conclusions once you have the "
9194
f"necessary information. Avoid guessing and rely on the provided tools."
9295
)
9396

@@ -123,9 +126,12 @@ def _build_tool_definitions(self) -> list[dict[str, Any]]:
123126
"function": {
124127
"name": "execute_tool_call",
125128
"description": (
126-
"Execute a remote interface discovered via ANPCrawler. Ensure you pass "
127-
"arguments that match the interface schema, typically nested under "
128-
"'params'."
129+
"Execute a remote interface discovered via ANPCrawler. "
130+
"IMPORTANT: All parameters MUST be wrapped in a 'params' key. "
131+
"For example, to call 'echo' with message 'Hello', use: "
132+
'{"tool_name": "echo", "arguments": {"params": {"message": "Hello"}}}. '
133+
"The 'arguments' field must always contain a 'params' object that matches "
134+
"the interface's parameter schema."
129135
),
130136
"parameters": {
131137
"type": "object",

0 commit comments

Comments
 (0)