From 098a199cb96f23d7453ff5cca387dfa6c579c078 Mon Sep 17 00:00:00 2001 From: Arjun Natarajan Date: Wed, 5 Mar 2025 15:39:34 -0500 Subject: [PATCH 1/2] update assistant version class --- libs/sdk-js/src/schema.ts | 6 +++--- libs/sdk-py/langgraph_sdk/client.py | 6 ++++-- libs/sdk-py/langgraph_sdk/schema.py | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/sdk-js/src/schema.ts b/libs/sdk-js/src/schema.ts index 84596c82c..b75d63d02 100644 --- a/libs/sdk-js/src/schema.ts +++ b/libs/sdk-js/src/schema.ts @@ -110,6 +110,9 @@ export interface AssistantBase { /** The version of the assistant. */ version: number; + + /** The name of the assistant */ + name: string; } export interface AssistantVersion extends AssistantBase {} @@ -117,9 +120,6 @@ export interface AssistantVersion extends AssistantBase {} export interface Assistant extends AssistantBase { /** The last time the assistant was updated. */ updated_at: string; - - /** The name of the assistant */ - name: string; } export interface AssistantGraph { diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index 2fcecd825..59d37c23e 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -388,7 +388,9 @@ class AssistantsClient: 'created_at': '2024-06-25T17:10:33.109781+00:00', 'updated_at': '2024-06-25T17:10:33.109781+00:00', 'config': {}, - 'metadata': {'created_by': 'system'} + 'metadata': {'created_by': 'system'}, + 'version': 1, + 'name': 'my_assistant' } """ # noqa: E501 @@ -742,7 +744,7 @@ class AssistantsClient: offset: The number of versions to skip. Returns: - list[Assistant]: A list of assistants. + list[AssistantVersion]: A list of assistant versions. Example Usage: diff --git a/libs/sdk-py/langgraph_sdk/schema.py b/libs/sdk-py/langgraph_sdk/schema.py index ab5ad65f5..f6b8bb164 100644 --- a/libs/sdk-py/langgraph_sdk/schema.py +++ b/libs/sdk-py/langgraph_sdk/schema.py @@ -169,6 +169,8 @@ class AssistantBase(TypedDict): """The assistant metadata.""" version: int """The version of the assistant""" + name: str + """The name of the assistant""" class AssistantVersion(AssistantBase): @@ -182,8 +184,6 @@ class Assistant(AssistantBase): updated_at: datetime """The last time the assistant was updated.""" - name: str - """The name of the assistant""" class Interrupt(TypedDict, total=False): From 003226cef4f8de59f2cd267bacdc3fd01bf71847 Mon Sep 17 00:00:00 2001 From: Arjun Natarajan Date: Wed, 5 Mar 2025 16:47:18 -0500 Subject: [PATCH 2/2] expose assistantbase --- libs/sdk-js/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/sdk-js/src/index.ts b/libs/sdk-js/src/index.ts index 0626144cd..71253b679 100644 --- a/libs/sdk-js/src/index.ts +++ b/libs/sdk-js/src/index.ts @@ -1,6 +1,7 @@ export { Client } from "./client.js"; export type { + AssistantBase, Assistant, AssistantVersion, AssistantGraph,