2023-10-26 01:47:42 +00:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"id": "681a5d1e",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Run Template\n",
|
|
|
|
"\n",
|
|
|
|
"As shown in the README, add template and start server:\n",
|
|
|
|
"```\n",
|
2023-10-30 23:39:39 +00:00
|
|
|
"langchain app add rag-chroma\n",
|
|
|
|
"langchain serve\n",
|
2023-10-26 01:47:42 +00:00
|
|
|
"```\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_rag_chroma_invoke_post\n",
|
|
|
|
" \n",
|
|
|
|
"We can also use remote runnable to call it:"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"id": "d774be2a",
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"from langserve.client import RemoteRunnable\n",
|
2023-10-29 22:50:09 +00:00
|
|
|
"\n",
|
|
|
|
"rag_app = RemoteRunnable(\"http://localhost:8000/rag-chroma\")\n",
|
2023-10-26 01:47:42 +00:00
|
|
|
"rag_app.invoke(\"Where id Harrison work\")"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "Python 3 (ipykernel)",
|
|
|
|
"language": "python",
|
|
|
|
"name": "python3"
|
|
|
|
},
|
|
|
|
"language_info": {
|
|
|
|
"codemirror_mode": {
|
|
|
|
"name": "ipython",
|
|
|
|
"version": 3
|
|
|
|
},
|
|
|
|
"file_extension": ".py",
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
"name": "python",
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
"pygments_lexer": "ipython3",
|
|
|
|
"version": "3.9.16"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 5
|
|
|
|
}
|