laravel/ai

Structured output validation

Open

#189 创建于 2026年2月19日

在 GitHub 查看
 (4 评论) (2 反应) (0 负责人)PHP (261 fork)github user discovery
help wantedneeds more info

仓库指标

Star
 (978 star)
PR 合并指标
 (平均合并 6天 11小时) (30 天内合并 49 个 PR)

描述

Hi

I am a bit new to laravel/ai but I have a question regarding agents that implements HasStructuredOutput

If the structured format of the StructuredAgentResponse doesn't follow the format defined in the schema - shouldn't an exception be thrown? Should this happen on the Prism level, the Laravel/Ai level - or am I supposed to do this myself?

I don't really see any point in structured output if I have no guarantee that the result will conform to my schema.

贡献者指南