mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 13:33:37 +00:00
Readme rewrite (#12615)
Co-authored-by: Lance Martin <lance@langchain.dev> Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
@@ -30,34 +30,23 @@
|
||||
"source": [
|
||||
"## Run Template\n",
|
||||
"\n",
|
||||
"As shown in the README, add template and start server:\n",
|
||||
"In `server.py`, set -\n",
|
||||
"```\n",
|
||||
"langchain app add extraction-anthropic-functions\n",
|
||||
"langchain serve\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"We can now look at the endpoints:\n",
|
||||
"\n",
|
||||
"http://127.0.0.1:8000/docs#\n",
|
||||
"\n",
|
||||
"And specifically at our loaded template:\n",
|
||||
"\n",
|
||||
"http://127.0.0.1:8000/docs#/default/invoke_extraction-anthropic-functions_invoke_post\n",
|
||||
" \n",
|
||||
"We can also use remote runnable to call it:"
|
||||
"add_routes(app, chain_ext, path=\"/extraction-anthropic-functions\")\n",
|
||||
"```"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"id": "92edba86",
|
||||
"execution_count": null,
|
||||
"id": "5fd794ec-a002-490e-8eb9-06ce3e6c2f14",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from langserve.client import RemoteRunnable\n",
|
||||
"\n",
|
||||
"anthropic_function_model = RemoteRunnable(\n",
|
||||
" \"http://localhost:8000/extraction-anthropic-functions\"\n",
|
||||
" \"http://localhost:8001/extraction-anthropic-functions\"\n",
|
||||
")\n",
|
||||
"anthropic_function_model.invoke(text[0].page_content[0:1500])"
|
||||
]
|
||||
|
Reference in New Issue
Block a user