[PR #2497] [MERGED] docs: add warning for NoneType return when combining tools with structured_output #2486

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/2497
Author: @chandra-prakash-94
Created: 2/5/2026
Status: Merged
Merged: 2/6/2026
Merged by: @lnhsingh

Base: mainHead: docs/gemini-structured-output-fix


📝 Commits (6)

  • 18cead3 docs: add warning for NoneType return when using tools with structured_output
  • 6058897 docs: add python markup
  • f3989b6 docs: upd minor code snippets
  • ee28662 docs: update warning sign
  • 8b1a6b4 Update warning about structured output usage
  • 7ebcdf9 Fix formatting of section headers in documentation

📊 Changes

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

View changed files

📝 src/oss/python/integrations/chat/google_generative_ai.mdx (+36 -0)

📄 Description

Overview

Added a warning and best-practice example to the ChatGoogleGenerativeAI documentation regarding the use of with_structured_output. This addresses a common issue where passing additional tools (like Google Search) directly into a structured output call causes the model to return a tool call instead of the expected schema, resulting in an AttributeError: 'NoneType' object has no attribute

Type of change

Type: Update existing documentation


🔄 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/2497 **Author:** [@chandra-prakash-94](https://github.com/chandra-prakash-94) **Created:** 2/5/2026 **Status:** ✅ Merged **Merged:** 2/6/2026 **Merged by:** [@lnhsingh](https://github.com/lnhsingh) **Base:** `main` ← **Head:** `docs/gemini-structured-output-fix` --- ### 📝 Commits (6) - [`18cead3`](https://github.com/langchain-ai/docs/commit/18cead3bead56b231a3f95bb029ff00c2ec32446) docs: add warning for NoneType return when using tools with structured_output - [`6058897`](https://github.com/langchain-ai/docs/commit/605889743f5c814d321b6dcf7a13864ffb3154b3) docs: add python markup - [`f3989b6`](https://github.com/langchain-ai/docs/commit/f3989b672253a509a4c1e2cca77e83fd6fecba68) docs: upd minor code snippets - [`ee28662`](https://github.com/langchain-ai/docs/commit/ee2866242b6654684cf750905b853cfaec924559) docs: update warning sign - [`8b1a6b4`](https://github.com/langchain-ai/docs/commit/8b1a6b4306b98415bb0c1f24f05f575dd4731c00) Update warning about structured output usage - [`7ebcdf9`](https://github.com/langchain-ai/docs/commit/7ebcdf96a82913dd010da5aaec7367f8f5da7f44) Fix formatting of section headers in documentation ### 📊 Changes **1 file changed** (+36 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/python/integrations/chat/google_generative_ai.mdx` (+36 -0) </details> ### 📄 Description ## Overview Added a warning and best-practice example to the ChatGoogleGenerativeAI documentation regarding the use of with_structured_output. This addresses a common issue where passing additional tools (like Google Search) directly into a structured output call causes the model to return a tool call instead of the expected schema, resulting in an AttributeError: 'NoneType' object has no attribute ## Type of change **Type:** Update existing documentation --- <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:23:28 -05:00
yindo closed this issue 2026-02-17 17:23:28 -05:00
yindo changed title from [PR #2497] docs: add warning for NoneType return when combining tools with structured_output to [PR #2497] [MERGED] docs: add warning for NoneType return when combining tools with structured_output 2026-06-05 18:18:50 -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#2486