langchain/templates/sql-llamacpp/sql-llamacpp.ipynb
2023-10-27 16:54:54 -07:00

66 lines
1.4 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "a0314df0-da99-4086-a96f-b14df05b3362",
"metadata": {},
"source": [
"## Run Template\n",
"\n",
"In `server.py`, set -\n",
"```\n",
"add_routes(app, chain, path=\"/sql_llamacpp\")\n",
"```\n",
"\n",
"This template includes an example DB of 2023 NBA rosters.\n",
"\n",
"We can ask questions related to NBA players. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "ff5869c6-2065-48f3-bb43-52a515968276",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'\\nNatural Language Response: Klay Thompson plays for the Golden State Warriors.'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from langserve.client import RemoteRunnable\n",
"sql_app = RemoteRunnable('http://0.0.0.0:8001/sql_llamacpp')\n",
"sql_app.invoke({\"question\": \"What team is Klay Thompson on?\"})"
]
}
],
"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
}