File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @langchain/langgraph-sdk " : patch
3
+ ---
4
+
5
+ Add support for creating stateless runs
Original file line number Diff line number Diff line change @@ -1178,7 +1178,7 @@ export class RunsClient<
1178
1178
* @returns The created run.
1179
1179
*/
1180
1180
async create (
1181
- threadId : string ,
1181
+ threadId : string | null ,
1182
1182
assistantId : string ,
1183
1183
payload ?: RunsCreatePayload
1184
1184
) : Promise < Run > {
@@ -1210,7 +1210,8 @@ export class RunsClient<
1210
1210
: undefined ,
1211
1211
} ;
1212
1212
1213
- const [ run , response ] = await this . fetch < Run > ( `/threads/${ threadId } /runs` , {
1213
+ const endpoint = threadId === null ? "/runs" : `/threads/${ threadId } /runs` ;
1214
+ const [ run , response ] = await this . fetch < Run > ( endpoint , {
1214
1215
method : "POST" ,
1215
1216
json,
1216
1217
signal : payload ?. signal ,
You can’t perform that action at this time.
0 commit comments