mirror of
https://github.com/NandhaKishorM/laya.git
synced 2026-09-28 07:52:57 +08:00
- laya/structured.py: turn a JSON schema or pydantic model into Laya questions (enum/Literal to choice, bool to noul, bounded integer to score) and project answers back to typed values. SchemaError names the offending path; free strings, arrays, nested objects, $ref and over-limit schemas are rejected. Pure stdlib and torch-free. - decide(runner, state, schema=..., return_details=...) plus Agent.decide, Router.decide and ONNXAgent.decide; exported as laya.decide and laya.DecisionResult. pydantic helpers are optional (laya[structured]). - Tests: test_structured.py (45) and test_structured_api.py (35); docs page, README section and Zensical nav. Co-authored-by: Nandakishor <48623612+NandhaKishorM@users.noreply.github.com>