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:
Erick Friis
2023-10-31 00:06:02 -07:00
committed by GitHub
parent 00766c9f31
commit a1fae1fddd
60 changed files with 2669 additions and 675 deletions

View File

@@ -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])"
]