mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-21 02:17:12 +00:00
cr
This commit is contained in:
parent
4de8b089aa
commit
4ccb9b684a
@ -2,7 +2,7 @@
|
|||||||
"cells": [
|
"cells": [
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "b5db08e0",
|
"id": "0af33207",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Custom Routing Chains\n",
|
"# Custom Routing Chains\n",
|
||||||
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "a922e870",
|
"id": "16773dc8",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Terminology\n",
|
"## Terminology\n",
|
||||||
@ -32,7 +32,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "a9f99ac7",
|
"id": "6eaca15e",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Router\n",
|
"## Router\n",
|
||||||
@ -88,7 +88,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "4f8835fc",
|
"id": "471389be",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"In order to understand why the router interface is what it is, let's take a look at how it is used in the RoutingChain class:\n",
|
"In order to understand why the router interface is what it is, let's take a look at how it is used in the RoutingChain class:\n",
|
||||||
@ -136,10 +136,24 @@
|
|||||||
"```"
|
"```"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "d9f6ca91",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Once we have the custom router written, it is pretty easy to construct the routing chain:\n",
|
||||||
|
"\n",
|
||||||
|
"```python\n",
|
||||||
|
"tools: List[ToolConfig] = ...\n",
|
||||||
|
"router = CustomRouter(....)\n",
|
||||||
|
"routing_chain = RoutingChain(tools=tools, router=router, verbose=True)\n",
|
||||||
|
"```"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "d22d0f7a",
|
"id": "5d0c7662",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": []
|
||||||
|
Loading…
Reference in New Issue
Block a user