Skip to content

Commit ba38997

Browse files
authored
docs: add tool_calls attribute link in tool calling documentation and indicate output is a list in code example (#31689)
- Minor QOL improvements: - Add link to tool_calls api ref - Show code example output as a list to more clearly indicate response type
1 parent 6437414 commit ba38997

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/concepts/tool_calling.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ result = llm_with_tools.invoke("What is 2 multiplied by 3?")
114114
```
115115

116116
As before, the output `result` will be an `AIMessage`.
117-
But, if the tool was called, `result` will have a `tool_calls` attribute.
117+
But, if the tool was called, `result` will have a `tool_calls` [attribute](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.ai.AIMessage.html#langchain_core.messages.ai.AIMessage.tool_calls).
118118
This attribute includes everything needed to execute the tool, including the tool name and input arguments:
119119

120120
```
121121
result.tool_calls
122-
{'name': 'multiply', 'args': {'a': 2, 'b': 3}, 'id': 'xxx', 'type': 'tool_call'}
122+
[{'name': 'multiply', 'args': {'a': 2, 'b': 3}, 'id': 'xxx', 'type': 'tool_call'}]
123123
```
124124

125125
For more details on usage, see our [how-to guides](/docs/how_to/#tools)!

0 commit comments

Comments
 (0)