diff --git a/libs/sdk-js/src/client.mts b/libs/sdk-js/src/client.mts index 9081749af..184872ac5 100644 --- a/libs/sdk-js/src/client.mts +++ b/libs/sdk-js/src/client.mts @@ -310,6 +310,30 @@ export class AssistantsClient extends BaseClient { }, }); } + + /** + * List all versions of an assistant. + * + * @param assistantId ID of the assistant. + * @returns List of assistant versions. + */ + async getVersions(assistantId: string): Promise { + return this.fetch(`/assistants/${assistantId}/versions`); + } + + /** + * Change the version of an assistant. + * + * @param assistantId ID of the assistant. + * @param version The version to change to. + * @returns The updated assistant. + */ + async changeVersion(assistantId: string, version: number): Promise { + return this.fetch(`/assistants/${assistantId}/change_version`, { + method: "POST", + json: { version }, + }); + } } export class ThreadsClient extends BaseClient { diff --git a/libs/sdk-js/src/schema.ts b/libs/sdk-js/src/schema.ts index 1d772b7eb..11ae38843 100644 --- a/libs/sdk-js/src/schema.ts +++ b/libs/sdk-js/src/schema.ts @@ -82,6 +82,8 @@ export interface Assistant { created_at: string; updated_at: string; metadata: Metadata; + version: number; + name: string; } export type AssistantGraph = Record>>; diff --git a/libs/sdk-py/langgraph_sdk/schema.py b/libs/sdk-py/langgraph_sdk/schema.py index 5f58f02c2..790a57cf0 100644 --- a/libs/sdk-py/langgraph_sdk/schema.py +++ b/libs/sdk-py/langgraph_sdk/schema.py @@ -72,6 +72,10 @@ class Assistant(TypedDict): """The last time the assistant was updated.""" metadata: Json """The assistant metadata.""" + version: int + """The version of the assistant""" + name: str + """The name of the assistant""" class Thread(TypedDict):