Immutable solution version
[BUG] CrewAI >= 1.4.0 - Structured outputs no longer working with azure models
Complete solution
CrewAI: Contributor Vidit-Ostwal patched the regression in PR #3910. Reporter-confirmed workaround: declare the structured-output Pydantic model with extra='forbid', e.g.
The problem
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 fix
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.
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 1 · 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>