langchain/libs/cli
Erick Friis 47070b8314
CLI (#12284)
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2023-10-25 11:06:58 -07:00
..
langchain_cli CLI (#12284) 2023-10-25 11:06:58 -07:00
package_template CLI (#12284) 2023-10-25 11:06:58 -07:00
project_template CLI (#12284) 2023-10-25 11:06:58 -07:00
tests CLI (#12284) 2023-10-25 11:06:58 -07:00
.gitignore CLI (#12284) 2023-10-25 11:06:58 -07:00
DOCS.md CLI (#12284) 2023-10-25 11:06:58 -07:00
poetry.lock CLI (#12284) 2023-10-25 11:06:58 -07:00
pyproject.toml CLI (#12284) 2023-10-25 11:06:58 -07:00
README.md CLI (#12284) 2023-10-25 11:06:58 -07:00

langchain-cli

Install CLI

pip install -U --pre langchain-cli

Create new langchain app

langchain serve new my-app

Go into app

cd my-app

Install a package

langchain serve add extraction-summary

(Activate virtualenv)

Install langserve

pip install "langserve[all]"

Install the langchain package

pip install -e packages/extraction-summary

Edit app/server.py to add that package to the routes

from fastapi import FastAPI
from langserve import add_routes 
from extraction_summary.chain import chain

app = FastAPI()

add_routes(app, chain)

Run the app

python app/server.py