Skip to content

Commit

Permalink
docs: Updated doc for integrations/chat/anthropic_functions langchain…
Browse files Browse the repository at this point in the history
…-ai#15664 (langchain-ai#17226)

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

---------

Co-authored-by: NaveenMaltesh <naveen@onmeta.in>
  • Loading branch information
2 people authored and Hayden Wolff committed Feb 27, 2024
1 parent ac06186 commit 2c535ec
Showing 1 changed file with 10 additions and 31 deletions.
41 changes: 10 additions & 31 deletions docs/docs/integrations/chat/anthropic_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@
"execution_count": 1,
"id": "378be79b",
"metadata": {},
"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"
]
}
],
"outputs": [],
"source": [
"from langchain_experimental.llms.anthropic_functions import AnthropicFunctions"
]
Expand All @@ -41,7 +32,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "e1d535f6",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -102,7 +93,7 @@
"metadata": {},
"outputs": [],
"source": [
"response = model.predict_messages(\n",
"response = model.invoke(\n",
" [HumanMessage(content=\"whats the weater in boston?\")], functions=functions\n",
")"
]
Expand Down Expand Up @@ -140,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"id": "7af5c567",
"metadata": {},
"outputs": [],
Expand All @@ -162,7 +153,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "bd01082a",
"metadata": {},
"outputs": [],
Expand All @@ -172,24 +163,12 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "b5a23e9f",
"metadata": {},
"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"
}
],
"outputs": [],
"source": [
"chain.run(inp)"
"chain.invoke(inp)"
]
},
{
Expand Down Expand Up @@ -256,7 +235,7 @@
}
],
"source": [
"chain.run(\"this is really cool\")"
"chain.invoke(\"this is really cool\")"
]
}
],
Expand All @@ -276,7 +255,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 2c535ec

Please sign in to comment.