langchain - ✅(Solved) Fix GPT-5-2-pro model profile structured_output to False [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#35215Fetched 2026-04-08 00:27:11
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×3closed ×1cross-referenced ×1issue_type_added ×1

gpt-5.2-pro does not support structured output; the profile needs to be updated.

Error Message

Error Message and Stack Trace (if applicable)

Root Cause

gpt-5.2-pro does not support structured output; the profile needs to be updated.

Fix Action

Fix / Workaround

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

PR fix notes

PR #910: fix: gpt 5-2-pro does not support structured output

Description (problem / solution / changelog)

GPT-5-2 does not support structured output as per the official OpenAI Docs: https://developers.openai.com/api/docs/models/gpt-5.2

Changed files

  • providers/openai/models/gpt-5.2-pro.toml (modified, +1/-1)

Code Example

N/A

---

N/A
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

Related PR in models.dev: https://github.com/anomalyco/models.dev/pull/910 (Merged)

Reproduction Steps / Example Code (Python)

N/A

Error Message and Stack Trace (if applicable)

N/A

Description

gpt-5.2-pro does not support structured output; the profile needs to be updated.

System Info

N/A

extent analysis

Problem Summary

Update LangChain model profile to support structured output.

Root Cause Analysis

The issue is caused by the gpt-5.2-pro model not supporting structured output, which requires an updated model profile.

Fix Plan

Step 1: Update LangChain model profile

Update the model profile to support structured output. You can do this by creating a new profile or updating an existing one.

Step 2: Use the updated model profile

Use the updated model profile in your LangChain code.

Step 3: Example code (Python)

from langchain import LLM

# Create a new model profile that supports structured output
profile = {
    "name": "gpt-5.2-pro",
    "model": "text-davinci-003",
    "output": "json"
}

# Create an LLM instance with the updated profile
llm = LLM(profile)

# Use the LLM instance to generate text with structured output
result = llm.execute("What is the capital of France?")
print(result)

Verification

To verify that the fix worked, check that the LLM instance is generating text with structured output.

Extra Tips

  • Make sure to update the model profile to support structured output.
  • Use the updated model profile in your LangChain code.
  • Test the LLM instance to ensure it is generating text with structured output.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - ✅(Solved) Fix GPT-5-2-pro model profile structured_output to False [1 pull requests, 1 participants]