diff --git a/libs/sdk-js/src/client.ts b/libs/sdk-js/src/client.ts index bc3a22e0d..b2cddc8a3 100644 --- a/libs/sdk-js/src/client.ts +++ b/libs/sdk-js/src/client.ts @@ -223,8 +223,13 @@ export class AssistantsClient extends BaseClient { * @param assistantId The ID of the assistant. * @returns Serialized graph */ - async getGraph(assistantId: string): Promise { - return this.fetch(`/assistants/${assistantId}/graph`); + async getGraph( + assistantId: string, + options?: { xray?: boolean }, + ): 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 9125f8bb1..a466c4dc8 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -304,11 +304,14 @@ async def get(self, assistant_id: str) -> Assistant: """ # noqa: E501 return await self.http.get(f"/assistants/{assistant_id}") - async def get_graph(self, assistant_id: str) -> dict[str, list[dict[str, Any]]]: + async def get_graph( + self, assistant_id: str, *, xray: bool = False + ) -> dict[str, list[dict[str, Any]]]: """Get the graph of an assistant by ID. Args: assistant_id: The ID of the assistant to get the graph of. + xray: Include graph representation of subgraphs. Returns: Graph: The graph information for the assistant in JSON format. @@ -338,7 +341,9 @@ async def get_graph(self, assistant_id: str) -> dict[str, list[dict[str, Any]]]: """ # noqa: E501 - return await self.http.get(f"/assistants/{assistant_id}/graph") + return await self.http.get( + f"/assistants/{assistant_id}/graph", params={"xray": xray} + ) async def get_schemas(self, assistant_id: str) -> GraphSchema: """Get the schemas of an assistant by ID. @@ -2068,11 +2073,14 @@ def get(self, assistant_id: str) -> Assistant: """ # noqa: E501 return self.http.get(f"/assistants/{assistant_id}") - def get_graph(self, assistant_id: str) -> dict[str, list[dict[str, Any]]]: + def get_graph( + self, assistant_id: str, *, xray: bool = False + ) -> dict[str, list[dict[str, Any]]]: """Get the graph of an assistant by ID. Args: assistant_id: The ID of the assistant to get the graph of. + xray: Include graph representation of subgraphs. Returns: Graph: The graph information for the assistant in JSON format. @@ -2102,7 +2110,7 @@ def get_graph(self, assistant_id: str) -> dict[str, list[dict[str, Any]]]: """ # noqa: E501 - return self.http.get(f"/assistants/{assistant_id}/graph") + return self.http.get(f"/assistants/{assistant_id}/graph", params={"xray": xray}) def get_schemas(self, assistant_id: str) -> GraphSchema: """Get the schemas of an assistant by ID.