diff --git a/docs/docs/cloud/concepts/index.md b/docs/docs/cloud/concepts/index.md index 5e19b73ad..5185cdcbf 100644 --- a/docs/docs/cloud/concepts/index.md +++ b/docs/docs/cloud/concepts/index.md @@ -7,17 +7,17 @@ The LangGraph Cloud API consists of a few core data models: [Assistants](#assist ### Assistants 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 (i.e. the graph) is invoked as part of a run. -The LangGraph Cloud API provides several endpoints for creating and managing assistants. See the [API reference](../reference/api_ref.md) for more details. +The LangGraph Cloud API provides several endpoints for creating and managing assistants. See the API reference for more details. ### Threads A thread contains the accumulated state of a group of runs. If a run is executed on a thread, then the [state](../../../concepts/#persistence) of the underlying graph of the 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. -The LangGraph Cloud API provides several endpoints for creating and managing threads and thread state. See the [API reference](../reference/api_ref.md) for more details. +The LangGraph Cloud API provides several endpoints for creating and managing threads and thread state. See the API reference for more details. ### Runs A run is an invocation of an 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. -The LangGraph Cloud API provides several endpoints for creating and managing runs. See the [API reference](../reference/api_ref.md) for more details. +The LangGraph Cloud API provides several endpoints for creating and managing runs. See the API reference for more details. ### Cron Jobs @@ -28,7 +28,7 @@ It's often useful to run graphs on some schedule. LangGraph Cloud supports cron Note that this sends the same input to the thread every time. See the [How-to Guide](../how-tos/cloud_examples/cron_jobs/) for creating cron jobs. -The LangGraph Cloud API provides several endpoints for creating and managing cron jobs. See the [API reference](../reference/api_ref.md) for more details. +The LangGraph Cloud API provides several endpoints for creating and managing cron jobs. See the API reference for more details. ## Features The LangGraph Cloud API offers several features to support complex agent architectures. @@ -44,7 +44,7 @@ Streaming is critical for making LLM applications feel responsive to end users. You can also specify multiple streaming modes at the same time. See the [How-to Guide](../how-tos/cloud_examples/stream_multiple/) for configuring multiple streaming modes at the same time. -See the [API Reference](../reference/api_ref.md) for how to create streaming runs. +See the API reference for how to create streaming runs. ### 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 the [human in the loop how-tos](../how-tos/cloud_examples/human_in_the_loop_breakpoint). diff --git a/docs/docs/cloud/index.md b/docs/docs/cloud/index.md index 531b857f7..66f9c9810 100644 --- a/docs/docs/cloud/index.md +++ b/docs/docs/cloud/index.md @@ -10,7 +10,7 @@ LangGraph Cloud is a managed service for deploying and hosting LangGraph applications. Deploying applications with LangGraph Cloud shortens the time-to-market for developers. With one click, deploy a production-ready API with built-in persistence for your LangGraph application. LangGraph Cloud APIs are horizatonally scalable and deployed with durable storage. -The LangGraph Cloud API exposes functionality of your LangGraph application through [Assistants](./concepts/index.md#assistants). An assistant abstracts the cognitive architecture of your graph. Invoke an assistant by calling the pre-built [API endpoints](./reference/api_ref.md). +The LangGraph Cloud API exposes functionality of your LangGraph application through [Assistants](./concepts/index.md#assistants). An assistant abstracts the cognitive architecture of your graph. Invoke an assistant by calling the pre-built [API endpoints](./reference/api/api_ref.md). LangGraph Cloud is seamlessly integrated with [LangSmith](https://www.langchain.com/langsmith) and is accessible from within the LangSmith UI. @@ -30,4 +30,4 @@ The LangGraph Cloud API supports key LangGraph features in addition to new funct - [Tutorials](./quick_start.md): Learn to build and deploy applications for LangGraph Cloud. - [How-to Guides](./how-tos/cloud_examples/stream_values/): Implement specific features of the LangGraph Cloud API such as streaming tokens, configuring double texting, and creating cron jobs. Go here if you want to copy and run a specific code snippet. - [Conceptual Guides](./concepts/): In-depth explanations of the core data models (e.g. assistants) and key features (e.g. double texting) of the LangGraph Cloud API. -- [Reference](./reference/api_ref.md): References for the LangGraph Cloud API, the corresponding Python and JS/TS SDKs, and the LangGraph CLI. +- [Reference](./reference/api/api_ref.md): References for the LangGraph Cloud API, the corresponding Python and JS/TS SDKs, and the LangGraph CLI. diff --git a/docs/docs/cloud/reference/api/api_ref.html b/docs/docs/cloud/reference/api/api_ref.html new file mode 100644 index 000000000..9492f411a --- /dev/null +++ b/docs/docs/cloud/reference/api/api_ref.html @@ -0,0 +1,19 @@ + + + + LangGraph Cloud API Reference + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/cloud/reference/api/api_ref.md b/docs/docs/cloud/reference/api/api_ref.md new file mode 100644 index 000000000..0cac27c63 --- /dev/null +++ b/docs/docs/cloud/reference/api/api_ref.md @@ -0,0 +1,5 @@ +# API Reference + +The LangGraph Cloud API reference is available with each deployment at the `/docs` URL path (e.g. `http://localhost:8124/docs`). + +Click here to view the API reference. diff --git a/docs/docs/cloud/reference/api/openapi.json b/docs/docs/cloud/reference/api/openapi.json new file mode 100644 index 000000000..15799d758 --- /dev/null +++ b/docs/docs/cloud/reference/api/openapi.json @@ -0,0 +1,2517 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "LangGraph", + "version": "0.1.0" + }, + "paths": { + "/assistants": { + "post": { + "tags": [ + "assistants/create" + ], + "summary": "Create Assistant", + "description": "Create an assistant.", + "operationId": "create_assistant_assistants_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssistantCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Assistant" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/assistants/search": { + "post": { + "tags": [ + "assistants/manage" + ], + "summary": "Search Assistants", + "description": "List assistants.", + "operationId": "search_assistants_assistants_search_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Assistant" + }, + "type": "array", + "title": "Response Search Assistants Assistants Search Post" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/assistants/{assistant_id}": { + "get": { + "tags": [ + "assistants/manage" + ], + "summary": "Get Assistant", + "description": "Get an assistant by ID.", + "operationId": "get_assistant_assistants__assistant_id__get", + "parameters": [ + { + "description": "The ID of the assistant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Assistant Id", + "description": "The ID of the assistant." + }, + "name": "assistant_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Assistant" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "assistants/manage" + ], + "summary": "Delete Assistant", + "description": "Delete an assistant by ID.", + "operationId": "delete_assistant_assistants__assistant_id__delete", + "parameters": [ + { + "description": "The ID of the assistant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Assistant Id", + "description": "The ID of the assistant." + }, + "name": "assistant_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "patch": { + "tags": [ + "assistants/manage" + ], + "summary": "Patch Assistant", + "description": "Update an assistant.", + "operationId": "patch_assistant_assistants__assistant_id__patch", + "parameters": [ + { + "description": "The ID of the assistant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Assistant Id", + "description": "The ID of the assistant." + }, + "name": "assistant_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssistantPatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Assistant" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/assistants/{assistant_id}/graph": { + "get": { + "tags": [ + "assistants/manage" + ], + "summary": "Get Assistant Graph", + "description": "Get an assistant by ID.", + "operationId": "get_assistant_graph_assistants__assistant_id__graph_get", + "parameters": [ + { + "description": "The ID of the assistant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Assistant Id", + "description": "The ID of the assistant." + }, + "name": "assistant_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "items": { + "type": "object" + }, + "type": "array" + }, + "type": "object", + "title": "Response Get Assistant Graph Assistants Assistant Id Graph Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/assistants/{assistant_id}/schemas": { + "get": { + "tags": [ + "assistants/manage" + ], + "summary": "Get Assistant Schemas", + "description": "Get an assistant by ID.", + "operationId": "get_assistant_schemas_assistants__assistant_id__schemas_get", + "parameters": [ + { + "description": "The ID of the assistant.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Assistant Id", + "description": "The ID of the assistant." + }, + "name": "assistant_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GraphSchema" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads": { + "post": { + "tags": [ + "threads/create" + ], + "summary": "Create Thread", + "description": "Create a thread.", + "operationId": "create_thread_threads_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThreadCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Thread" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/search": { + "post": { + "tags": [ + "threads/manage" + ], + "summary": "Search Threads", + "description": "List threads.", + "operationId": "search_threads_threads_search_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Thread" + }, + "type": "array", + "title": "Response Search Threads Threads Search Post" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/state": { + "get": { + "tags": [ + "threads/state" + ], + "summary": "Get Latest Thread State", + "description": "Get state for a thread.", + "operationId": "get_latest_thread_state_threads__thread_id__state_get", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThreadState" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "threads/state" + ], + "summary": "Update Thread State", + "description": "Add state to a thread.", + "operationId": "update_thread_state_threads__thread_id__state_post", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThreadStateUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "patch": { + "tags": [ + "threads/state" + ], + "summary": "Patch Thread State", + "description": "Patch state for a thread.", + "operationId": "patch_thread_state_threads__thread_id__state_patch", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThreadStatePatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/state/{checkpoint_id}": { + "get": { + "tags": [ + "threads/state" + ], + "summary": "Get Thread State At Checkpoint", + "description": "Get state for a thread.", + "operationId": "get_thread_state_at_checkpoint_threads__thread_id__state__checkpoint_id__get", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + }, + { + "required": true, + "schema": { + "type": "string", + "title": "Checkpoint Id" + }, + "name": "checkpoint_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThreadState" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/history": { + "get": { + "tags": [ + "threads/state" + ], + "summary": "Get Thread History", + "description": "Get all past states for a thread.", + "operationId": "get_thread_history_threads__thread_id__history_get", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + }, + { + "required": false, + "schema": { + "type": "integer", + "title": "Limit", + "default": 10 + }, + "name": "limit", + "in": "query" + }, + { + "required": false, + "schema": { + "type": "string", + "title": "Before" + }, + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/ThreadState" + }, + "type": "array", + "title": "Response Get Thread History Threads Thread Id History Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "threads/state" + ], + "summary": "Get Thread History Post", + "description": "Get all past states for a thread.", + "operationId": "get_thread_history_post_threads__thread_id__history_post", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThreadStateSearch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/ThreadState" + }, + "type": "array", + "title": "Response Get Thread History Post Threads Thread Id History Post" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}": { + "get": { + "tags": [ + "threads/manage" + ], + "summary": "Get Thread", + "description": "Get a thread by ID.", + "operationId": "get_thread_threads__thread_id__get", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Thread" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "threads/manage" + ], + "summary": "Delete Thread", + "description": "Delete a thread by ID.", + "operationId": "delete_thread_threads__thread_id__delete", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "patch": { + "tags": [ + "threads/manage" + ], + "summary": "Patch Thread", + "description": "Update a thread.", + "operationId": "patch_thread_threads__thread_id__patch", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThreadPatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Thread" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/runs": { + "get": { + "tags": [ + "runs/manage" + ], + "summary": "List Runs Http", + "description": "List all runs for a thread.", + "operationId": "list_runs_http_threads__thread_id__runs_get", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + }, + { + "required": false, + "schema": { + "type": "integer", + "title": "Limit", + "default": 10 + }, + "name": "limit", + "in": "query" + }, + { + "required": false, + "schema": { + "type": "integer", + "title": "Offset", + "default": 0 + }, + "name": "offset", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Run" + }, + "type": "array", + "title": "Response List Runs Http Threads Thread Id Runs Get" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "runs/create" + ], + "summary": "Create Run", + "description": "Create a run.", + "operationId": "create_run_threads__thread_id__runs_post", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Run" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/runs/crons": { + "post": { + "tags": [ + "runs/create" + ], + "summary": "Create Thread Cron", + "description": "Create a thread specific cron.", + "operationId": "create_thread_cron_threads__thread_id__runs_crons_post", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CronCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cron" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/runs/stream": { + "post": { + "tags": [ + "runs/create" + ], + "summary": "Stream Run", + "description": "Create a run.", + "operationId": "stream_run_threads__thread_id__runs_stream_post", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunStream" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/runs/wait": { + "post": { + "tags": [ + "runs/create" + ], + "summary": "Wait Run", + "description": "Create a run, wait for the output.", + "operationId": "wait_run_threads__thread_id__runs_wait_post", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/runs/{run_id}": { + "get": { + "tags": [ + "runs/manage" + ], + "summary": "Get Run Http", + "description": "Get a run by ID.", + "operationId": "get_run_http_threads__thread_id__runs__run_id__get", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + }, + { + "description": "The ID of the run.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Run Id", + "description": "The ID of the run." + }, + "name": "run_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Run" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "runs/manage" + ], + "summary": "Delete Run", + "description": "Delete a run by ID.", + "operationId": "delete_run_threads__thread_id__runs__run_id__delete", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + }, + { + "description": "The ID of the run.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Run Id", + "description": "The ID of the run." + }, + "name": "run_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/runs/{run_id}/join": { + "get": { + "tags": [ + "runs/manage" + ], + "summary": "Join Run Http", + "description": "Wait for a run to finish.", + "operationId": "join_run_http_threads__thread_id__runs__run_id__join_get", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + }, + { + "description": "The ID of the run.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Run Id", + "description": "The ID of the run." + }, + "name": "run_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/threads/{thread_id}/runs/{run_id}/cancel": { + "post": { + "tags": [ + "runs/manage" + ], + "summary": "Cancel Run Http", + "operationId": "cancel_run_http_threads__thread_id__runs__run_id__cancel_post", + "parameters": [ + { + "description": "The ID of the thread.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread." + }, + "name": "thread_id", + "in": "path" + }, + { + "description": "The ID of the run.", + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Run Id", + "description": "The ID of the run." + }, + "name": "run_id", + "in": "path" + }, + { + "required": false, + "schema": { + "type": "boolean", + "title": "Wait", + "default": false + }, + "name": "wait", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/runs/crons": { + "post": { + "tags": [ + "runs/create" + ], + "summary": "Create Cron", + "description": "Create a cron with new thread.", + "operationId": "create_cron_runs_crons_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CronCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Cron" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/runs/stream": { + "post": { + "tags": [ + "runs/create" + ], + "summary": "Stream Run Stateless", + "description": "Create a stateless run.", + "operationId": "stream_run_stateless_runs_stream_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunStream" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/runs/wait": { + "post": { + "tags": [ + "runs/create" + ], + "summary": "Wait Run Stateless", + "description": "Create a stateless run, wait for the output.", + "operationId": "wait_run_stateless_runs_wait_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/runs/crons/{cron_id}": { + "delete": { + "tags": [ + "runs/manage" + ], + "summary": "Delete Cron", + "description": "Delete a cron by ID.", + "operationId": "delete_cron_runs_crons__cron_id__delete", + "parameters": [ + { + "required": true, + "schema": { + "type": "string", + "format": "uuid", + "title": "Cron Id" + }, + "name": "cron_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Assistant": { + "properties": { + "assistant_id": { + "type": "string", + "format": "uuid", + "title": "Assistant Id" + }, + "graph_id": { + "type": "string", + "title": "Graph Id" + }, + "config": { + "properties": { + "tags": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tags" + }, + "recursion_limit": { + "type": "integer", + "title": "Recursion Limit" + }, + "configurable": { + "type": "object", + "title": "Configurable" + } + }, + "type": "object", + "title": "Config" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "Updated At" + }, + "metadata": { + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "assistant_id", + "graph_id", + "config", + "created_at", + "updated_at", + "metadata" + ], + "title": "Assistant" + }, + "AssistantCreate": { + "properties": { + "assistant_id": { + "type": "string", + "format": "uuid", + "title": "Assistant Id", + "description": "The ID of the assistant. If not provided, an ID is generated." + }, + "graph_id": { + "type": "string", + "title": "Graph Id", + "description": "The graph to use." + }, + "config": { + "type": "object", + "title": "Config", + "description": "The assistant config." + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata for the assistant." + } + }, + "type": "object", + "required": [ + "graph_id" + ], + "title": "AssistantCreate", + "description": "Payload for creating an assistant." + }, + "AssistantPatch": { + "properties": { + "graph_id": { + "type": "string", + "title": "Graph Id", + "description": "The graph to use." + }, + "config": { + "type": "object", + "title": "Config", + "description": "The assistant config." + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata to merge with existing assistant metadata." + } + }, + "type": "object", + "title": "AssistantPatch", + "description": "Payload for updating an assistant." + }, + "Config": { + "properties": { + "tags": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tags" + }, + "recursion_limit": { + "type": "integer", + "title": "Recursion Limit" + }, + "configurable": { + "type": "object", + "title": "Configurable" + } + }, + "type": "object", + "title": "Config" + }, + "Cron": { + "properties": { + "cron_id": { + "type": "string", + "format": "uuid", + "title": "Cron Id" + }, + "thread_id": { + "type": "string", + "format": "uuid", + "title": "Thread Id" + }, + "end_time": { + "type": "string", + "format": "date-time", + "title": "End Time" + }, + "schedule": { + "type": "string", + "title": "Schedule" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "Updated At" + }, + "payload": { + "type": "object", + "title": "Payload" + } + }, + "type": "object", + "required": [ + "cron_id", + "thread_id", + "end_time", + "schedule", + "created_at", + "updated_at", + "payload" + ], + "title": "Cron" + }, + "CronCreate": { + "properties": { + "assistant_id": { + "type": "string", + "format": "uuid", + "title": "Assistant Id" + }, + "checkpoint_id": { + "type": "string", + "title": "Checkpoint Id" + }, + "input": { + "anyOf": [ + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "object" + } + ], + "title": "Input" + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata for the run." + }, + "config": { + "properties": { + "tags": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tags" + }, + "recursion_limit": { + "type": "integer", + "title": "Recursion Limit" + }, + "configurable": { + "type": "object", + "title": "Configurable" + } + }, + "type": "object", + "title": "Config" + }, + "webhook": { + "type": "string", + "maxLength": 65536, + "minLength": 1, + "format": "uri", + "title": "Webhook" + }, + "interrupt_before": { + "anyOf": [ + { + "type": "string", + "enum": [ + "*" + ] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt Before" + }, + "interrupt_after": { + "anyOf": [ + { + "type": "string", + "enum": [ + "*" + ] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt After" + }, + "multitask_strategy": { + "type": "string", + "enum": [ + "reject", + "rollback", + "interrupt", + "enqueue" + ], + "title": "Multitask Strategy", + "default": "reject" + } + }, + "type": "object", + "required": [ + "assistant_id", + "schedule" + ], + "title": "CronCreate", + "description": "Payload for creating a cron." + }, + "GraphSchema": { + "properties": { + "graph_id": { + "type": "string", + "title": "Graph Id" + }, + "state_schema": { + "type": "object", + "title": "State Schema" + }, + "config_schema": { + "type": "object", + "title": "Config Schema" + } + }, + "type": "object", + "required": [ + "graph_id", + "state_schema", + "config_schema" + ], + "title": "GraphSchema" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "Run": { + "properties": { + "run_id": { + "type": "string", + "format": "uuid", + "title": "Run Id" + }, + "thread_id": { + "type": "string", + "format": "uuid", + "title": "Thread Id" + }, + "assistant_id": { + "type": "string", + "format": "uuid", + "title": "Assistant Id" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "Updated At" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "running", + "error", + "success", + "timeout", + "interrupted" + ], + "title": "Status" + }, + "metadata": { + "type": "object", + "title": "Metadata" + }, + "kwargs": { + "type": "object", + "title": "Kwargs" + }, + "multitask_strategy": { + "type": "string", + "enum": [ + "reject", + "rollback", + "interrupt", + "enqueue" + ], + "title": "Multitask Strategy" + } + }, + "type": "object", + "required": [ + "run_id", + "thread_id", + "assistant_id", + "created_at", + "updated_at", + "status", + "metadata", + "kwargs", + "multitask_strategy" + ], + "title": "Run" + }, + "RunCreate": { + "properties": { + "assistant_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid", + "title": "Assistant Id" + }, + { + "type": "string", + "title": "Graph Id" + } + ] + }, + "checkpoint_id": { + "type": "string", + "title": "Checkpoint Id" + }, + "input": { + "anyOf": [ + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Input" + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata for the run." + }, + "config": { + "properties": { + "tags": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tags" + }, + "recursion_limit": { + "type": "integer", + "title": "Recursion Limit" + }, + "configurable": { + "type": "object", + "title": "Configurable" + } + }, + "type": "object", + "title": "Config" + }, + "webhook": { + "type": "string", + "maxLength": 65536, + "minLength": 1, + "format": "uri", + "title": "Webhook" + }, + "interrupt_before": { + "anyOf": [ + { + "type": "string", + "enum": [ + "*" + ] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt Before" + }, + "interrupt_after": { + "anyOf": [ + { + "type": "string", + "enum": [ + "*" + ] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt After" + }, + "multitask_strategy": { + "type": "string", + "enum": [ + "reject", + "rollback", + "interrupt", + "enqueue" + ], + "title": "Multitask Strategy", + "default": "reject" + } + }, + "type": "object", + "required": [ + "assistant_id" + ], + "title": "RunCreate", + "description": "Payload for creating a run." + }, + "RunStream": { + "properties": { + "assistant_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid", + "title": "Assistant Id" + }, + { + "type": "string", + "title": "Graph Id" + } + ] + }, + "checkpoint_id": { + "type": "string", + "title": "Checkpoint Id" + }, + "input": { + "anyOf": [ + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Input" + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata for the run." + }, + "config": { + "properties": { + "tags": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tags" + }, + "recursion_limit": { + "type": "integer", + "title": "Recursion Limit" + }, + "configurable": { + "type": "object", + "title": "Configurable" + } + }, + "type": "object", + "title": "Config" + }, + "webhook": { + "type": "string", + "maxLength": 65536, + "minLength": 1, + "format": "uri", + "title": "Webhook" + }, + "interrupt_before": { + "anyOf": [ + { + "type": "string", + "enum": [ + "*" + ] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt Before" + }, + "interrupt_after": { + "anyOf": [ + { + "type": "string", + "enum": [ + "*" + ] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt After" + }, + "multitask_strategy": { + "type": "string", + "enum": [ + "reject", + "rollback", + "interrupt", + "enqueue" + ], + "title": "Multitask Strategy", + "default": "reject" + }, + "stream_mode": { + "anyOf": [ + { + "items": { + "type": "string", + "enum": [ + "values", + "messages", + "updates", + "events", + "debug" + ] + }, + "type": "array" + }, + { + "type": "string", + "enum": [ + "values", + "messages", + "updates", + "events", + "debug" + ] + } + ], + "title": "Stream Mode", + "default": [ + "values" + ] + }, + "feedback_keys": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Feedback Keys" + } + }, + "type": "object", + "required": [ + "assistant_id" + ], + "title": "RunStream", + "description": "Payload for creating a streaming run." + }, + "SearchRequest": { + "properties": { + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata to search for." + }, + "limit": { + "type": "integer", + "title": "Limit", + "description": "Maximum number to return.", + "default": 10, + "minimum": 1, + "maximum": 1000 + }, + "offset": { + "type": "integer", + "title": "Offset", + "description": "Offset to start from.", + "default": 0, + "minimum": 0 + } + }, + "type": "object", + "title": "SearchRequest", + "description": "Payload for listing assistants/threads/runs." + }, + "Thread": { + "properties": { + "thread_id": { + "type": "string", + "format": "uuid", + "title": "Thread Id" + }, + "created_at": { + "type": "string", + "format": "date-time", + "title": "Created At" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "title": "Updated At" + }, + "metadata": { + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "thread_id", + "created_at", + "updated_at", + "metadata" + ], + "title": "Thread" + }, + "ThreadCreate": { + "properties": { + "thread_id": { + "type": "string", + "format": "uuid", + "title": "Thread Id", + "description": "The ID of the thread. If not provided, an ID is generated." + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata for the thread." + } + }, + "type": "object", + "title": "ThreadCreate", + "description": "Payload for creating a thread." + }, + "ThreadPatch": { + "properties": { + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata to merge with existing thread metadata." + } + }, + "type": "object", + "title": "ThreadPatch", + "description": "Payload for creating a thread." + }, + "ThreadState": { + "properties": { + "values": { + "anyOf": [ + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "object" + } + ], + "title": "Values" + }, + "next": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Next" + }, + "checkpoint_id": { + "type": "string", + "title": "Checkpoint Id" + }, + "metadata": { + "type": "object", + "title": "Metadata" + }, + "created_at": { + "type": "string", + "title": "Created At" + }, + "parent_checkpoint_id": { + "type": "string", + "title": "Parent Checkpoint Id" + } + }, + "type": "object", + "required": [ + "values", + "next", + "checkpoint_id", + "metadata", + "created_at", + "parent_checkpoint_id" + ], + "title": "ThreadState" + }, + "ThreadStatePatch": { + "properties": { + "metadata": { + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "metadata" + ], + "title": "ThreadStatePatch", + "description": "Payload for patching state of a thread." + }, + "ThreadStateSearch": { + "properties": { + "limit": { + "type": "integer", + "title": "Limit", + "description": "The maximum number of states to return.", + "default": 10, + "maximum": 1000, + "minimum": 1 + }, + "before": { + "type": "string", + "title": "Before", + "description": "Return states before this checkpoint ID." + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Filter states by metadata key-value pairs." + } + }, + "type": "object", + "title": "ThreadStateSearch" + }, + "ThreadStateUpdate": { + "properties": { + "values": { + "anyOf": [ + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "object" + } + ], + "title": "Values" + }, + "checkpoint_id": { + "type": "string", + "title": "Checkpoint Id" + }, + "as_node": { + "type": "string", + "title": "As Node" + } + }, + "type": "object", + "required": [ + "values" + ], + "title": "ThreadStateUpdate", + "description": "Payload for adding state to a thread." + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + } + } + } +} \ No newline at end of file diff --git a/docs/docs/cloud/reference/api_ref.md b/docs/docs/cloud/reference/api_ref.md deleted file mode 100644 index 70ad43dce..000000000 --- a/docs/docs/cloud/reference/api_ref.md +++ /dev/null @@ -1,2 +0,0 @@ -# API Reference -Coming soon diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 0a5de77b9..11ecb4439 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -204,7 +204,7 @@ nav: - Conceptual Guides: 'cloud/concepts/index.md' - Reference: - - API: 'cloud/reference/api_ref.md' + - API: 'cloud/reference/api/api_ref.md' - SDK: - Python: 'cloud/reference/sdk/python_sdk_ref.md' - JS/TS: 'cloud/reference/sdk/js_ts_sdk_ref.md'