[PR #1053] [MERGED] fix: formatting of subagent1 name in multi-agent #1254

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1053
Author: @likith1908
Created: 10/21/2025
Status: Merged
Merged: 10/21/2025
Merged by: @mdrxy

Base: mainHead: patch-1


📝 Commits (3)

  • bc28c65 Fix formatting of subagent1 name in multi-agent.mdx
  • 7a50e8b more
  • 0fc41c0 Merge branch 'main' into patch-1

📊 Changes

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

View changed files

📝 src/oss/langchain/multi-agent.mdx (+5 -5)

📄 Description

Overview

This PR fixes a runtime TypeError raised when importing/running the example agent:

TypeError: tool() got an unexpected keyword argument 'name'

Root cause: the @tool decorator in the example used a name= keyword argument that is not supported by the installed langchain/langchain.tools.tool API. The example now uses the positional name argument form accepted by the library.

Files changed:

  • agents.py — updated the @tool decorator usage to pass the tool name positionally and keep the description via the description= kwarg. No other behavior changed.

Type of change

Type: Bugfix / Documentation fix (example code)

Related issues/PRs

  • N/A

How to reproduce

  1. Ensure OPENAI_API_KEY is set in your environment or be ready to supply it when prompted.
  2. Run the example script:
python3 agents.py

Before the fix the script raised the TypeError immediately during import. After the fix the import proceeds and the interactive demo runs (subject to having the required packages installed).

Files changed

  • agents.py — replace @tool(name="subagent1_name", description=...) with @tool("subagent1_name", description=...).

Checklist

  • I have read the contributing guidelines (if present)
  • I have tested my changes locally using python3 agents.py (interactive demo)
  • All code examples have been tested and work correctly against the local LangChain version used here
  • I have used root-relative paths for internal links (where applicable)
  • I have updated navigation in src/docs.json if needed
  • I have gotten approval from the relevant reviewers

Additional notes

  • This is a low-risk change to example code. If you use a different LangChain version that supports name= as a kwarg, both forms are trivial to swap.
  • If CI/consumers pin a specific langchain version, consider adding a short note in the repo README explaining the supported minimum LangChain version for examples.

If you want, I can open a follow-up to add a unit test or a small script that validates example imports across a matrix of LangChain versions.


🔄 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/1053 **Author:** [@likith1908](https://github.com/likith1908) **Created:** 10/21/2025 **Status:** ✅ Merged **Merged:** 10/21/2025 **Merged by:** [@mdrxy](https://github.com/mdrxy) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (3) - [`bc28c65`](https://github.com/langchain-ai/docs/commit/bc28c65af6c209a77deb0f93f74f2a6f18207055) Fix formatting of subagent1 name in multi-agent.mdx - [`7a50e8b`](https://github.com/langchain-ai/docs/commit/7a50e8bb3666c332016c79ccf8fca21b189afaf7) more - [`0fc41c0`](https://github.com/langchain-ai/docs/commit/0fc41c0fe207ba68f4a6d72e78c0da38690d52bf) Merge branch 'main' into patch-1 ### 📊 Changes **1 file changed** (+5 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/multi-agent.mdx` (+5 -5) </details> ### 📄 Description ## Overview This PR fixes a runtime TypeError raised when importing/running the example agent: ``` TypeError: tool() got an unexpected keyword argument 'name' ``` Root cause: the `@tool` decorator in the example used a `name=` keyword argument that is not supported by the installed `langchain`/`langchain.tools.tool` API. The example now uses the positional name argument form accepted by the library. Files changed: - `agents.py` — updated the `@tool` decorator usage to pass the tool name positionally and keep the description via the `description=` kwarg. No other behavior changed. ## Type of change **Type:** Bugfix / Documentation fix (example code) ## Related issues/PRs - N/A ## How to reproduce 1. Ensure `OPENAI_API_KEY` is set in your environment or be ready to supply it when prompted. 2. Run the example script: ```bash python3 agents.py ``` Before the fix the script raised the TypeError immediately during import. After the fix the import proceeds and the interactive demo runs (subject to having the required packages installed). ## Files changed - `agents.py` — replace `@tool(name="subagent1_name", description=...)` with `@tool("subagent1_name", description=...)`. ## Checklist - [x] I have read the contributing guidelines (if present) - [ ] I have tested my changes locally using `python3 agents.py` (interactive demo) - [ ] All code examples have been tested and work correctly against the local LangChain version used here - [x] I have used root-relative paths for internal links (where applicable) - [ ] I have updated navigation in `src/docs.json` if needed - [ ] I have gotten approval from the relevant reviewers ## Additional notes - This is a low-risk change to example code. If you use a different LangChain version that supports `name=` as a kwarg, both forms are trivial to swap. - If CI/consumers pin a specific langchain version, consider adding a short note in the repo README explaining the supported minimum LangChain version for examples. If you want, I can open a follow-up to add a unit test or a small script that validates example imports across a matrix of LangChain versions. --- <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:01 -05:00
yindo closed this issue 2026-02-17 17:22: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/docs#1254