From 10b62273042d2a0dd8e809dfd2508d57615cf94e Mon Sep 17 00:00:00 2001 From: Tat Dat Duong Date: Mon, 30 Sep 2024 00:18:07 +0200 Subject: [PATCH] feat(api): add int xray parameter support --- libs/sdk-js/src/client.ts | 3 ++- libs/sdk-py/langgraph_sdk/client.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/sdk-js/src/client.ts b/libs/sdk-js/src/client.ts index b2cddc8a3..d00b01edc 100644 --- a/libs/sdk-js/src/client.ts +++ b/libs/sdk-js/src/client.ts @@ -221,11 +221,12 @@ export class AssistantsClient extends BaseClient { /** * Get the JSON representation of the graph assigned to a runnable * @param assistantId The ID of the assistant. + * @param options.xray Whether to include subgraphs in the serialized graph representation. * @returns Serialized graph */ async getGraph( assistantId: string, - options?: { xray?: boolean }, + options?: { xray?: boolean | number }, ): Promise { return this.fetch(`/assistants/${assistantId}/graph`, { params: { xray: options?.xray }, diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index a466c4dc8..1a1db39fc 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -305,7 +305,7 @@ class AssistantsClient: return await self.http.get(f"/assistants/{assistant_id}") async def get_graph( - self, assistant_id: str, *, xray: bool = False + self, assistant_id: str, *, xray: Union[int, bool] = False ) -> dict[str, list[dict[str, Any]]]: """Get the graph of an assistant by ID. @@ -2074,7 +2074,7 @@ class SyncAssistantsClient: return self.http.get(f"/assistants/{assistant_id}") def get_graph( - self, assistant_id: str, *, xray: bool = False + self, assistant_id: str, *, xray: Union[int, bool] = False ) -> dict[str, list[dict[str, Any]]]: """Get the graph of an assistant by ID.