[PR #1773] [CLOSED] fix(docs): Use @tool decorator for retriever in agentic RAG tutorial #1840

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1773
Author: @Shrey327
Created: 12/7/2025
Status: Closed

Base: mainHead: patch-1


📝 Commits (1)

  • 6403af6 fix(docs): Use @tool decorator for retriever in agentic RAG tutorial

📊 Changes

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

View changed files

📝 src/oss/langgraph/agentic-rag.mdx (+10 -8)

📄 Description

The current tutorial uses create_retriever_tool which internally uses functools.partial. When LangGraph's ToolNode tries to inspect the tool with typing.get_type_hints(), it fails because get_type_hints() doesn't work with partial objects. @tool decorator approach creates a proper StructuredTool with inspectable type hints.

Overview

Fixed the agentic RAG tutorial to use the @tool decorator instead of create_retriever_tool, which causes a TypeError when used with LangGraph's ToolNode due to functools.partial incompatibility.

Type of change

Type: Fix typo/bug/link/formatting

Related issues/PRs

  • GitHub issue: N/A (discovered while following the tutorial)
  • Feature PR: N/A

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

Additional notes

The current tutorial code causes a TypeError: functools.partial(...) is not a module, class, method, or function when following the steps. The @tool decorator approach has been tested and works correctly with LangGraph's ToolNode. This is a breaking issue that prevents users from completing the tutorial successfully.


🔄 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/1773 **Author:** [@Shrey327](https://github.com/Shrey327) **Created:** 12/7/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`6403af6`](https://github.com/langchain-ai/docs/commit/6403af653483f872301235b0bb49fb2972b6f9c3) fix(docs): Use @tool decorator for retriever in agentic RAG tutorial ### 📊 Changes **1 file changed** (+10 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langgraph/agentic-rag.mdx` (+10 -8) </details> ### 📄 Description The current tutorial uses create_retriever_tool which internally uses functools.partial. When LangGraph's ToolNode tries to inspect the tool with typing.get_type_hints(), it fails because get_type_hints() doesn't work with partial objects. @tool decorator approach creates a proper StructuredTool with inspectable type hints. ## Overview Fixed the agentic RAG tutorial to use the `@tool` decorator instead of `create_retriever_tool`, which causes a TypeError when used with LangGraph's ToolNode due to functools.partial incompatibility. ## Type of change **Type:** Fix typo/bug/link/formatting ## Related issues/PRs - GitHub issue: N/A (discovered while following the tutorial) - Feature PR: N/A ## Checklist - [x] I have read the [contributing guidelines](README.md) - [ ] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed ## Additional notes The current tutorial code causes a `TypeError: functools.partial(...) is not a module, class, method, or function` when following the steps. The `@tool` decorator approach has been tested and works correctly with LangGraph's ToolNode. This is a breaking issue that prevents users from completing the tutorial successfully. --- <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:47 -05:00
yindo closed this issue 2026-02-17 17:22:47 -05:00
yindo changed title from [PR #1773] fix(docs): Use @tool decorator for retriever in agentic RAG tutorial to [PR #1773] [CLOSED] fix(docs): Use @tool decorator for retriever in agentic RAG tutorial 2026-06-05 18:15:13 -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#1840