Simple string substitution of {{step_N}} placeholders (kept for tests).
(args: dict, context: dict[int, StepResult])
| 333 | |
| 334 | |
| 335 | def _resolve_args(args: dict, context: dict[int, StepResult]) -> dict: |
| 336 | """Simple string substitution of {{step_N}} placeholders (kept for tests).""" |
| 337 | resolved = {} |
| 338 | for key, val in args.items(): |
| 339 | if isinstance(val, str): |
| 340 | |
| 341 | def _sub(m: re.Match) -> str: |
| 342 | n = int(m.group(1)) |
| 343 | return context[n].response if n in context else m.group(0) |
| 344 | |
| 345 | resolved[key] = _PLACEHOLDER_RE.sub(_sub, val) |
| 346 | else: |
| 347 | resolved[key] = val |
| 348 | return resolved |
| 349 | |
| 350 | |
| 351 | def _parse_tool_call(raw: str) -> dict: |
no outgoing calls