Skip to content

Commit 8045f4f

Browse files
committed
docs: clarify Challenge 2 before/after (580 → 80 lines)
1 parent 6420f1c commit 8045f4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/architecture-proposal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ For streaming generators, capture the token before the generator starts and re-e
477477

478478
### 2. Complex Tool Schemas → `agents/creator/schemas.py`
479479

480-
**Problem:** `generate_config` has 11 parameters with 4-5 nesting levels. `@app_agent`'s schema generator only handles primitives. Hand-maintaining 200+ line JSON schemas is fragile.
480+
**Problem:** `generate_config` has 11 parameters with 4-5 nesting levels (tables → column configs, example SQLs → parameters, etc.). `@app_agent`'s schema generator only handles primitives. The monolith defines these schemas as **~580 lines of hand-written JSON** in `create_agent_tools.py` — brittle, hard to maintain, and easy to get out of sync with the runtime code.
481481

482-
**Solution:** Pydantic models that auto-generate JSON Schema via `.model_json_schema()`, passed to `@creator.tool(parameters=...)`:
482+
**Solution:** **~80 lines of Pydantic models** that auto-generate the equivalent JSON Schema via `.model_json_schema()` and double as runtime validation:
483483

484484
```python
485485
from agents.creator.schemas import GenerateConfigArgs
@@ -492,7 +492,7 @@ async def generate_config(**kwargs) -> dict:
492492
args = GenerateConfigArgs(**kwargs) # Validate at runtime
493493
```
494494

495-
Cuts ~580 lines of JSON schema to ~80 lines of Pydantic models, and the schema is always in sync with runtime validation.
495+
580 lines of hand-maintained JSON 80 lines of Pydantic models. Schema and validation are always in sync because they come from the same source.
496496

497497
### 3. Frontend Transparency → `agents/supervisor/proxy.py`
498498

0 commit comments

Comments
 (0)