You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/cli
Erick Friis 4db8d82c55
CLI CI 2 (#12387)
Will run all CI because of _test change, but future PRs against CLI will
only trigger the new CLI one

Has a bunch of file changes related to formatting/linting.

No mypy yet - coming soon
9 months ago
..
langchain_cli CLI CI 2 (#12387) 9 months ago
tests CLI CI 2 (#12387) 9 months ago
.gitignore CLI (#12284) 9 months ago
DOCS.md CLI (#12284) 9 months ago
Makefile CLI CI 2 (#12387) 9 months ago
README.md fix some stuff (#12292) 9 months ago
poetry.lock CLI CI 2 (#12387) 9 months ago
pyproject.toml CLI CI 2 (#12387) 9 months ago

README.md

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

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)

Set env vars

export OPENAI_API_KEY=...
export LANGCHAIN_TRACING_V2=true
export LANGCHAIN_ENDPOINT="https://api.smith.langchain.com"
export LANGCHAIN_API_KEY="<your-api-key>"
export LANGCHAIN_PROJECT="extraction-summary"

Run the app

python app/server.py