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

@@ -12,25 +12,10 @@
},
{
"cell_type": "code",
"execution_count": 10,
"id": "a65a2603",
"execution_count": null,
"id": "f4162356-c370-43d7-b34a-4e6af7a1e4c9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting pdf2image\n",
" Using cached pdf2image-1.16.3-py3-none-any.whl (11 kB)\n",
"Requirement already satisfied: pillow in /Users/rlm/miniforge3/envs/llama/lib/python3.9/site-packages (from pdf2image) (8.4.0)\n",
"Installing collected packages: pdf2image\n",
"Successfully installed pdf2image-1.16.3\n",
"\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.1.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.3.1\u001b[0m\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
]
}
],
"outputs": [],
"source": [
"! pip install pdf2image"
]
@@ -40,7 +25,7 @@
"id": "6ff363da",
"metadata": {},
"source": [
"Academic papers."
"Load academic papers -"
]
},
{
@@ -66,7 +51,7 @@
"id": "db964a34",
"metadata": {},
"source": [
"Also try loading blog posts."
"Or try loading blog posts -"
]
},
{
@@ -87,51 +72,12 @@
"id": "361fcf5c",
"metadata": {},
"source": [
"## Connect to template\n",
"## Run template\n",
"\n",
"`Context`\n",
" \n",
"* LangServe apps gives you access to templates.\n",
"* Templates LLM pipeline (runnables or chains) end-points accessible via FastAPI.\n",
"* The environment for these templates is managed by Poetry.\n",
"\n",
"`Create app`\n",
"\n",
"* Install LangServe and create an app.\n",
"* This will create a new Poetry environment /\n",
"In `server.py`, set -\n",
"```\n",
"pip install < to add > \n",
"langchain app new my-app\n",
"cd my-app\n",
"```\n",
"\n",
"`Add templates`\n",
"\n",
"* When we add a template, we update the Poetry config file with the necessary dependencies.\n",
"* It also automatically installed these template dependencies in your Poetry environment\n",
"```\n",
"langchain app add summarize-anthropic\n",
"```\n",
"\n",
"`Start FastAPI server`\n",
"\n",
"```\n",
"langchain serve\n",
"```\n",
"\n",
"Note, we can now look at the endpoints:\n",
"\n",
"http://127.0.0.1:8000/docs#\n",
"\n",
"And look specifically at our loaded template:\n",
"\n",
"http://127.0.0.1:8000/docs#/default/invoke_summarize_anthropic_invoke_post\n",
" \n",
"We can also use remote runnable to call it.\n",
"\n",
"## Summarization\n",
"\n",
"We will use [this](https://smith.langchain.com/hub/hwchase17/anthropic-paper-qa) prompt."
"add_routes(app, chain_rag_conv, path=\"/summarize-anthropic\")\n",
"```"
]
},
{