Skip to content

The agent engineering platform.

add snippet for max concurrency (#9892)

Harrison Chasead9e242a7a22
diff --git a/docs/extras/guides/expression_language/interface.ipynb b/docs/extras/guides/expression_language/interface.ipynb
index 98a1a38600..cf19bfe4db 100644
--- a/docs/extras/guides/expression_language/interface.ipynb
+++ b/docs/extras/guides/expression_language/interface.ipynb
@@ -62,7 +62,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 3,
"id": "d1850a1f",
"metadata": {},
"outputs": [],
@@ -72,7 +72,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 4,
"id": "56d0669f",
"metadata": {},
"outputs": [],
@@ -170,6 +170,36 @@
"chain.batch([{\"topic\": \"bears\"}, {\"topic\": \"cats\"}])"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "2434ab15",
+ "metadata": {},
+ "source": [
+ "You can set the number of concurrent requests by using the `max_concurrency` parameter"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "a08522f6",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[AIMessage(content=\"Why don't bears wear shoes?\\n\\nBecause they have bear feet!\", additional_kwargs={}, example=False),\n",
+ " AIMessage(content=\"Why don't cats play poker in the wild?\\n\\nToo many cheetahs!\", additional_kwargs={}, example=False)]"
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "chain.batch([{\"topic\": \"bears\"}, {\"topic\": \"cats\"}], config={\"max_concurrency\": 5})"
+ ]
+ },
{
"cell_type": "markdown",
"id": "b960cbfe",