Structured Output Playground
Test structured output generation with different Zod schemas, models, and view results visually or as JSON.
Analyze text sentiment with confidence score
z.object({
sentiment: z.enum(['positive', 'negative', 'neutral', 'mixed']),
confidence: z.number().min(0).max(1),
summary: z.string(),
keywords: z.array(z.string()).nullable(),
})Click "Run Analysis" to see results
Code Example
import { createStructuredOutput, schemas } from 'agent-tools-kit/structured'
const result = await createStructuredOutput({
model: 'openai/gpt-4o-mini',
schema: schemas.sentiment,
prompt: 'I absolutely love this product! It has changed my ...',
})
console.log(result.data) // Type-safe: z.infer<typeof schemas.sentiment>