[PR #1404] [MERGED] docs: wrap JSON schema example in ProviderStrategy to fix bug #1542

Closed
opened 2026-02-17 17:22:28 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1404
Author: @davidsilva2841
Created: 11/13/2025
Status: Merged
Merged: 11/13/2025
Merged by: @lnhsingh

Base: mainHead: patch-1


📝 Commits (1)

  • b371f5b docs: wrap JSON schema example in ProviderStrategy to fix auto ToolStrategy bug

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/oss/langchain/structured-output.mdx (+1 -1)

📄 Description

Overview

Previously, the documentation showed passing a raw JSON schema to response_format in create_agent, which could trigger a ValueError when LangChain auto-selected ToolStrategy instead of ProviderStrategy.

This update wraps the contact_info_schema in ProviderStrategy to ensure provider-native structured output is used and the example runs correctly with models that support JSON schema output (e.g. gpt-5).

Type of change

Type: Fix typo/bug/link/formatting

Related issues/PRs

Examples:

Checklist

  • [x ] I have read the contributing guidelines
  • [N/A ] I have tested my changes locally using docs dev
  • [x ] All code examples have been tested and work correctly
  • [ N/A] I have used root relative paths for internal links
  • [N/A ] I have updated navigation in src/docs.json if needed
  • I have gotten approval from the relevant reviewers
  • (Internal team members only / optional) I have created a preview deployment using the Create Preview Branch workflow

Additional notes

The original docs say it should auto select the strategy. If that's true, then I think there's a bug in the python code that needs to be addressed. This change just updates the documentation so the example works.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/1404 **Author:** [@davidsilva2841](https://github.com/davidsilva2841) **Created:** 11/13/2025 **Status:** ✅ Merged **Merged:** 11/13/2025 **Merged by:** [@lnhsingh](https://github.com/lnhsingh) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`b371f5b`](https://github.com/langchain-ai/docs/commit/b371f5b85f9abdb8c5bd3473bbe5863bef320884) docs: wrap JSON schema example in ProviderStrategy to fix auto ToolStrategy bug ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/structured-output.mdx` (+1 -1) </details> ### 📄 Description ## Overview Previously, the documentation showed passing a raw JSON schema to `response_format` in `create_agent`, which could trigger a ValueError when LangChain auto-selected ToolStrategy instead of ProviderStrategy. This update wraps the `contact_info_schema` in `ProviderStrategy` to ensure provider-native structured output is used and the example runs correctly with models that support JSON schema output (e.g. gpt-5). ## Type of change **Type:** Fix typo/bug/link/formatting ## Related issues/PRs Examples: - GitHub issue: https://github.com/langchain-ai/docs/issues/1420#issuecomment-3528899265 ## Checklist <!-- Put an 'x' in all boxes that apply --> - [x ] I have read the [contributing guidelines](README.md) - [N/A ] I have tested my changes locally using `docs dev` - [x ] All code examples have been tested and work correctly - [ N/A] I have used **root relative** paths for internal links - [N/A ] I have updated navigation in `src/docs.json` if needed - I have gotten approval from the relevant reviewers - (Internal team members only / optional) I have created a preview deployment using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml) ## Additional notes The original docs say it should auto select the strategy. If that's true, then I think there's a bug in the python code that needs to be addressed. This change just updates the documentation so the example works. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:22:28 -05:00
yindo closed this issue 2026-02-17 17:22:28 -05:00
yindo changed title from [PR #1404] docs: wrap JSON schema example in ProviderStrategy to fix bug to [PR #1404] [MERGED] docs: wrap JSON schema example in ProviderStrategy to fix bug 2026-06-05 18:13:33 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1542