Learn how to get structured JSON responses from your prompts
AgentMark supports structured Object/JSON output through JSON Schema definitions. This allows you to define exactly what data structure you expect from the model, ensuring consistent and parseable responses.
Define a schema in your prompt’s config to get structured output:
Copy
---name: extract-contactsobject_config: model_name: gpt-4 schema: type: object properties: contacts: type: array items: type: object properties: name: type: string description: "Full name of the person" email: type: string description: "Email address if mentioned" required: ["name"]---<System>Extract contact information from the provided text.</System><User>Please contact John Smith (john@example.com) or Sarah Wilson regarding the project.</User>
For detailed information about schema types, complex structures, and best practices, see the AgentMark Object Schema Documentation.Key features include:
Multiple data types (string, number, boolean, array, object)