[PR #1608] [MERGED] Add support for pydantic v1 state to ToolNode #2182

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraph/pull/1608
Author: @abprime
Created: 9/4/2024
Status: Merged
Merged: 9/5/2024
Merged by: @hinthornw

Base: wfh/pydantictoolnodeHead: main


📝 Commits (4)

  • 3c8f2a8 Add support for pydantic v1 state to ToolNode
  • 01edf88 Merge branch 'main' into main
  • ab164d2 Update typing in tool_node.py
  • 2537d6f Update tools_condition to accept pydantic based State object

📊 Changes

2 files changed (+83 additions, -17 deletions)

View changed files

📝 libs/langgraph/langgraph/prebuilt/tool_node.py (+62 -16)
📝 libs/langgraph/tests/test_prebuilt.py (+21 -1)

📄 Description

This pull request adds support for pydantic v1 state to the ToolNode class. The ToolNode class now accepts an additional input type BaseModel for the input parameter in the _func and _afunc methods.


🔄 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/langgraph/pull/1608 **Author:** [@abprime](https://github.com/abprime) **Created:** 9/4/2024 **Status:** ✅ Merged **Merged:** 9/5/2024 **Merged by:** [@hinthornw](https://github.com/hinthornw) **Base:** `wfh/pydantictoolnode` ← **Head:** `main` --- ### 📝 Commits (4) - [`3c8f2a8`](https://github.com/langchain-ai/langgraph/commit/3c8f2a8056d54924e29574147097ec6ec5efc521) Add support for pydantic v1 state to ToolNode - [`01edf88`](https://github.com/langchain-ai/langgraph/commit/01edf88c39f6e1f2b740d5a557e93c9d27734642) Merge branch 'main' into main - [`ab164d2`](https://github.com/langchain-ai/langgraph/commit/ab164d23c4abac929dc44740dc64b8f5a463f2f1) Update typing in tool_node.py - [`2537d6f`](https://github.com/langchain-ai/langgraph/commit/2537d6f2a396c6bd61aecffb7549645aded9332e) Update tools_condition to accept pydantic based State object ### 📊 Changes **2 files changed** (+83 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `libs/langgraph/langgraph/prebuilt/tool_node.py` (+62 -16) 📝 `libs/langgraph/tests/test_prebuilt.py` (+21 -1) </details> ### 📄 Description This pull request adds support for pydantic v1 state to the ToolNode class. The `ToolNode` class now accepts an additional input type `BaseModel` for the `input` parameter in the `_func` and `_afunc` methods. --- <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-20 17:46:28 -05:00
yindo closed this issue 2026-02-20 17:46:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#2182