Tutorials Agents Lab

Debug: Agent Returns Free Text

Advanced AI Evaluated
Context
Common causes of structured output failures: 1. System prompt instruction is too vague — models need an explicit format example 2. The model doesn't support JSON/tool-call mode well 3. Provider JSON mode not configured (some providers need a specific API parameter) 4. Temperature too high — higher temperatures increase randomness, including format randomness Note: The output_contract validates the output AFTER it's received, but it doesn't force the model to produce JSON.

Your Challenge

Your agent has a valid output_contract requiring JSON, but it keeps returning plain English sentences instead. The system prompt says 'Return your answer in JSON format'. List 3 specific, actionable steps you would take to fix this, most likely cause first. For each step, explain WHY it would fix the issue.
Need a hint?

The contract validates output but doesn't control HOW the model generates it. The fix has to happen before the call, not after.

Log in to submit your answer and receive AI feedback.

← Back to Module