YUNOVA · AI Agents · Module 5: Prompt design for agents
Structured output: JSON from the model
Structured output: JSON from the model
Key points
- Structured output में model से तय format, जैसे JSON, में जवाब माँगा जाता है ताकि code उसे सीधे पढ़ सके।
- Prompt में fields के नाम, types और एक उदाहरण दें; कई APIs JSON Schema देकर format लागू करने की सुविधा भी देते हैं।
- Model के output को code में parse और validate करें, और गलत होने पर दोबारा माँगने की व्यवस्था रखें।