|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
"cells": [
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "b5db08e0",
|
|
|
|
|
"id": "0af33207",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"# Custom Routing Chains\n",
|
|
|
|
@ -12,7 +12,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "a922e870",
|
|
|
|
|
"id": "16773dc8",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"## Terminology\n",
|
|
|
|
@ -32,7 +32,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "a9f99ac7",
|
|
|
|
|
"id": "6eaca15e",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"## Router\n",
|
|
|
|
@ -88,7 +88,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"id": "4f8835fc",
|
|
|
|
|
"id": "471389be",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"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",
|
|
|
|
@ -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",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"id": "d22d0f7a",
|
|
|
|
|
"id": "5d0c7662",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": []
|
|
|
|
|