@langchain/langgraph-sdk 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Assistant, AssistantGraph, Config, DefaultValues, GraphSchema, Metadata, Run, Thread, ThreadState, Cron } from "./schema.js";
2
2
  import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.mjs";
3
- import { RunsCreatePayload, RunsStreamPayload, RunsWaitPayload, StreamEvent, CronsCreatePayload } from "./types.mjs";
3
+ import { RunsCreatePayload, RunsStreamPayload, RunsWaitPayload, StreamEvent, CronsCreatePayload, OnConflictBehavior } from "./types.mjs";
4
4
  interface ClientConfig {
5
5
  apiUrl?: string;
6
6
  callerOptions?: AsyncCallerParams;
@@ -133,6 +133,8 @@ declare class ThreadsClient extends BaseClient {
133
133
  * Metadata for the thread.
134
134
  */
135
135
  metadata?: Metadata;
136
+ threadId?: string;
137
+ ifExists?: OnConflictBehavior;
136
138
  }): Promise<Thread>;
137
139
  /**
138
140
  * Update a thread.
package/dist/client.mjs CHANGED
@@ -246,7 +246,11 @@ class ThreadsClient extends BaseClient {
246
246
  async create(payload) {
247
247
  return this.fetch(`/threads`, {
248
248
  method: "POST",
249
- json: { metadata: payload?.metadata },
249
+ json: {
250
+ metadata: payload?.metadata,
251
+ thread_id: payload?.threadId,
252
+ if_exists: payload?.ifExists,
253
+ },
250
254
  });
251
255
  }
252
256
  /**
package/dist/types.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Config, Metadata } from "./schema.js";
2
2
  export type StreamMode = "values" | "messages" | "updates" | "events" | "debug";
3
3
  export type MultitaskStrategy = "reject" | "interrupt" | "rollback" | "enqueue";
4
+ export type OnConflictBehavior = "raise" | "do_nothing";
4
5
  export type StreamEvent = "events" | "metadata" | "debug" | "updates" | "values" | "messages/partial" | "messages/metadata" | "messages/complete" | (string & {});
5
6
  interface RunsInvokePayload {
6
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Client library for interacting with the LangGraph API",
5
5
  "type": "module",
6
6
  "packageManager": "yarn@1.22.19",