Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/oss/langchain/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,31 @@ Models can request to call tools that perform tasks such as fetching data from a
You may hear the term "function calling". We use this interchangeably with "tool calling".
</Note>

Here's the basic tool calling flow:

```mermaid
sequenceDiagram
participant U as User
participant M as Model
participant T as Tools

U->>M: "What's the weather in SF and NYC?"
M->>M: Analyze request & decide tools needed

par Parallel Tool Calls
M->>T: get_weather("San Francisco")
M->>T: get_weather("New York")
end

par Tool Execution
T-->>M: SF weather data
T-->>M: NYC weather data
end

M->>M: Process results & generate response
M->>U: "SF: 72°F sunny, NYC: 68°F cloudy"
Comment on lines +529 to +548
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The diagram lacks consistent styling found in other Mermaid diagrams throughout the documentation. Consider adding an init block with fontFamily, curve settings, and themeVariables as seen in agents.mdx and short-term-memory.mdx (e.g., %%{ init: { "fontFamily": "monospace", "themeVariables": {"edgeLabelBackground": "transparent"} } }%%).

Copilot uses AI. Check for mistakes.
```

:::python
To make tools that you have defined available for use by a model, you must bind them using @[`bind_tools()`][BaseChatModel.bind_tools]. In subsequent invocations, the model can choose to call any of the bound tools as needed.
:::
Expand Down