Commit 1089929
authored
## Overview
Fixed the agentic RAG tutorial to use the `@tool` decorator instead of
`create_retriever_tool`. The previous approach caused a `TypeError` when
used with LangGraph's `ToolNode` because `create_retriever_tool` returns
a `functools.partial` object, which is incompatible with
`typing.get_type_hints()`.
## Type of change
**Type:** Fix typo/bug/link/formatting
## Related issues/PRs
- GitHub issue: N/A
- 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 issue manifests as: `TypeError: functools.partial(...) is not a
module, class, method, or function` during graph compilation/execution.
The `@tool` decorator creates a proper `StructuredTool` that `ToolNode`
can correctly inspect.
1 parent 110d036 commit 1089929
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| |||
0 commit comments