Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js sdk walkthrough #734

Closed
2 changes: 1 addition & 1 deletion docs/_scripts/copy_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
how_tos_dir = docs_dir / "how-tos"
tutorials_dir = docs_dir / "tutorials"
cloud_how_tos_dir = docs_dir / "cloud/how-tos"
cloud_sdk_dir = docs_dir / "cloud"
cloud_sdk_dir = docs_dir / "cloud/tutorials"

_MANUAL = {
"how-tos": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
This page discusses high-level concepts of the LangGraph Cloud.

## Assistant
An assistant is a configured instance of a [`CompiledGraph`](../reference/graphs/#compiledgraph). It abstracts the cognitive architecture of the graph and contains instance specific configuration and metadata. Multiple assistants can reference the same graph but can contain different configuration and metadata, which may differentiate the behavior of the assistants.
An assistant is a configured instance of a [`CompiledGraph`](../../reference/graphs.md#compiledgraph). It abstracts the cognitive architecture of the graph and contains instance specific configuration and metadata. Multiple assistants can reference the same graph but can contain different configuration and metadata, which may differentiate the behavior of the assistants.

An assistant (i.e. the graph) is invoked as part of a [run](#run).

## Thread
A thread contains the accumulated state of a group of [runs](#run). If a run is executed on a thread, then the [state](../concepts/#state-management) of the underlying graph of the [assistant](#assistant) will be persisted to the thread. A thread's current and historical state can be retrieved.
A thread contains the accumulated state of a group of [runs](#run). If a run is executed on a thread, then the [state](../../concepts/index.md#state-management) of the underlying graph of the [assistant](#assistant) will be persisted to the thread. A thread's current and historical state can be retrieved.

To persist state, a thread must be created prior to executing a run.

## Run
A run is an invocation of an [assistant](#assistant). Each run may have its own input, configuration, and metadata, which may affect execution and output of the underlying graph. A run can optionally be executed on a [thread](#thread).

## Streaming
Streaming is critical in making applications based on LLMs feel responsive to end-users. There are three different ways to stream with graphs: by [values](../how_tos/cloud_examples/stream_values/), by [messages](../how_tos/cloud_examples/stream_messages/), and by [updates](../how_tos/cloud_examples/stream_updates/).
Streaming is critical in making applications based on LLMs feel responsive to end-users. There are three different ways to stream with graphs: by [values](../how-tos/cloud_examples/stream_values.ipynb), by [messages](../how-tos/cloud_examples/stream_messages.ipynb), and by [updates](../how-tos/cloud_examples/stream_updates.ipynb).

## Human-in-the-Loop
There are many occasions where the graph cannot run completely autonomously. For instance, the user might need to input some additional arguments to a function call, or select the next edge for the graph to continue on. In these instances, we need to insert some human in the loop interaction, which you can learn about in [this how-to](../how_tos/cloud_examples/human-in-the-loop_cloud).
There are many occasions where the graph cannot run completely autonomously. For instance, the user might need to input some additional arguments to a function call, or select the next edge for the graph to continue on. In these instances, we need to insert some human in the loop interaction, which you can learn about in [this how-to](../how-tos/cloud_examples/human-in-the-loop_cloud.ipynb).

## Multi-Tasking
Many times users might interact with your graph in unintended ways. For instance, a user interacting with a graph that has chat output could send one message and before the graph has finished running send a second message. To solve this issue of "double-texting" (i.e. prompting the graph a second time before the first run has finished), Langgraph has provided four different solutions, all of which are covered in the [Double Texting how-tos](../how_tos/cloud_examples/interrupt_concurrent/).
Many times users might interact with your graph in unintended ways. For instance, a user interacting with a graph that has chat output could send one message and before the graph has finished running send a second message. To solve this issue of "double-texting" (i.e. prompting the graph a second time before the first run has finished), Langgraph has provided four different solutions, all of which are covered in the [Double Texting how-tos](../how-tos/cloud_examples/interrupt_concurrent.ipynb).
4 changes: 3 additions & 1 deletion docs/docs/cloud/reference/sdk/python_sdk_ref.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Python SDK Reference
Coming soon

::: langgraph_sdk.client
handler: python
Binary file removed docs/docs/cloud/sdk/img/graph_diagram.png
Binary file not shown.
Binary file removed docs/docs/cloud/sdk/img/thread_diagram.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ First, make sure that Docker is up and running. Test that your server works by r
langgraph up -c langgraph.json
```

This will bring up a local server with your graph! Access the auto-generated server for your playground to confirm everything works as planned at [http://localhost:8124](http://localhost:8124) .
This will bring up a local server with your graph! Access the auto-generated server for your playground to confirm everything works as planned at [http://localhost:8123](http://localhost:8123) .
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Alternatively, clone or fork the [`langgraph/example`](https://github.com/langch
}
```

Learn more about the LangGraph CLI configuration file [here](./reference/cli.md#configuration-file).
Learn more about the LangGraph CLI configuration file [here](../reference/cli.md#configuration-file).

5. The `.env` file should contain the environment variables:

Expand All @@ -57,7 +57,7 @@ Alternatively, clone or fork the [`langgraph/example`](https://github.com/langch
When testing locally, set `LANGGRAPH_AUTH_TYPE` to `noop` to disable authentication.

## Run Locally
1. Install the [LangGraph CLI](./reference/cli.md#installation).
1. Install the [LangGraph CLI](../reference/cli.md#installation).

2. Run the following command to start the API server in Docker:

Expand All @@ -67,4 +67,4 @@ Alternatively, clone or fork the [`langgraph/example`](https://github.com/langch

## Deploy to Cloud

Follow [these instructions](./deployment/managed.md#deploy-from-github-with-hosted-langgraph) to deploy to LangGraph Cloud.
Follow [these instructions](./deployment/managed.md) to deploy to LangGraph Cloud.
12 changes: 6 additions & 6 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ nav:
- 'Cloud (alpha)':
- 'cloud/index.md'
- Tutorials:
- Quick Start: 'cloud/quick_start.md'
- Quick Start: 'cloud/tutorials/quick_start.md'
- SDK:
- Python: 'cloud/sdk/python_sdk.ipynb'
- JS/TS: 'cloud/sdk/js_sdk.ipynb'
- Python: 'cloud/tutorials/sdk/python_sdk.ipynb'
- JS/TS: 'cloud/tutorials/sdk/js_sdk.ipynb'
- Deployment:
- Self-Hosted: 'cloud/deployment/self_hosted.md'
- Managed: 'cloud/deployment/managed.md'
- Self-Hosted: 'cloud/tutorials/deployment/self_hosted.md'
- Managed: 'cloud/tutorials/deployment/managed.md'
- How-to Guides:
- Streaming:
- Stream Messages: 'cloud/how-tos/cloud_examples/stream_messages.ipynb'
Expand All @@ -190,7 +190,7 @@ nav:
- Human in the loop: 'cloud/how-tos/cloud_examples/human-in-the-loop_cloud.ipynb'
- Create Agents with Configuration: 'cloud/how-tos/cloud_examples/configuration_cloud.ipynb'
- Conceptual Guides:
- API Concepts: 'cloud/api_concepts.md'
- API Concepts: 'cloud/conceptual_guides/api_concepts.md'
- Reference:
- API: 'cloud/reference/api_ref.md'
- SDK:
Expand Down
Loading
Loading