docs: add tool use diagrams (#16207)

pull/16209/head
Bagatur 9 months ago committed by GitHub
parent 7d444724d7
commit 27ad65cc68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -13,7 +13,9 @@
{
"cell_type": "markdown",
"id": "1925a807-fa01-44bc-8a03-d9907311c7f9",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"## Agents\n",
"\n",
@ -21,7 +23,9 @@
"\n",
"LangChain comes with a number of built-in agents that are optimized for different use cases. Read about all the [agent types here](/docs/modules/agents/agent_types/).\n",
"\n",
"As an example, let's try out the OpenAI tools agent, which makes use of the new OpenAI tool-calling API (this is only available in the latest OpenAI models, and differs from function-calling in that the model can return multiple function invocations at once):"
"As an example, let's try out the OpenAI tools agent, which makes use of the new OpenAI tool-calling API (this is only available in the latest OpenAI models, and differs from function-calling in that the model can return multiple function invocations at once).\n",
"\n",
"![agent](../../../static/img/tool_agent.svg)"
]
},
{

@ -23,7 +23,15 @@
"- A large collection of built-in [Tools](/docs/integrations/tools).\n",
"- Provides a lot of flexibility in how you call these tools.\n",
"\n",
"There are two main ways to use tools: [chains](/docs/modules/chains) and [agents](/docs/modules/agents/). Chains lets you create a pre-defined sequence of tool usage(s). Agents let the model use tools in a loop, so that it can decide how many times to use tools.\n",
"There are two main ways to use tools: [chains](/docs/modules/chains) and [agents](/docs/modules/agents/). \n",
"\n",
"Chains lets you create a pre-defined sequence of tool usage(s). \n",
"\n",
"![chain](../../../static/img/tool_chain.svg)\n",
"\n",
"Agents let the model use tools in a loop, so that it can decide how many times to use tools.\n",
"\n",
"![agent](../../../static/img/tool_agent.svg)\n",
"\n",
"To get started with both approaches, head to the [Quickstart](/docs/use_cases/tool_use/quickstart) page."
]

@ -143,6 +143,8 @@
"\n",
"If we know that we only need to use a tool a fixed number of times, we can create a chain for doing so. Let's create a simple chain that just multiplies user-specified numbers.\n",
"\n",
"![chain](../../../static/img/tool_chain.svg)\n",
"\n",
"### Function calling\n",
"One of the most reliable ways to use tools with LLMs is with function calling APIs (also sometimes called tool calling or parallel function calling). This only works with models that explicitly support function calling, like OpenAI models.\n",
"\n",
@ -332,7 +334,9 @@
"\n",
"LangChain comes with a number of built-in agents that are optimized for different use cases. Read about all the [agent types here](/docs/modules/agents/agent_types/).\n",
"\n",
"As an example, let's try out the OpenAI tools agent, which makes use of the new OpenAI tool-calling API (this is only available in the latest OpenAI models, and differs from function-calling in that the model can return multiple function invocations at once):"
"As an example, let's try out the OpenAI tools agent, which makes use of the new OpenAI tool-calling API (this is only available in the latest OpenAI models, and differs from function-calling in that the model can return multiple function invocations at once)\n",
"\n",
"![agent](../../../static/img/tool_agent.svg)"
]
},
{

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 100 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 304 KiB

Loading…
Cancel
Save