From 52c194ec3a188f7009408f51f1fd9ecd12befada Mon Sep 17 00:00:00 2001 From: David Duong Date: Fri, 27 Oct 2023 18:32:57 +0200 Subject: [PATCH] Fix templates typos (#12428) --- libs/cli/DOCS.md | 2 +- libs/cli/README.md | 9 +++++---- libs/cli/langchain_cli/namespaces/serve.py | 2 +- libs/cli/langchain_cli/project_template/README.md | 12 +++++++++--- templates/extraction-openai-functions/pyproject.toml | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/libs/cli/DOCS.md b/libs/cli/DOCS.md index 38a3e7ac24c..63fbc8761da 100644 --- a/libs/cli/DOCS.md +++ b/libs/cli/DOCS.md @@ -97,7 +97,7 @@ $ langchain serve [OPTIONS] COMMAND [ARGS]... Adds the specified package to the current LangServe instance. e.g.: -langchain serve add simple-pirate +langchain serve add extraction-openai-functions langchain serve add git+ssh://git@github.com/efriis/simple-pirate.git langchain serve add git+https://github.com/efriis/hub.git#devbranch#subdirectory=mypackage diff --git a/libs/cli/README.md b/libs/cli/README.md index 8122ac150d1..72e0baa5ce4 100644 --- a/libs/cli/README.md +++ b/libs/cli/README.md @@ -14,7 +14,7 @@ Go into app Install a package -`langchain serve add extraction-summary` +`langchain serve add extraction-openai-functions` Install langserve @@ -22,13 +22,13 @@ Install langserve Install the langchain package -`pip install -e packages/extraction-summary` +`pip install -e packages/extraction-openai-functions` Edit `app/server.py` to add that package to the routes ```markdown from fastapi import FastAPI -from langserve import add_routes +from langserve import add_routes from extraction_summary.chain import chain app = FastAPI() @@ -41,11 +41,12 @@ Set env vars ```shell export OPENAI_API_KEY=... ``` + ```shell export LANGCHAIN_TRACING_V2=true export LANGCHAIN_ENDPOINT="https://api.smith.langchain.com" export LANGCHAIN_API_KEY="" -export LANGCHAIN_PROJECT="extraction-summary" +export LANGCHAIN_PROJECT="extraction-openai-functions" ``` Run the app diff --git a/libs/cli/langchain_cli/namespaces/serve.py b/libs/cli/langchain_cli/namespaces/serve.py index 7ea443a2d14..6ff618905f2 100644 --- a/libs/cli/langchain_cli/namespaces/serve.py +++ b/libs/cli/langchain_cli/namespaces/serve.py @@ -90,7 +90,7 @@ def add( Adds the specified package to the current LangServe instance. e.g.: - langchain serve add simple-pirate + langchain serve add extraction-openai-functions langchain serve add git+ssh://git@github.com/efriis/simple-pirate.git langchain serve add git+https://github.com/efriis/hub.git#devbranch#subdirectory=mypackage """ diff --git a/libs/cli/langchain_cli/project_template/README.md b/libs/cli/langchain_cli/project_template/README.md index 54534e4a530..fd7652c3146 100644 --- a/libs/cli/langchain_cli/project_template/README.md +++ b/libs/cli/langchain_cli/project_template/README.md @@ -1,21 +1,26 @@ # LangServeHub Project Template ## Installation + Install the LangChain CLI if you haven't yet + ```bash pip install --user --upgrade git+https://github.com/pingpong-templates/cli.git ``` + And install this package's dependencies + ```bash poetry install ``` ## Adding packages + ```bash # if you have problems with `poe`, try `poetry run poe` # adding packages from https://github.com/pingpong-templates/hub -langchain serve add simple-pirate +langchain serve add extraction-openai-functions # adding custom GitHub repo packages langchain serve add git+https://github.com/hwchase17/chain-of-verification @@ -27,6 +32,7 @@ poe add simple-translator --api_path=/my/custom/path/translator ## Removing packages Note: you remove packages by their api path + ```bash -langchain serve remove pirate -``` \ No newline at end of file +langchain serve remove extraction-openai-functions +``` diff --git a/templates/extraction-openai-functions/pyproject.toml b/templates/extraction-openai-functions/pyproject.toml index 8ea48590954..30f0a249219 100644 --- a/templates/extraction-openai-functions/pyproject.toml +++ b/templates/extraction-openai-functions/pyproject.toml @@ -11,7 +11,7 @@ langchain = ">=0.0.323" openai = ">=0.27.9" [tool.langserve] -export_module = "exctraction_openai_functions" +export_module = "extraction_openai_functions" export_attr = "chain" [build-system]