Skip to content

Commit

Permalink
Merge pull request #1191 from langchain-ai/dqbd/js-sdk-types
Browse files Browse the repository at this point in the history
feat(sdk-js): bump to 0.0.3, update types of updateState
  • Loading branch information
nfcampos authored Aug 2, 2024
2 parents 045f07c + a6e32e5 commit 16a6450
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libs/sdk-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@langchain/langgraph-sdk",
"version": "0.0.2",
"version": "0.0.3",
"description": "Client library for interacting with the LangGraph API",
"type": "module",
"packageManager": "[email protected]",
Expand Down
19 changes: 11 additions & 8 deletions libs/sdk-js/src/client.mts
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,18 @@ export class ThreadsClient extends BaseClient {
async updateState<ValuesType = DefaultValues>(
threadId: string,
options: { values: ValuesType; checkpointId?: string; asNode?: string },
): Promise<void> {
return this.fetch<void>(`/threads/${threadId}/state`, {
method: "POST",
json: {
values: options.values,
checkpoint_id: options.checkpointId,
as_node: options?.asNode,
): Promise<Pick<Config, "configurable">> {
return this.fetch<Pick<Config, "configurable">>(
`/threads/${threadId}/state`,
{
method: "POST",
json: {
values: options.values,
checkpoint_id: options.checkpointId,
as_node: options?.asNode,
},
},
});
);
}

/**
Expand Down

0 comments on commit 16a6450

Please sign in to comment.