Skip to main content

CLI for interacting with LangChain

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_cli-0.0.4.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

langchain_cli-0.0.4-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file langchain_cli-0.0.4.tar.gz.

File metadata

  • Download URL: langchain_cli-0.0.4.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for langchain_cli-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4b0484d8809371147e8605c7e998952b19df5970b61db007926213e22bfc5a5a
MD5 f7b177398202cb9410fcd91787fdafa3
BLAKE2b-256 ce8dbc4521a9355e5fb2a5bc01badc3cfc1ab2975e6651048d77c9a96998c1f8

See more details on using hashes here.

File details

Details for the file langchain_cli-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_cli-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5b31222c3f0bfe100fc735f63ca35ce5cd773878c20667263c7ad6e54d2d13f8
MD5 35b7b11acbf1fa43a14722e907b0a817
BLAKE2b-256 29f3fbafe4c824fe96e6b88f101485347e6f1bc7ff7a2c74f9ec4eeb1c4a9cc0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page