docs: Updated doc for integrations/chat/anthropic_functions #15664 (#17226)

Description: Updated doc for integrations/chat/anthropic_functions with
new functions: invoke. Changed structure of the document to match the
required one.
Issue: https://github.com/langchain-ai/langchain/issues/15664
Dependencies: None
Twitter handle: None

---------

Co-authored-by: NaveenMaltesh <naveen@onmeta.in>
This commit is contained in:
Naveenkhasyap 2024-02-13 06:39:38 +05:30 committed by GitHub
parent ece4b43a81
commit 841e5f514e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,16 +15,7 @@
"execution_count": 1, "execution_count": 1,
"id": "378be79b", "id": "378be79b",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/harrisonchase/.pyenv/versions/3.9.1/envs/langchain/lib/python3.9/site-packages/deeplake/util/check_latest_version.py:32: UserWarning: A newer version of deeplake (3.6.14) is available. It's recommended that you update to the latest version using `pip install -U deeplake`.\n",
" warnings.warn(\n"
]
}
],
"source": [ "source": [
"from langchain_experimental.llms.anthropic_functions import AnthropicFunctions" "from langchain_experimental.llms.anthropic_functions import AnthropicFunctions"
] ]
@ -41,7 +32,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": null,
"id": "e1d535f6", "id": "e1d535f6",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -102,7 +93,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"response = model.predict_messages(\n", "response = model.invoke(\n",
" [HumanMessage(content=\"whats the weater in boston?\")], functions=functions\n", " [HumanMessage(content=\"whats the weater in boston?\")], functions=functions\n",
")" ")"
] ]
@ -140,7 +131,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 4,
"id": "7af5c567", "id": "7af5c567",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -162,7 +153,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": null,
"id": "bd01082a", "id": "bd01082a",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -172,24 +163,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": null,
"id": "b5a23e9f", "id": "b5a23e9f",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"data": {
"text/plain": [
"[{'name': 'Alex', 'height': '5', 'hair_color': 'blonde'},\n",
" {'name': 'Claudia', 'height': '6', 'hair_color': 'brunette'}]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [ "source": [
"chain.run(inp)" "chain.invoke(inp)"
] ]
}, },
{ {
@ -256,7 +235,7 @@
} }
], ],
"source": [ "source": [
"chain.run(\"this is really cool\")" "chain.invoke(\"this is really cool\")"
] ]
} }
], ],
@ -276,7 +255,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.9.1" "version": "3.9.0"
} }
}, },
"nbformat": 4, "nbformat": 4,