[PR #1067] [MERGED] langgraph[patch]: InjectedState annotation #1865

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraph/pull/1067
Author: @baskaryan
Created: 7/18/2024
Status: Merged
Merged: 7/19/2024
Merged by: @baskaryan

Base: mainHead: bagatur/state_annotation


📝 Commits (9)

📊 Changes

7 files changed (+277 additions, -90 deletions)

View changed files

📝 docs/docs/reference/prebuilt.md (+10 -1)
📝 examples/pass-run-time-values-to-tools.ipynb (+42 -63)
📝 libs/langgraph/langgraph/prebuilt/__init__.py (+2 -1)
📝 libs/langgraph/langgraph/prebuilt/tool_node.py (+149 -10)
📝 libs/langgraph/poetry.lock (+1 -1)
📝 libs/langgraph/pyproject.toml (+1 -1)
📝 libs/langgraph/tests/test_prebuilt.py (+72 -13)

📄 Description


    def tool3(some_val: int, foo: Annotated[str, InjectedState("foo")]) -> str:
        """Tool 1 docstring."""
        return foo

    tool_call = {
        "name": "tool3",
        "args": {"some_val": 1},
        "id": "some 0",
        "type": "tool_call",
    }
    msg = AIMessage("hi?", tool_calls=[tool_call])
    result = node.invoke({"messages": [msg], "foo": "bar"})
    tool_message: ToolMessage = result["messages"][-1]
    assert tool_message.content == "bar"


🔄 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/1067 **Author:** [@baskaryan](https://github.com/baskaryan) **Created:** 7/18/2024 **Status:** ✅ Merged **Merged:** 7/19/2024 **Merged by:** [@baskaryan](https://github.com/baskaryan) **Base:** `main` ← **Head:** `bagatur/state_annotation` --- ### 📝 Commits (9) - [`04300c9`](https://github.com/langchain-ai/langgraph/commit/04300c9b690adefd57e82600591d33d0eb9c0357) wip - [`d1c46db`](https://github.com/langchain-ai/langgraph/commit/d1c46dba290b66a27893c6733175118a652faada) fmt - [`e922942`](https://github.com/langchain-ai/langgraph/commit/e9229422ff4c92ab5fda5a34447572dffa7d5582) fmt - [`1c20142`](https://github.com/langchain-ai/langgraph/commit/1c20142206f801d2c488a999cbd6ea9798f29868) Merge branch 'main' into bagatur/state_annotation - [`cc19cc2`](https://github.com/langchain-ai/langgraph/commit/cc19cc29c9a57e2e1b27d3a38c46a1e1ed3ec5dc) fmt - [`5b7205c`](https://github.com/langchain-ai/langgraph/commit/5b7205c03ff8cee71e73f4d8554153c301169dd5) fmt - [`d6ce8f1`](https://github.com/langchain-ai/langgraph/commit/d6ce8f1d26317c6869b13b2c211876d05ea8dec2) fmt - [`3fefc0f`](https://github.com/langchain-ai/langgraph/commit/3fefc0f1307a2434ff0ea1a706cbadcf8f34136e) poetry - [`8be9691`](https://github.com/langchain-ai/langgraph/commit/8be9691762ce194573d3623ffc45dab364fe065c) fmt ### 📊 Changes **7 files changed** (+277 additions, -90 deletions) <details> <summary>View changed files</summary> 📝 `docs/docs/reference/prebuilt.md` (+10 -1) 📝 `examples/pass-run-time-values-to-tools.ipynb` (+42 -63) 📝 `libs/langgraph/langgraph/prebuilt/__init__.py` (+2 -1) 📝 `libs/langgraph/langgraph/prebuilt/tool_node.py` (+149 -10) 📝 `libs/langgraph/poetry.lock` (+1 -1) 📝 `libs/langgraph/pyproject.toml` (+1 -1) 📝 `libs/langgraph/tests/test_prebuilt.py` (+72 -13) </details> ### 📄 Description ```python def tool3(some_val: int, foo: Annotated[str, InjectedState("foo")]) -> str: """Tool 1 docstring.""" return foo tool_call = { "name": "tool3", "args": {"some_val": 1}, "id": "some 0", "type": "tool_call", } msg = AIMessage("hi?", tool_calls=[tool_call]) result = node.invoke({"messages": [msg], "foo": "bar"}) tool_message: ToolMessage = result["messages"][-1] assert tool_message.content == "bar" ``` --- <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:45:44 -05:00
yindo closed this issue 2026-02-20 17:45:44 -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#1865