Skip to content

Commit

Permalink
feat(remote): upstream type casts from remote to SDK (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd authored Nov 4, 2024
1 parent b85af8a commit e70120a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libs/langgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"license": "MIT",
"dependencies": {
"@langchain/langgraph-checkpoint": "~0.0.10",
"@langchain/langgraph-sdk": "~0.0.20",
"@langchain/langgraph-sdk": "~0.0.21",
"uuid": "^10.0.0",
"zod": "^3.23.8"
},
Expand Down
11 changes: 4 additions & 7 deletions libs/langgraph/src/pregel/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
import {
Graph as DrawableGraph,
Node as DrawableNode,
Edge as DrawableEdge,
} from "@langchain/core/runnables/graph";
import {
mergeConfigs,
Expand Down Expand Up @@ -43,7 +42,6 @@ import {
CHECKPOINT_NAMESPACE_SEPARATOR,
CONFIG_KEY_STREAM,
INTERRUPT,
Interrupt,
} from "../constants.js";

export type RemoteGraphParams = Omit<
Expand Down Expand Up @@ -308,7 +306,7 @@ export class RemoteGraph<
id: task.id,
name: task.name,
error: task.error ? { message: task.error } : undefined,
interrupts: task.interrupts as Interrupt[],
interrupts: task.interrupts,
// eslint-disable-next-line no-nested-ternary
state: task.state
? this._createStateSnapshot(task.state)
Expand All @@ -332,7 +330,7 @@ export class RemoteGraph<
},
},
metadata: state.metadata
? (state.metadata as unknown as CheckpointMetadata)
? (state.metadata as CheckpointMetadata)
: undefined,
createdAt: state.created_at ?? undefined,
parentConfig: state.parent_checkpoint
Expand Down Expand Up @@ -582,9 +580,8 @@ export class RemoteGraph<
xray: config?.xray,
});
return new DrawableGraph({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
nodes: this._getDrawableNodes(graph.nodes as any),
edges: graph.edges as unknown as DrawableEdge[],
nodes: this._getDrawableNodes(graph.nodes),
edges: graph.edges,
});
}

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1824,15 +1824,15 @@ __metadata:
languageName: unknown
linkType: soft

"@langchain/langgraph-sdk@npm:~0.0.20":
version: 0.0.20
resolution: "@langchain/langgraph-sdk@npm:0.0.20"
"@langchain/langgraph-sdk@npm:~0.0.21":
version: 0.0.21
resolution: "@langchain/langgraph-sdk@npm:0.0.21"
dependencies:
"@types/json-schema": ^7.0.15
p-queue: ^6.6.2
p-retry: 4
uuid: ^9.0.0
checksum: 0d3f1f887719bdaa3c75adb1409b734b0d3e240e92284ba90bfcf34443d2826f732ab7aab3db10f11b3e809d070566cc53d6cf1fa9660eacb2c2744da5b57cf3
checksum: 5dabe873b6cf3fbaa66b445c7032f1188d0c3eb7872457d0a8131521992a1e999e73514eeb9a344c10ee2315992e7130739de32257e2b3107a6dfe5f4027d6a2
languageName: node
linkType: hard

Expand All @@ -1847,7 +1847,7 @@ __metadata:
"@langchain/langgraph-checkpoint": ~0.0.10
"@langchain/langgraph-checkpoint-postgres": "workspace:*"
"@langchain/langgraph-checkpoint-sqlite": "workspace:*"
"@langchain/langgraph-sdk": ~0.0.20
"@langchain/langgraph-sdk": ~0.0.21
"@langchain/openai": ^0.3.11
"@langchain/scripts": ">=0.1.3 <0.2.0"
"@swc/core": ^1.3.90
Expand Down

0 comments on commit e70120a

Please sign in to comment.