Minimal PlanningContext stub for tool tests.
| 57 | |
| 58 | |
| 59 | class FakePlanningContext: |
| 60 | """Minimal PlanningContext stub for tool tests.""" |
| 61 | |
| 62 | def __init__(self, tool_names: list[str] | None = None): |
| 63 | self.tool_manager = FakeToolManager(tool_names) |
| 64 | self._saved_plans: dict[str, dict] = {} |
| 65 | |
| 66 | async def get_tool_catalog(self) -> list[dict[str, Any]]: |
| 67 | tools, _ = await self.tool_manager.get_adapted_tools_for_llm("openai") |
| 68 | return tools |
| 69 | |
| 70 | async def save_plan_from_dict(self, plan_dict: dict[str, Any]) -> str: |
| 71 | plan_id = f"plan-{len(self._saved_plans) + 1}" |
| 72 | self._saved_plans[plan_id] = plan_dict |
| 73 | return plan_id |
| 74 | |
| 75 | async def get_plan(self, plan_id: str) -> dict[str, Any] | None: |
| 76 | return self._saved_plans.get(plan_id) |
| 77 | |
| 78 | |
| 79 | # ── Tests: tool definitions ────────────────────────────────────────────────── |
no outgoing calls