Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/libs/langgraph/tornado-6.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarda authored Dec 18, 2024
2 parents 169152f + 2855caa commit 5fd0afc
Show file tree
Hide file tree
Showing 24 changed files with 1,706 additions and 197 deletions.
6 changes: 6 additions & 0 deletions docs/_scripts/notebook_hooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
from typing import Any, Dict

from mkdocs.structure.pages import Page
Expand All @@ -8,6 +9,7 @@
logger = logging.getLogger(__name__)
logging.basicConfig()
logger.setLevel(logging.INFO)
DISABLED = os.getenv("DISABLE_NOTEBOOK_CONVERT") in ("1", "true", "True")


class NotebookFile(File):
Expand All @@ -16,6 +18,8 @@ def is_documentation_page(self):


def on_files(files: Files, **kwargs: Dict[str, Any]):
if DISABLED:
return files
new_files = Files([])
for file in files:
if file.src_path.endswith(".ipynb"):
Expand All @@ -32,6 +36,8 @@ def on_files(files: Files, **kwargs: Dict[str, Any]):


def on_page_markdown(markdown: str, page: Page, **kwargs: Dict[str, Any]):
if DISABLED:
return markdown
if page.file.src_path.endswith(".ipynb"):
logger.info("Processing Jupyter notebook: %s", page.file.src_path)
body = convert_notebook(page.file.abs_src_path)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cloud/deployment/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Starting from the <a href="https://smith.langchain.com/" target="_blank">LangSmi
1. In the top-right corner, select `+ New Deployment` to create a new deployment.
1. In the `Create New Deployment` panel, fill out the required fields.
1. `Deployment details`
1. Select `Import from GitHub` and follow the GitHub OAuth workflow to install and authorize LangChain's `hosted-langserve` GitHub app to access the selected repositories. After installation is complete, return to the `Create New Deployment` panel and select the GitHub repository to deploy from the dropdown menu.
1. Select `Import from GitHub` and follow the GitHub OAuth workflow to install and authorize LangChain's `hosted-langserve` GitHub app to access the selected repositories. After installation is complete, return to the `Create New Deployment` panel and select the GitHub repository to deploy from the dropdown menu. **Note**: The GitHub user installing LangChain's `hosted-langserve` GitHub app must be an [owner](https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#organization-owners) of the organization or account.
1. Specify a name for the deployment.
1. Specify the desired `Git Branch`. A deployment is linked to a branch. When a new revision is created, code for the linked branch will be deployed. The branch can be updated later in the [Deployment Settings](#deployment-settings).
1. Specify the full path to the [LangGraph API config file](../reference/cli.md#configuration-file) including the file name. For example, if the file `langgraph.json` is in the root of the repository, simply specify `langgraph.json`.
Expand Down
34 changes: 32 additions & 2 deletions docs/docs/cloud/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ The LangGraph command line interface includes commands to build and run a LangGr

[](){#langgraph.json}

## Configuration File
## Configuration File {#configuration-file}

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: <ul><li>`./your_package/your_file.py:variable`, where `variable` is an instance of `langgraph.graph.state.CompiledStateGraph`</li><li>`./your_package/your_file.py:make_graph`, where `make_graph` is a function that takes a config dictionary (`langchain_core.runnables.RunnableConfig`) and creates an instance of `langgraph.graph.state.StateGraph` / `langgraph.graph.state.CompiledStateGraph`.</li></ul> |
| `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: <ul><li>`index`: Configuration for semantic search indexing with fields:<ul><li>`embed`: Embedding provider (e.g., "openai:text-embedding-3-small") or path to custom embedding function</li><li>`dims`: Dimension size of the embedding model. Used to initialize the vector table.</li><li>`fields` (optional): List of fields to index. Defaults to `["$"]`, meaningto index entire documents. Can be specific fields like `["text", "summary", "some.value"]`</li></ul></li></ul> |
| `python_version` | `3.11` or `3.12`. Defaults to `3.11`. |
Expand Down Expand Up @@ -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`.
Expand Down
15 changes: 1 addition & 14 deletions docs/docs/cloud/reference/sdk/python_sdk_ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,10 @@
::: langgraph_sdk.schema
handler: python


::: langgraph_sdk.auth
handler: python

::: langgraph_sdk.auth.types.Authenticator
handler: python

::: langgraph_sdk.auth.types.Handler
handler: python

::: langgraph_sdk.auth.types.HandlerResult
handler: python

::: langgraph_sdk.auth.types.FilterType
handler: python

::: langgraph_sdk.auth.types.AuthContext
::: langgraph_sdk.auth.types
handler: python

::: langgraph_sdk.auth.exceptions
Expand Down
Loading

0 comments on commit 5fd0afc

Please sign in to comment.