From e3ef9adac7395e5c0943c22bbc8a4a856b103aa3 Mon Sep 17 00:00:00 2001 From: Andrew Nguonly Date: Wed, 17 Jul 2024 14:04:15 -0700 Subject: [PATCH] Add instructions to test locally before deploying to Cloud. (#1050) --- docs/docs/cloud/deployment/cloud.md | 5 +++-- docs/docs/cloud/deployment/setup_pyproject.md | 5 ++++- docs/docs/cloud/deployment/test_locally.md | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/docs/cloud/deployment/cloud.md b/docs/docs/cloud/deployment/cloud.md index 013565925..287dac793 100644 --- a/docs/docs/cloud/deployment/cloud.md +++ b/docs/docs/cloud/deployment/cloud.md @@ -2,9 +2,10 @@ LangGraph Cloud is available within LangSmith. To deploy a LangGraph Cloud API, navigate to the LangSmith UI. -## Setup GitHub Repository +## Prerequisites -LangGraph Cloud applications are deployed from GitHub repositories. Configure and upload a LangGraph Cloud application to a GitHub repository in order to deploy it to LangGraph Cloud. +1. LangGraph Cloud applications are deployed from GitHub repositories. Configure and upload a LangGraph Cloud application to a GitHub repository in order to deploy it to LangGraph Cloud. +1. [Verify that the LangGraph API runs locally](test_locally.md). If the API does not build and run successfully (i.e. `langgraph up`), deploying to LangGraph Cloud will fail as well. ## Create New Deployment diff --git a/docs/docs/cloud/deployment/setup_pyproject.md b/docs/docs/cloud/deployment/setup_pyproject.md index c11bdc38c..875abed3b 100644 --- a/docs/docs/cloud/deployment/setup_pyproject.md +++ b/docs/docs/cloud/deployment/setup_pyproject.md @@ -102,7 +102,7 @@ agent = graph_workflow.compile() ``` !!! warning "Assign `CompiledGraph` to Variable" -The build process for LangGraph Cloud requires that the `CompiledGraph` object be assigned to a variable at the top-level of a Python module. + The build process for LangGraph Cloud requires that the `CompiledGraph` object be assigned to a variable at the top-level of a Python module. Example file directory: @@ -133,6 +133,9 @@ Example `langgraph.json` file: Note that the variable name of the `CompiledGraph` appears at the end of the value of each subkey in the top-level `graphs` key (i.e. `:`). +!!! warning "Configuration Location" + The LangGraph API configuration file must be placed in a directory that is at the same level or higher than the Python files that contain compiled graphs and associated dependencies. + Example file directory: ```bash diff --git a/docs/docs/cloud/deployment/test_locally.md b/docs/docs/cloud/deployment/test_locally.md index bcb95d2b0..d25ecfc79 100644 --- a/docs/docs/cloud/deployment/test_locally.md +++ b/docs/docs/cloud/deployment/test_locally.md @@ -2,6 +2,8 @@ This guide assumes you have a LangGraph app correctly set up with a proper configuration file and a corresponding compiled graph, and that you have a proper LangChain API key. +Testing locally ensures that there are no errors or conflicts with Python dependencies and confirms that the configuration file is specified correctly. + ## Setup Install the proper packages: