[langchain]: Update the tool execution loop example on how to call the tools after model returns the tolls list
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 82/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- documentation
Research direction
Open the Models page linked in the issue and locate the tool loop execution example. Read the section around Step 2 and update the example so it handles the returned tool call name before invoking get_weather. Done means the documentation accurately reflects how to execute the listed tool calls without changing the surrounding workflow.
Written by the indexing model from the issue text.
Description
Type of issue
issue / bug
Language
Python
Description
There is an issue in the documentation for Tool calling in Models Page. Under tool loop execution, the model on invoke it returns the tool calls that has to be executed. But in the example, it is calling the get_weather tool without checking if the tool call name is get_weather.
# Step 2: Execute tools and collect results
for tool_call in ai_msg.tool_calls:
# Execute the tool with the generated arguments
tool_result = get_weather.invoke(tool_call)
messages.append(tool_result)
But it should check before calling the tool and it should be something like:
# Step 2: Execute tools and collect results
for tool_call in ai_msg.tool_calls:
# Execute the tool with the generated arguments
if tool_call["name"] == "get_weather":
tool_result = get_weather.invoke(tool_call)
messages.append(tool_result)
- Dominant language
- MDX
- Stars
- 418
- Forks
- 2.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 351
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from langchain-ai/docs
-
external langgraph
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
langchain-ai/docs#6121 ·
-
external
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
langchain-ai/docs#6113 · 1 comment ·
-
external
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/docs#6101 ·
-
external integration integration-submission
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
langchain-ai/docs#6096 ·
-
[langchain]: Update the AgentCore Runtime section on the AWS provider page for the new AgentCore CLI Openexternal
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
langchain-ai/docs#6091 ·
All issues in langchain-ai/docs
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Opencategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficulty 1/5 Under an hour Newbie friendliness 84/100