Solution skill
[BUG] CrewAI >= 1.4.0 - Structured outputs no longer working with azure models
Complete solution
Shows how to fix [BUG] CrewAI >= 1.4.0 - Structured outputs no longer working with azure models. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For "ERROR:root:Azure API call failed: Unsupported": issue crewAIInc/crewAI#3906 (closed, 17 comments): ### Description After updating to crewai 1.4.1, I can no longer use structured outputs with my Azure models I always get this error: ` ERROR:root:Azure API call failed: Unsupported response_format {'type': 'json\_schema', 'json\_schema': {[MYJSONSCHEMA]}
ERROR:root:Azure API call failed: UnsupportedSteps
- Issue crewAIInc/crewAI#3906 (closed, 17 comments): ### Description After updating to crewai 1.4.1, I can no longer use structured outputs with my Azure models I always get this error:
2. Contributor Vidit-Ostwal patched the regression in PR #3910. Reporter-confirmed workaround: declare the structured-output Pydantic model with extra='forbid', e.g. class Greeting(BaseModel, extra='forbid'): ... - reporter LouisLecouturier confirmed 'It works!', and Vidit-Ostwal added the field explicitly in the fix branch so the manual workaround is no longer needed.
## When to use
Use this skill when you run into "[BUG] CrewAI >= 1.4.0 - Structured outputs no longer working with azure models".
## When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
## Versions
Versions mentioned in the source: crewai 1.4.1. If you are on something much newer or older, the details may have shifted.
## Variants
Other phrasings of the same problem that show up in reports:
### `` ERROR:root:Azure API call failed: Unsupported response_format {'type': 'json\_schema', 'json\_schema': {[MYJSONSCHEMA
```text
``` ERROR:root:Azure API call failed: Unsupported `response_format` {'type': 'json_schema', 'json_schema': {[MYJSONSCHEMA]} ```Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In gh:crewAIInc/crewAI#3906 (https://github.com/crewAIInc/crewAI/issues/3906), someone reported: Issue crewAIInc/crewAI#3906 (closed, 17 comments): ### Description After updating to crewai 1.4.1, I can no longer use structured outputs with my Azure models I always get this error: `` ERROR:root:Azure API call failed: Unsupported responseformat` {'type': 'jsonschema', 'json_schema': {[MYJSONSCHEMA]} `` ### Steps to Reproduce 1. Use crewai[azure-ai-inference] 1.4.1 2. Use an Azure model 3. Create an agent or call a Azure LLM with a pydantic model as response format ### Expected behavior It should just return the structured response as written in the docs ### Screenshots/Code snippets ``py from crewai import LLM, Agent from dotenv impor The verified resolution from the thread: Contributor Vidit-Ostwal patched the regression in PR #3910. Reporter-confirmed workaround: declare the structured-output Pydantic model with extra='forbid', e.g. class Greeting(BaseModel, extra='forbid'): ... - reporter LouisLecouturier confirmed 'It works!', and Vidit-Ostwal added the field explicitly in the fix branch so the manual workaround is no longer needed.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_H8zep9GEQueqA5b26S7OTg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[BUG] CrewAI >= 1.4.0 - Structured outputs no longer working with azure models <span>— Vectle</span></a>