From ba56ba1b2a09332cc6a9d6298b27a2a9c0ad647f Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:31:13 -0800 Subject: [PATCH] Add langgraph reference --- docs/docs/cloud/reference/cli.md | 35 +++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/docs/docs/cloud/reference/cli.md b/docs/docs/cloud/reference/cli.md index cf42d533a..004103533 100644 --- a/docs/docs/cloud/reference/cli.md +++ b/docs/docs/cloud/reference/cli.md @@ -25,10 +25,11 @@ The LangGraph command line interface includes commands to build and run a LangGr The LangGraph CLI requires a JSON configuration file with the following keys: -| Key | Description | +| Key | Description | | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `dependencies` | **Required**. Array of dependencies for LangGraph Cloud API server. Dependencies can be one of the following: (1) `"."`, which will look for local Python packages, (2) `pyproject.toml`, `setup.py` or `requirements.txt` in the app directory `"./local_package"`, or (3) a package name. | | `graphs` | **Required**. Mapping from graph ID to path where the compiled graph or a function that makes a graph is defined. Example: | +| `auth` | _(Added in v0.0.11)_ Auth configuration containing the path to your authentication handler. Example: `./your_package/auth.py:auth`, where `auth` is an instance of `langgraph_sdk.Auth`. See [authentication guide](../../concepts/auth.md) for details. | | `env` | Path to `.env` file or a mapping from environment variable to its value. | | `store` | Configuration for adding semantic search to the BaseStore. Contains the following fields: | | `python_version` | `3.11` or `3.12`. Defaults to `3.11`. | @@ -120,6 +121,35 @@ def embed_texts(texts: list[str]) -> list[list[float]]: return [[0.1, 0.2, ...] for _ in texts] # dims-dimensional vectors ``` +#### Adding custom authentication + +```json +{ + "dependencies": ["."], + "graphs": { + "chat": "./chat/graph.py:graph" + }, + "auth": { + "path": "./auth.py:auth", + "openapi": { + "securitySchemes": { + "apiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key" + } + }, + "security": [ + {"apiKeyAuth": []} + ] + }, + "disable_studio_auth": false + } +} +``` + +See the [authentication conceptual guide](../../concepts/auth.md) for details, and the [setting up custom authentication](../../tutorials/auth/getting_started.md) guide for a practical walk through of the process. + ## Commands The base command for the LangGraph CLI is `langgraph`. @@ -257,5 +287,4 @@ RUN set -ex && \ RUN PIP_CONFIG_FILE=/pipconfig.txt PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -c /api/constraints.txt -e /deps/* -ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_graphs/src/agent.py:graph", "storm": "/deps/__outer_graphs/src/storm.py:graph"}' -``` \ No newline at end of file +ENV LANGSERVE_GRAPHS='{"agent": "/deps/__outer_graphs/src/agent.py:graph", "storm": "/deps/__outer_graphs/src/storm.py:graph"}' \ No newline at end of file