[PR #1148] [CLOSED] Correct withStructuredOutput usage in plan-and-execute example #1262

Closed
opened 2026-02-15 20:15:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1148
Author: @adouz
Created: 5/4/2025
Status: Closed

Base: mainHead: fix/withStructuredOutput-examples


📝 Commits (2)

  • 88a2bee Fix: Correct withStructuredOutput example to use planFunction.parameters
  • c42e403 update execution_count

📊 Changes

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

View changed files

📝 examples/plan-and-execute/plan-and-execute.ipynb (+1 -1)

📄 Description

The plan-and-excute example currently passes the entire planFunction object to withStructuredOutput, which results in the model returning unparsed JSON.

This PR updates the example to correctly pass only planFunction.parameters — the actual JSON schema expected by withStructuredOutput — ensuring the model produces properly parsed structured


🔄 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/langgraphjs/pull/1148 **Author:** [@adouz](https://github.com/adouz) **Created:** 5/4/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/withStructuredOutput-examples` --- ### 📝 Commits (2) - [`88a2bee`](https://github.com/langchain-ai/langgraphjs/commit/88a2bee4b9e0a5f93cc8e1ee339a67549e3f50a1) Fix: Correct withStructuredOutput example to use planFunction.parameters - [`c42e403`](https://github.com/langchain-ai/langgraphjs/commit/c42e403c4a2af8262b0296aa02162e37069b7e5d) update execution_count ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `examples/plan-and-execute/plan-and-execute.ipynb` (+1 -1) </details> ### 📄 Description <!-- Thank you for contributing to LangGraph.js! Your PR will appear in our next release under the title you set above. Please make sure it highlights your valuable contribution. To help streamline the review process, please make sure you read our contribution guidelines: https://github.com/langchain-ai/langgraphjs/blob/main/CONTRIBUTING.md Replace this block with a description of the change, the issue it fixes (if applicable), and relevant context. Finally, we'd love to show appreciation for your contribution - if you'd like us to shout you out on Twitter, please also include your handle below! --> <!-- Remove if not applicable --> The plan-and-excute example currently passes the entire `planFunction` object to `withStructuredOutput`, which results in the model returning unparsed JSON. This PR updates the example to correctly pass only `planFunction.parameters` — the actual JSON schema expected by `withStructuredOutput` — ensuring the model produces properly parsed structured --- <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-15 20:15:01 -05:00
yindo closed this issue 2026-02-15 20:15:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1262