From 33fbd1bb9c83d38a8f65045a57f06510360c468f Mon Sep 17 00:00:00 2001 From: Andrew Nguonly Date: Mon, 24 Nov 2025 10:58:54 -0800 Subject: [PATCH] feat(sdk-py): Add `name` parameter to Assistants search API (#6483) **Description:** The Agent Server API now supports searching for assistants by name. --- docs/docs/cloud/reference/api/openapi.json | 716 ++++++++------------- libs/sdk-py/langgraph_sdk/client.py | 10 + libs/sdk-py/langgraph_sdk/schema.py | 1 + 3 files changed, 289 insertions(+), 438 deletions(-) diff --git a/docs/docs/cloud/reference/api/openapi.json b/docs/docs/cloud/reference/api/openapi.json index 54da9444c..7b779c898 100644 --- a/docs/docs/cloud/reference/api/openapi.json +++ b/docs/docs/cloud/reference/api/openapi.json @@ -45,9 +45,7 @@ "paths": { "/assistants": { "post": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Create Assistant", "description": "Create an assistant.\n\nAn initial version of the assistant will be created and the assistant is set to that version. To change versions, use the `POST /assistants/{assistant_id}/latest` endpoint.", "operationId": "create_assistant_assistants_post", @@ -107,9 +105,7 @@ }, "/assistants/search": { "post": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Search Assistants", "description": "Search for assistants.\n\nThis endpoint also functions as the endpoint to list all assistants.", "operationId": "search_assistants_assistants_search_post", @@ -163,9 +159,7 @@ }, "/assistants/count": { "post": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Count Assistants", "description": "Get the count of assistants matching the specified criteria.", "operationId": "count_assistants_assistants_count_post", @@ -216,9 +210,7 @@ }, "/assistants/{assistant_id}": { "get": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Get Assistant", "description": "Get an assistant by ID.", "operationId": "get_assistant_assistants__assistant_id__get", @@ -260,9 +252,7 @@ } }, "delete": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Delete Assistant", "description": "Delete an assistant by ID.\n\nAll versions of the assistant will be deleted as well.", "operationId": "delete_assistant_assistants__assistant_id__delete", @@ -312,9 +302,7 @@ } }, "patch": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Patch Assistant", "description": "Update an assistant.", "operationId": "patch_assistant_assistants__assistant_id__patch", @@ -378,9 +366,7 @@ }, "/assistants/{assistant_id}/graph": { "get": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Get Assistant Graph", "description": "Get an assistant by ID.", "operationId": "get_assistant_graph_assistants__assistant_id__graph_get", @@ -469,9 +455,7 @@ }, "/assistants/{assistant_id}/subgraphs": { "get": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Get Assistant Subgraphs", "description": "Get an assistant's subgraphs.", "operationId": "get_assistant_subgraphs_assistants__assistant_id__subgraphs_get", @@ -535,9 +519,7 @@ }, "/assistants/{assistant_id}/subgraphs/{namespace}": { "get": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Get Assistant Subgraphs by Namespace", "description": "Get an assistant's subgraphs filtered by namespace.", "operationId": "get_assistant_subgraphs_assistants__assistant_id__subgraphs__namespace__get", @@ -601,9 +583,7 @@ }, "/assistants/{assistant_id}/schemas": { "get": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Get Assistant Schemas", "description": "Get an assistant by ID.", "operationId": "get_assistant_schemas_assistants__assistant_id__schemas_get", @@ -657,9 +637,7 @@ }, "/assistants/{assistant_id}/versions": { "post": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Get Assistant Versions", "description": "Get all versions of an assistant.", "operationId": "get_assistant_versions_assistants__assistant_id__versions_get", @@ -707,9 +685,7 @@ }, "/assistants/{assistant_id}/latest": { "post": { - "tags": [ - "Assistants" - ], + "tags": ["Assistants"], "summary": "Set Latest Assistant Version", "description": "Set the latest version for an assistant.", "operationId": "set_latest_assistant_version_assistants__assistant_id__versions_post", @@ -774,9 +750,7 @@ }, "/threads": { "post": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Create Thread", "description": "Create a thread.", "operationId": "create_thread_threads_post", @@ -826,9 +800,7 @@ }, "/threads/search": { "post": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Search Threads", "description": "Search for threads.\n\nThis endpoint also functions as the endpoint to list all threads.", "operationId": "search_threads_threads_search_post", @@ -872,9 +844,7 @@ }, "/threads/count": { "post": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Count Threads", "description": "Get the count of threads matching the specified criteria.", "operationId": "count_threads_threads_count_post", @@ -925,9 +895,7 @@ }, "/threads/{thread_id}/state": { "get": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Get Thread State", "description": "Get state for a thread.\n\nThe latest state of the thread (i.e. latest checkpoint) is returned.", "operationId": "get_latest_thread_state_threads__thread_id__state_get", @@ -980,9 +948,7 @@ } }, "post": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Update Thread State", "description": "Add state to a thread.", "operationId": "update_thread_state_threads__thread_id__state_post", @@ -1036,9 +1002,7 @@ }, "/threads/{thread_id}/state/{checkpoint_id}": { "get": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Get Thread State At Checkpoint", "description": "Get state for a thread at a specific checkpoint.", "operationId": "get_thread_state_at_checkpoint_threads__thread_id__state__checkpoint_id__get", @@ -1105,9 +1069,7 @@ }, "/threads/{thread_id}/state/checkpoint": { "post": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Get Thread State At Checkpoint", "description": "Get state for a thread at a specific checkpoint.", "operationId": "post_thread_state_at_checkpoint_threads__thread_id__state__checkpoint_id__get", @@ -1171,9 +1133,7 @@ }, "/threads/{thread_id}/history": { "get": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Get Thread History", "description": "Get all past states for a thread.", "operationId": "get_thread_history_threads__thread_id__history_get", @@ -1238,9 +1198,7 @@ } }, "post": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Get Thread History Post", "description": "Get all past states for a thread.", "operationId": "get_thread_history_post_threads__thread_id__history_post", @@ -1298,9 +1256,7 @@ }, "/threads/{thread_id}/copy": { "post": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Copy Thread", "description": "Create a new thread with a copy of the state and checkpoints from an existing thread.", "operationId": "copy_thread_post_threads__thread_id__copy_post", @@ -1354,9 +1310,7 @@ }, "/threads/{thread_id}": { "get": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Get Thread", "description": "Get a thread by ID.", "operationId": "get_thread_threads__thread_id__get", @@ -1408,9 +1362,7 @@ } }, "delete": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Delete Thread", "description": "Delete a thread by ID.", "operationId": "delete_thread_threads__thread_id__delete", @@ -1460,9 +1412,7 @@ } }, "patch": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Patch Thread", "description": "Update a thread.", "operationId": "patch_thread_threads__thread_id__patch", @@ -1526,9 +1476,7 @@ }, "/threads/{thread_id}/stream": { "get": { - "tags": [ - "Threads" - ], + "tags": ["Threads"], "summary": "Join Thread Stream", "description": "This endpoint streams output in real-time from a thread. The stream will include the output of each run executed sequentially on the thread and will remain open indefinitely. It is the responsibility of the calling client to close the connection.", "operationId": "join_thread_stream_threads__thread_id__stream_get", @@ -1616,9 +1564,7 @@ }, "/threads/{thread_id}/runs": { "get": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "List Runs", "description": "List runs for a thread.", "operationId": "list_runs_http_threads__thread_id__runs_get", @@ -1659,13 +1605,7 @@ "required": false, "schema": { "type": "string", - "enum": [ - "pending", - "error", - "success", - "timeout", - "interrupted" - ] + "enum": ["pending", "error", "success", "timeout", "interrupted"] }, "name": "status", "in": "query" @@ -1732,9 +1672,7 @@ } }, "post": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Create Background Run", "description": "Create a run in existing thread, return the run ID immediately. Don't wait for the final run output.", "operationId": "create_run_threads__thread_id__runs_post", @@ -1816,9 +1754,7 @@ }, "/threads/{thread_id}/runs/crons": { "post": { - "tags": [ - "Crons (Plus tier)" - ], + "tags": ["Crons (Plus tier)"], "summary": "Create Thread Cron", "description": "Create a cron to schedule runs on a thread.", "operationId": "create_thread_cron_threads__thread_id__runs_crons_post", @@ -1840,7 +1776,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CronCreate" + "$ref": "#/components/schemas/ThreadCronCreate" } } }, @@ -1882,9 +1818,7 @@ }, "/threads/{thread_id}/runs/stream": { "post": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Create Run, Stream Output", "description": "Create a run in existing thread. Stream the output.", "operationId": "stream_run_threads__thread_id__runs_stream_post", @@ -1967,9 +1901,7 @@ }, "/threads/{thread_id}/runs/wait": { "post": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Create Run, Wait for Output", "description": "Create a run in existing thread. Wait for the final output and then return it.", "operationId": "wait_run_threads__thread_id__runs_wait_post", @@ -2049,9 +1981,7 @@ }, "/threads/{thread_id}/runs/{run_id}": { "get": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Get Run", "description": "Get a run by ID.", "operationId": "get_run_http_threads__thread_id__runs__run_id__get", @@ -2115,9 +2045,7 @@ } }, "delete": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Delete Run", "description": "Delete a run by ID.", "operationId": "delete_run_threads__thread_id__runs__run_id__delete", @@ -2181,9 +2109,7 @@ }, "/threads/{thread_id}/runs/{run_id}/join": { "get": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Join Run", "description": "Wait for a run to finish.", "operationId": "join_run_http_threads__thread_id__runs__run_id__join_get", @@ -2258,9 +2184,7 @@ }, "/threads/{thread_id}/runs/{run_id}/stream": { "get": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Join Run Stream", "description": "Join a run stream. This endpoint streams output in real-time from a run similar to the /threads/__THREAD_ID__/runs/stream endpoint. If the run has been created with `stream_resumable=true`, the stream can be resumed from the last seen event ID.", "operationId": "stream_run_http_threads__thread_id__runs__run_id__join_get", @@ -2358,9 +2282,7 @@ }, "/threads/{thread_id}/runs/{run_id}/cancel": { "post": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Cancel Run", "operationId": "cancel_run_http_threads__thread_id__runs__run_id__cancel_post", "parameters": [ @@ -2403,10 +2325,7 @@ "required": false, "schema": { "type": "string", - "enum": [ - "interrupt", - "rollback" - ], + "enum": ["interrupt", "rollback"], "title": "Action", "default": "interrupt" }, @@ -2448,9 +2367,7 @@ }, "/runs/crons": { "post": { - "tags": [ - "Crons (Plus tier)" - ], + "tags": ["Crons (Plus tier)"], "summary": "Create Cron", "description": "Create a cron to schedule runs on new threads.", "operationId": "create_cron_runs_crons_post", @@ -2500,9 +2417,7 @@ }, "/runs/crons/search": { "post": { - "tags": [ - "Crons (Plus tier)" - ], + "tags": ["Crons (Plus tier)"], "summary": "Search Crons", "description": "Search all active crons", "operationId": "search_crons_runs_crons_post", @@ -2546,9 +2461,7 @@ }, "/runs/crons/count": { "post": { - "tags": [ - "Crons (Plus tier)" - ], + "tags": ["Crons (Plus tier)"], "summary": "Count Crons", "description": "Get the count of crons matching the specified criteria.", "operationId": "count_crons_runs_crons_count_post", @@ -2599,9 +2512,7 @@ }, "/runs/stream": { "post": { - "tags": [ - "Stateless Runs" - ], + "tags": ["Stateless Runs"], "summary": "Create Run, Stream Output", "description": "Create a run in a new thread, stream the output.", "operationId": "stream_run_stateless_runs_stream_post", @@ -2670,9 +2581,7 @@ }, "/runs/cancel": { "post": { - "tags": [ - "Thread Runs" - ], + "tags": ["Thread Runs"], "summary": "Cancel Runs", "description": "Cancel one or more runs. Can cancel runs by thread ID and run IDs, or by status filter.", "operationId": "cancel_runs_post", @@ -2682,10 +2591,7 @@ "required": false, "schema": { "type": "string", - "enum": [ - "interrupt", - "rollback" - ], + "enum": ["interrupt", "rollback"], "title": "Action", "default": "interrupt" }, @@ -2732,9 +2638,7 @@ }, "/runs/wait": { "post": { - "tags": [ - "Stateless Runs" - ], + "tags": ["Stateless Runs"], "summary": "Create Run, Wait for Output", "description": "Create a run in a new thread. Wait for the final output and then return it.", "operationId": "wait_run_stateless_runs_wait_post", @@ -2800,9 +2704,7 @@ }, "/runs": { "post": { - "tags": [ - "Stateless Runs" - ], + "tags": ["Stateless Runs"], "summary": "Create Background Run", "description": "Create a run in a new thread, return the run ID immediately. Don't wait for the final run output.", "operationId": "run_stateless_runs_post", @@ -2868,9 +2770,7 @@ }, "/runs/batch": { "post": { - "tags": [ - "Stateless Runs" - ], + "tags": ["Stateless Runs"], "summary": "Create Run Batch", "description": "Create a batch of runs in new threads, return immediately.", "operationId": "run_batch_stateless_runs_post", @@ -2928,9 +2828,7 @@ }, "/runs/crons/{cron_id}": { "delete": { - "tags": [ - "Crons (Plus tier)" - ], + "tags": ["Crons (Plus tier)"], "summary": "Delete Cron", "description": "Delete a cron by ID.", "operationId": "delete_cron_runs_crons__cron_id__delete", @@ -2980,9 +2878,7 @@ }, "/store/items": { "put": { - "tags": [ - "Store" - ], + "tags": ["Store"], "summary": "Store or update an item.", "operationId": "put_item", "requestBody": { @@ -3012,9 +2908,7 @@ } }, "delete": { - "tags": [ - "Store" - ], + "tags": ["Store"], "summary": "Delete an item.", "operationId": "delete_item", "requestBody": { @@ -3044,9 +2938,7 @@ } }, "get": { - "tags": [ - "Store" - ], + "tags": ["Store"], "summary": "Retrieve a single item.", "operationId": "get_item", "parameters": [ @@ -3106,9 +2998,7 @@ }, "/store/items/search": { "post": { - "tags": [ - "Store" - ], + "tags": ["Store"], "summary": "Search for items within a namespace prefix.", "operationId": "search_items", "requestBody": { @@ -3147,9 +3037,7 @@ }, "/store/namespaces": { "post": { - "tags": [ - "Store" - ], + "tags": ["Store"], "summary": "List namespaces with optional match conditions.", "operationId": "list_namespaces", "requestBody": { @@ -3268,7 +3156,7 @@ "required": ["kind", "text"] }, { - "title": "Data Part", + "title": "Data Part", "type": "object", "properties": { "kind": { @@ -3370,9 +3258,7 @@ "description": "Internal server error" } }, - "tags": [ - "A2A" - ] + "tags": ["A2A"] } }, "/mcp/": { @@ -3387,9 +3273,7 @@ "required": true, "schema": { "type": "string", - "enum": [ - "application/json, text/event-stream" - ] + "enum": ["application/json, text/event-stream"] }, "description": "Accept header must include both 'application/json' and 'text/event-stream' media types." } @@ -3442,9 +3326,7 @@ "description": "Internal server error or unexpected failure." } }, - "tags": [ - "MCP" - ] + "tags": ["MCP"] }, "get": { "operationId": "get_mcp", @@ -3455,9 +3337,7 @@ "description": "GET method not allowed; streaming not supported." } }, - "tags": [ - "MCP" - ] + "tags": ["MCP"] }, "delete": { "operationId": "delete_mcp", @@ -3466,16 +3346,12 @@ "responses": { "404": {} }, - "tags": [ - "MCP" - ] + "tags": ["MCP"] } }, "/info": { "get": { - "tags": [ - "System" - ], + "tags": ["System"], "summary": "Server Information", "description": "Get server version information, feature flags, and metadata.", "operationId": "server_info_info_get", @@ -3508,7 +3384,12 @@ "description": "Server deployment metadata" } }, - "required": ["version", "langgraph_py_version", "flags", "metadata"], + "required": [ + "version", + "langgraph_py_version", + "flags", + "metadata" + ], "title": "ServerInfo" } } @@ -3519,9 +3400,7 @@ }, "/metrics": { "get": { - "tags": [ - "System" - ], + "tags": ["System"], "summary": "System Metrics", "description": "Get system metrics in Prometheus or JSON format for monitoring and observability.", "operationId": "system_metrics_metrics_get", @@ -3564,9 +3443,7 @@ }, "/ok": { "get": { - "tags": [ - "System" - ], + "tags": ["System"], "summary": "Health Check", "description": "Check the health status of the server. Optionally check database connectivity.", "operationId": "health_check_ok_get", @@ -3689,10 +3566,7 @@ "description": "The name of the assistant" }, "description": { - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "title": "Assistant Description", "description": "The description of the assistant" } @@ -3738,10 +3612,7 @@ }, "if_exists": { "type": "string", - "enum": [ - "raise", - "do_nothing" - ], + "enum": ["raise", "do_nothing"], "title": "If Exists", "description": "How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing assistant).", "default": "raise" @@ -3752,18 +3623,13 @@ "description": "The name of the assistant. Defaults to 'Untitled'." }, "description": { - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "title": "Description", "description": "The description of the assistant. Defaults to null." } }, "type": "object", - "required": [ - "graph_id" - ], + "required": ["graph_id"], "title": "AssistantCreate", "description": "Payload for creating an assistant." }, @@ -4001,9 +3867,7 @@ "anyOf": [ { "type": "string", - "enum": [ - "*" - ] + "enum": ["*"] }, { "items": { @@ -4019,9 +3883,7 @@ "anyOf": [ { "type": "string", - "enum": [ - "*" - ] + "enum": ["*"] }, { "items": { @@ -4033,26 +3895,19 @@ "title": "Interrupt After", "description": "Nodes to interrupt immediately after they get executed." }, - "multitask_strategy": { + "on_run_completed": { "type": "string", - "enum": [ - "reject", - "rollback", - "interrupt", - "enqueue" - ], - "title": "Multitask Strategy", - "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.", - "default": "enqueue" + "enum": ["delete", "keep"], + "default": "delete", + "title": "On Run Completed", + "description": "What to do with the thread after the run completes. 'delete' removes the thread after execution. 'keep' creates a new thread for each execution but does not clean them up." } }, "type": "object", - "required": [ - "assistant_id", - "schedule" - ], + "required": ["assistant_id", "schedule"], + "additionalProperties": true, "title": "CronCreate", - "description": "Payload for creating a cron job." + "description": "Payload for creating a stateless cron job (creates a new thread for each execution)." }, "CronSearch": { "properties": { @@ -4088,7 +3943,15 @@ "title": "Sort By", "description": "The field to sort by.", "default": "created_at", - "enum": ["cron_id", "assistant_id", "thread_id", "next_run_date", "end_time", "created_at", "updated_at"] + "enum": [ + "cron_id", + "assistant_id", + "thread_id", + "next_run_date", + "end_time", + "created_at", + "updated_at" + ] }, "sort_order": { "type": "string", @@ -4105,6 +3968,7 @@ "cron_id", "assistant_id", "thread_id", + "on_run_completed", "end_time", "schedule", "created_at", @@ -4178,10 +4042,7 @@ } }, "type": "object", - "required": [ - "graph_id", - "state_schema" - ], + "required": ["graph_id", "state_schema"], "title": "GraphSchema", "description": "Defines the structure and properties of a graph." }, @@ -4214,11 +4075,7 @@ } }, "type": "object", - "required": [ - "input_schema", - "output_schema", - "state_schema" - ], + "required": ["input_schema", "output_schema", "state_schema"], "title": "GraphSchemaNoId", "description": "Defines the structure and properties of a graph without an ID." }, @@ -4286,12 +4143,7 @@ }, "multitask_strategy": { "type": "string", - "enum": [ - "reject", - "rollback", - "interrupt", - "enqueue" - ], + "enum": ["reject", "rollback", "interrupt", "enqueue"], "title": "Multitask Strategy", "description": "Strategy to handle concurrent runs on the same thread." } @@ -4321,22 +4173,12 @@ "description": "The node to send the message to." }, "input": { - "type": [ - "object", - "array", - "number", - "string", - "boolean", - "null" - ], + "type": ["object", "array", "number", "string", "boolean", "null"], "title": "Message", "description": "The message to send." } }, - "required": [ - "node", - "input" - ] + "required": ["node", "input"] }, "Command": { "type": "object", @@ -4344,23 +4186,12 @@ "description": "The command to run.", "properties": { "update": { - "type": [ - "object", - "array", - "null" - ], + "type": ["object", "array", "null"], "title": "Update", "description": "An update to the state." }, "resume": { - "type": [ - "object", - "array", - "number", - "string", - "boolean", - "null" - ], + "type": ["object", "array", "number", "string", "boolean", "null"], "title": "Resume", "description": "A value to pass to an interrupted node." }, @@ -4495,9 +4326,7 @@ "anyOf": [ { "type": "string", - "enum": [ - "*" - ] + "enum": ["*"] }, { "items": { @@ -4513,9 +4342,7 @@ "anyOf": [ { "type": "string", - "enum": [ - "*" - ] + "enum": ["*"] }, { "items": { @@ -4563,9 +4390,7 @@ ], "title": "Stream Mode", "description": "The stream mode(s) to use.", - "default": [ - "values" - ] + "default": ["values"] }, "stream_subgraphs": { "type": "boolean", @@ -4581,10 +4406,7 @@ }, "on_disconnect": { "type": "string", - "enum": [ - "cancel", - "continue" - ], + "enum": ["cancel", "continue"], "title": "On Disconnect", "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.", "default": "cancel" @@ -4599,22 +4421,14 @@ }, "multitask_strategy": { "type": "string", - "enum": [ - "reject", - "rollback", - "interrupt", - "enqueue" - ], + "enum": ["reject", "rollback", "interrupt", "enqueue"], "title": "Multitask Strategy", "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.", "default": "enqueue" }, "if_not_exists": { "type": "string", - "enum": [ - "create", - "reject" - ], + "enum": ["create", "reject"], "title": "If Not Exists", "description": "How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).", "default": "reject" @@ -4632,20 +4446,14 @@ }, "durability": { "type": "string", - "enum": [ - "sync", - "async", - "exit" - ], + "enum": ["sync", "async", "exit"], "title": "Durability", "description": "Durability level for the run. Must be one of 'sync', 'async', or 'exit'.", "default": "async" } }, "type": "object", - "required": [ - "assistant_id" - ], + "required": ["assistant_id"], "title": "RunCreateStateful", "description": "Payload for creating a run." }, @@ -4754,9 +4562,7 @@ "anyOf": [ { "type": "string", - "enum": [ - "*" - ] + "enum": ["*"] }, { "items": { @@ -4772,9 +4578,7 @@ "anyOf": [ { "type": "string", - "enum": [ - "*" - ] + "enum": ["*"] }, { "items": { @@ -4822,9 +4626,7 @@ ], "title": "Stream Mode", "description": "The stream mode(s) to use.", - "default": [ - "values" - ] + "default": ["values"] }, "feedback_keys": { "items": { @@ -4848,20 +4650,14 @@ }, "on_completion": { "type": "string", - "enum": [ - "delete", - "keep" - ], + "enum": ["delete", "keep"], "title": "On Completion", "description": "Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.", "default": "delete" }, "on_disconnect": { "type": "string", - "enum": [ - "cancel", - "continue" - ], + "enum": ["cancel", "continue"], "title": "On Disconnect", "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.", "default": "cancel" @@ -4879,20 +4675,14 @@ }, "durability": { "type": "string", - "enum": [ - "sync", - "async", - "exit" - ], + "enum": ["sync", "async", "exit"], "title": "Durability", "description": "Durability level for the run. Must be one of 'sync', 'async', or 'exit'.", "default": "async" } }, "type": "object", - "required": [ - "assistant_id" - ], + "required": ["assistant_id"], "title": "RunCreateStateless", "description": "Payload for creating a run." }, @@ -4908,6 +4698,11 @@ "title": "Graph Id", "description": "The ID of the graph to filter by. The graph ID is normally set in your langgraph.json configuration." }, + "name": { + "type": "string", + "title": "Name", + "description": "Name of the assistant to filter by. The filtering logic will match (case insensitive) assistants where 'name' is a substring of the assistant name." + }, "limit": { "type": "integer", "title": "Limit", @@ -4937,10 +4732,7 @@ }, "sort_order": { "type": "string", - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "title": "Sort Order", "description": "The order to sort by." }, @@ -4950,7 +4742,7 @@ "type": "string", "enum": [ "assistant_id", - "graph_id", + "graph_id", "name", "description", "config", @@ -5017,7 +4809,10 @@ "properties": { "ids": { "type": "array", - "items": {"type": "string", "format": "uuid"}, + "items": { + "type": "string", + "format": "uuid" + }, "title": "Ids", "description": "List of thread IDs to include. Others are excluded." }, @@ -5033,12 +4828,7 @@ }, "status": { "type": "string", - "enum": [ - "idle", - "busy", - "interrupted", - "error" - ], + "enum": ["idle", "busy", "interrupted", "error"], "title": "Status", "description": "Thread status to filter on." }, @@ -5059,21 +4849,13 @@ }, "sort_by": { "type": "string", - "enum": [ - "thread_id", - "status", - "created_at", - "updated_at" - ], + "enum": ["thread_id", "status", "created_at", "updated_at"], "title": "Sort By", "description": "Sort by field." }, "sort_order": { "type": "string", - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "title": "Sort Order", "description": "Sort order." }, @@ -5115,12 +4897,7 @@ }, "status": { "type": "string", - "enum": [ - "idle", - "busy", - "interrupted", - "error" - ], + "enum": ["idle", "busy", "interrupted", "error"], "title": "Status", "description": "Thread status to filter on." } @@ -5161,12 +4938,7 @@ }, "status": { "type": "string", - "enum": [ - "idle", - "busy", - "interrupted", - "error" - ], + "enum": ["idle", "busy", "interrupted", "error"], "title": "Status", "description": "The status of the thread." }, @@ -5206,10 +4978,7 @@ }, "if_exists": { "type": "string", - "enum": [ - "raise", - "do_nothing" - ], + "enum": ["raise", "do_nothing"], "title": "If Exists", "description": "How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).", "default": "raise" @@ -5221,9 +4990,7 @@ "properties": { "strategy": { "type": "string", - "enum": [ - "delete" - ], + "enum": ["delete"], "description": "The TTL strategy. 'delete' removes the entire thread.", "default": "delete" }, @@ -5245,9 +5012,7 @@ } } }, - "required": [ - "updates" - ] + "required": ["updates"] } } }, @@ -5269,9 +5034,7 @@ "properties": { "strategy": { "type": "string", - "enum": [ - "delete" - ], + "enum": ["delete"], "description": "The TTL strategy. 'delete' removes the entire thread.", "default": "delete" }, @@ -5299,9 +5062,7 @@ "description": "Include subgraph states." } }, - "required": [ - "checkpoint" - ], + "required": ["checkpoint"], "type": "object", "title": "ThreadStateCheckpointRequest", "description": "Payload for getting the state of a thread at a checkpoint." @@ -5359,10 +5120,7 @@ "$ref": "#/components/schemas/ThreadState" } }, - "required": [ - "id", - "name" - ] + "required": ["id", "name"] }, "type": "array", "title": "Tasks" @@ -5391,13 +5149,7 @@ } }, "type": "object", - "required": [ - "values", - "next", - "checkpoint", - "metadata", - "created_at" - ], + "required": ["values", "next", "checkpoint", "metadata", "created_at"], "title": "ThreadState" }, "ThreadStateSearch": { @@ -5496,9 +5248,7 @@ "description": "Update the state as if this node had just executed." } }, - "required": [ - "as_node" - ], + "required": ["as_node"], "type": "object" }, "ThreadStateUpdateResponse": { @@ -5537,11 +5287,7 @@ }, "StorePutRequest": { "type": "object", - "required": [ - "namespace", - "key", - "value" - ], + "required": ["namespace", "key", "value"], "properties": { "namespace": { "type": "array", @@ -5567,9 +5313,7 @@ }, "StoreDeleteRequest": { "type": "object", - "required": [ - "key" - ], + "required": ["key"], "properties": { "namespace": { "type": "array", @@ -5592,10 +5336,7 @@ "type": "object", "properties": { "namespace_prefix": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" }, @@ -5603,10 +5344,7 @@ "description": "List of strings representing the namespace prefix." }, "filter": { - "type": [ - "object", - "null" - ], + "type": ["object", "null"], "additionalProperties": true, "title": "Filter", "description": "Optional dictionary of key-value pairs to filter results." @@ -5624,10 +5362,7 @@ "description": "Number of items to skip before returning results (default is 0)." }, "query": { - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "title": "Query", "description": "Query string for semantic/vector search." } @@ -5675,13 +5410,7 @@ }, "Item": { "type": "object", - "required": [ - "namespace", - "key", - "value", - "created_at", - "updated_at" - ], + "required": ["namespace", "key", "value", "created_at", "updated_at"], "properties": { "namespace": { "type": "array", @@ -5718,11 +5447,7 @@ "properties": { "status": { "type": "string", - "enum": [ - "pending", - "running", - "all" - ], + "enum": ["pending", "running", "all"], "title": "Status", "description": "Filter runs by status to cancel. Must be one of 'pending', 'running', or 'all'." }, @@ -5744,23 +5469,16 @@ }, "oneOf": [ { - "required": [ - "status" - ] + "required": ["status"] }, { - "required": [ - "thread_id", - "run_ids" - ] + "required": ["thread_id", "run_ids"] } ] }, "SearchItemsResponse": { "type": "object", - "required": [ - "items" - ], + "required": ["items"], "properties": { "items": { "type": "array", @@ -5783,6 +5501,133 @@ "type": "string", "title": "ErrorResponse", "description": "Error message returned from the server" + }, + "ThreadCronCreate": { + "properties": { + "schedule": { + "type": "string", + "title": "Schedule", + "description": "The cron schedule to execute this job on." + }, + "end_time": { + "type": "string", + "format": "date-time", + "title": "End Time", + "description": "The end date to stop running the cron." + }, + "assistant_id": { + "anyOf": [ + { + "type": "string", + "format": "uuid", + "title": "Assistant Id" + }, + { + "type": "string", + "title": "Graph Id" + } + ], + "description": "The assistant ID or graph name to run. If using graph name, will default to the assistant automatically created from that graph by the server." + }, + "input": { + "anyOf": [ + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "object" + } + ], + "title": "Input", + "description": "The input to the graph." + }, + "metadata": { + "type": "object", + "title": "Metadata", + "description": "Metadata to assign to the cron job runs." + }, + "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", + "description": "The configuration for the assistant." + }, + "context": { + "type": "object", + "title": "Context", + "description": "Static context added to the assistant." + }, + "webhook": { + "type": "string", + "maxLength": 65536, + "minLength": 1, + "format": "uri-reference", + "title": "Webhook", + "description": "Webhook to call after LangGraph API call is done." + }, + "interrupt_before": { + "anyOf": [ + { + "type": "string", + "enum": ["*"] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt Before", + "description": "Nodes to interrupt immediately before they get executed." + }, + "interrupt_after": { + "anyOf": [ + { + "type": "string", + "enum": ["*"] + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Interrupt After", + "description": "Nodes to interrupt immediately after they get executed." + }, + "multitask_strategy": { + "type": "string", + "enum": ["reject", "rollback", "interrupt", "enqueue"], + "title": "Multitask Strategy", + "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.", + "default": "enqueue" + } + }, + "type": "object", + "required": ["assistant_id", "schedule"], + "title": "ThreadCronCreate", + "description": "Payload for creating a thread-specific cron job (runs on the same thread)." } }, "responses": { @@ -5838,19 +5683,14 @@ "type": "object", "properties": { "id": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "value": { "type": "object" } }, "title": "Interrupt", - "required": [ - "value" - ] + "required": ["value"] } } } diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index 9c1ecf27f..1a5961556 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -1033,6 +1033,7 @@ class AssistantsClient: *, metadata: Json = None, graph_id: str | None = None, + name: str | None = None, limit: int = 10, offset: int = 0, sort_by: AssistantSortBy | None = None, @@ -1047,6 +1048,8 @@ class AssistantsClient: metadata: Metadata to filter by. Exact match filter for each KV pair. graph_id: The ID of the graph to filter by. The graph ID is normally set in your langgraph.json configuration. + name: The name of the assistant to filter by. + The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name. limit: The maximum number of results to return. offset: The number of results to skip. sort_by: The field to sort by. @@ -1077,6 +1080,8 @@ class AssistantsClient: payload["metadata"] = metadata if graph_id: payload["graph_id"] = graph_id + if name: + payload["name"] = name if sort_by: payload["sort_by"] = sort_by if sort_order: @@ -4289,6 +4294,7 @@ class SyncAssistantsClient: *, metadata: Json = None, graph_id: str | None = None, + name: str | None = None, limit: int = 10, offset: int = 0, sort_by: AssistantSortBy | None = None, @@ -4303,6 +4309,8 @@ class SyncAssistantsClient: metadata: Metadata to filter by. Exact match filter for each KV pair. graph_id: The ID of the graph to filter by. The graph ID is normally set in your langgraph.json configuration. + name: The name of the assistant to filter by. + The filtering logic will match assistants where 'name' is a substring (case insensitive) of the assistant name. limit: The maximum number of results to return. offset: The number of results to skip. headers: Optional custom headers to include with the request. @@ -4330,6 +4338,8 @@ class SyncAssistantsClient: payload["metadata"] = metadata if graph_id: payload["graph_id"] = graph_id + if name: + payload["name"] = name if sort_by: payload["sort_by"] = sort_by if sort_order: diff --git a/libs/sdk-py/langgraph_sdk/schema.py b/libs/sdk-py/langgraph_sdk/schema.py index 43ff6430b..35ea2bc60 100644 --- a/libs/sdk-py/langgraph_sdk/schema.py +++ b/libs/sdk-py/langgraph_sdk/schema.py @@ -413,6 +413,7 @@ CronSelectField = Literal[ "next_run_date", "metadata", "now", + "on_run_completed", ] PrimitiveData = str | int | float | bool | None