(value: Any)
| 268 | |
| 269 | |
| 270 | def _coerce_tool_input(value: Any) -> dict[str, Any]: |
| 271 | if isinstance(value, dict): |
| 272 | return value |
| 273 | if isinstance(value, str): |
| 274 | try: |
| 275 | parsed = json.loads(value) |
| 276 | except json.JSONDecodeError: |
| 277 | return {"raw": value} |
| 278 | return parsed if isinstance(parsed, dict) else {"value": parsed} |
| 279 | if value is None: |
| 280 | return {} |
| 281 | return {"value": value} |
| 282 | |
| 283 | |
| 284 | def _walk_dicts(value: Any): |
no outgoing calls
no test coverage detected