Remove bracket tool-call instructions for native mode so models use API tool calling
- SHA
3ba7f7a948d567963e41d008dbf671582e5fe8e8- Parents
-
c66d15b - Tree
1e0e348
3ba7f7a
3ba7f7a948d567963e41d008dbf671582e5fe8e8c66d15b
1e0e348| Status | File | + | - |
|---|---|---|---|
| M |
src/loader/runtime/prompting.py
|
5 | 13 |
| M |
src/loader/runtime/public_shell.py
|
3 | 12 |
src/loader/runtime/prompting.pymodified@@ -360,16 +360,8 @@ def _tool_call_instructions(use_react: bool) -> str: | ||
| 360 | 360 | ] |
| 361 | 361 | ) |
| 362 | 362 | |
| 363 | - return "\n".join( | |
| 364 | - [ | |
| 365 | - "Call tools directly using bracket syntax.", | |
| 366 | - "", | |
| 367 | - "Examples:", | |
| 368 | - '- `[bash: command="pwd"]`', | |
| 369 | - '- `[write: file_path="hello.py", content="print(\'hello\')"]`', | |
| 370 | - ( | |
| 371 | - '- `[TodoWrite: todos=[{content="Run tests", ' | |
| 372 | - 'active_form="Running tests", status="in_progress"}]]`' | |
| 373 | - ), | |
| 374 | - ] | |
| 375 | - ) | |
| 363 | + return ( | |
| 364 | + "Call tools directly when needed. Do not narrate or describe tool " | |
| 365 | + "usage — invoke the tool instead. The runtime handles tool call " | |
| 366 | + "formatting automatically." | |
| 367 | + ) | |
src/loader/runtime/public_shell.pymodified@@ -682,18 +682,9 @@ def build_runtime_few_shot_examples(*, use_react: bool) -> list[Message]: | ||
| 682 | 682 | Message(role=Role.TOOL, content="Created hello.py"), |
| 683 | 683 | Message(role=Role.ASSISTANT, content="Done."), |
| 684 | 684 | ] |
| 685 | - return [ | |
| 686 | - Message( | |
| 687 | - role=Role.USER, | |
| 688 | - content="Create a file called hello.py that prints hello", | |
| 689 | - ), | |
| 690 | - Message( | |
| 691 | - role=Role.ASSISTANT, | |
| 692 | - content='[write: file_path="hello.py", content="print(\'hello\')"]', | |
| 693 | - ), | |
| 694 | - Message(role=Role.TOOL, content="Created hello.py"), | |
| 695 | - Message(role=Role.ASSISTANT, content="Done."), | |
| 696 | - ] | |
| 685 | + # Native tool calling: no text-based few-shot examples needed. | |
| 686 | + # The model uses the API tool-calling mechanism directly. | |
| 687 | + return [] | |
| 697 | 688 | |
| 698 | 689 | |
| 699 | 690 | def _copy_rule_counts(rule_counts: dict[str, int]) -> dict[str, int]: |