解析工具输入 — 源码 hooks.rs:214-216
(tool_input: str)
| 421 | |
| 422 | |
| 423 | def _parse_tool_input(tool_input: str) -> Any: |
| 424 | """解析工具输入 — 源码 hooks.rs:214-216""" |
| 425 | try: |
| 426 | return json.loads(tool_input) |
| 427 | except json.JSONDecodeError: |
| 428 | return {"raw": tool_input} |
| 429 | |
| 430 | |
| 431 | # ============================================================ |