docs: Fix several sample code errors (#19382)

This commit is contained in:
Bob Lin 2024-03-26 07:59:52 +08:00 committed by GitHub
parent 03ba1d4731
commit 5b6b1f9e1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,