mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-22 15:42:25 +02:00
Merge pull request #1900 from langchain-ai/dqbd/xray-int
feat(sdk): add int xray parameter support
This commit is contained in:
@@ -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. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.
|
||||
* @returns Serialized graph
|
||||
*/
|
||||
async getGraph(
|
||||
assistantId: string,
|
||||
options?: { xray?: boolean },
|
||||
options?: { xray?: boolean | number },
|
||||
): Promise<AssistantGraph> {
|
||||
return this.fetch<AssistantGraph>(`/assistants/${assistantId}/graph`, {
|
||||
params: { xray: options?.xray },
|
||||
|
||||
@@ -310,13 +310,13 @@ 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.
|
||||
|
||||
Args:
|
||||
assistant_id: The ID of the assistant to get the graph of.
|
||||
xray: Include graph representation of subgraphs.
|
||||
xray: Include graph representation of subgraphs. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.
|
||||
|
||||
Returns:
|
||||
Graph: The graph information for the assistant in JSON format.
|
||||
@@ -2282,13 +2282,13 @@ 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.
|
||||
|
||||
Args:
|
||||
assistant_id: The ID of the assistant to get the graph of.
|
||||
xray: Include graph representation of subgraphs.
|
||||
xray: Include graph representation of subgraphs. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.
|
||||
|
||||
Returns:
|
||||
Graph: The graph information for the assistant in JSON format.
|
||||
|
||||
Reference in New Issue
Block a user