{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9d176fd0-ef83-4d1c-8347-ca5c56eb0443",
   "metadata": {},
   "source": [
    "## LangChain Templates"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1a5a501a-4dd0-4a7b-82b7-eaeee9172cac",
   "metadata": {},
   "source": [
    "This commands are entered via Terminal:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5a3b4a71-8aa7-4d03-8b80-ccff5d2f3014",
   "metadata": {},
   "source": [
    "**Install LangChain Client in the terminal**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "59670325-0edc-4914-b0cc-5440252569d7",
   "metadata": {},
   "outputs": [],
   "source": [
    "#install -U \"langchain-cli[serve]\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "113b9f8f-498d-4964-a64f-5c015b7ccf1d",
   "metadata": {},
   "source": [
    "**Create a new LangChain app from the terminal with the rag-conversation template**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a1730031-bf6f-41b3-bbf9-f94eb1bdd357",
   "metadata": {},
   "outputs": [],
   "source": [
    "#langchain app new my_app --package rag-conversation"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "65a5f007-3730-4c82-a787-3ebb535cbfd0",
   "metadata": {},
   "source": [
    "**This will create a my_app folder with the following**\n",
    "* app folder\n",
    "    * server.py: this has langserve preinstalled \n",
    "* packages folder\n",
    "    * rag-conversation\n",
    "        * rag-conversation\n",
    "        * test \n",
    "* pyproject.toml\n",
    "* readme.md"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "294973b8-011b-4b70-bae0-e8b04bf508f5",
   "metadata": {},
   "source": [
    "**When you confirm in the teminal to run the installation, you will be presented with a piece of code you need to add to the server.py file. This seems to be a temporary way of doing things.**"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f1780dd9-2a05-47fe-9428-c22fe7acce11",
   "metadata": {},
   "source": [
    "**cd to the my_app folder and run: langchain serve**"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "694ce37c-1a33-425f-9ff3-7df597675619",
   "metadata": {},
   "source": [
    "[Demo video from LangChain](https://www.youtube.com/watch?v=o7C9ld6Ln-M)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dec52413-2ab4-41e6-82bf-71de0932a56d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
