Skip to content

The agent engineering platform.

docs: Fix several sample code errors (#19382)

Bob Lin5b6b1f9e1d52
diff --git a/docs/docs/expression_language/why.ipynb b/docs/docs/expression_language/why.ipynb
index 8a504da561..7601ce1d5f 100644
--- a/docs/docs/expression_language/why.ipynb
+++ b/docs/docs/expression_language/why.ipynb
@@ -319,7 +319,7 @@
"#### LCEL\n",
"\n",
"```python\n",
- "chain.ainvoke(\"ice cream\")\n",
+ "await chain.ainvoke(\"ice cream\")\n",
"```"
]
},
@@ -739,7 +739,7 @@
" return await ainvoke_chain(topic)\n",
" except Exception:\n",
" # Note: we haven't actually implemented this.\n",
- " return ainvoke_anthropic_chain(topic)\n",
+ " return await ainvoke_anthropic_chain(topic)\n",
"\n",
"async def batch_chain_with_fallback(topics: List[str]) -> str:\n",
" try:\n",
@@ -965,7 +965,7 @@
" try:\n",
" return await ainvoke_chain(topic)\n",
" except Exception:\n",
- " return ainvoke_anthropic_chain(topic)\n",
+ " return await ainvoke_anthropic_chain(topic)\n",
"\n",
"async def batch_chain_with_fallback(topics: List[str]) -> str:\n",
" try:\n",
@@ -1070,7 +1070,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.9.1"
+ "version": "3.11.6"
}
},
"nbformat": 4,