laravel/ai

Structured output validation

Open

#189 aperta il 19 feb 2026

Vedi su GitHub
 (4 commenti) (2 reazioni) (0 assegnatari)PHP (261 fork)github user discovery
help wantedneeds more info

Metriche repository

Star
 (978 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor