@@ -45,6 +45,14 @@ export class Runs extends APIResource {
45
45
46
46
/**
47
47
* Create a run.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const run = await client.beta.threads.runs.create(
52
+ * 'thread_id',
53
+ * { assistant_id: 'assistant_id' },
54
+ * );
55
+ * ```
48
56
*/
49
57
create (
50
58
threadId : string ,
@@ -78,6 +86,14 @@ export class Runs extends APIResource {
78
86
79
87
/**
80
88
* Retrieves a run.
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * const run = await client.beta.threads.runs.retrieve(
93
+ * 'thread_id',
94
+ * 'run_id',
95
+ * );
96
+ * ```
81
97
*/
82
98
retrieve ( threadId : string , runId : string , options ?: Core . RequestOptions ) : Core . APIPromise < Run > {
83
99
return this . _client . get ( `/threads/${ threadId } /runs/${ runId } ` , {
@@ -88,6 +104,14 @@ export class Runs extends APIResource {
88
104
89
105
/**
90
106
* Modifies a run.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * const run = await client.beta.threads.runs.update(
111
+ * 'thread_id',
112
+ * 'run_id',
113
+ * );
114
+ * ```
91
115
*/
92
116
update (
93
117
threadId : string ,
@@ -104,6 +128,16 @@ export class Runs extends APIResource {
104
128
105
129
/**
106
130
* Returns a list of runs belonging to a thread.
131
+ *
132
+ * @example
133
+ * ```ts
134
+ * // Automatically fetches more pages as needed.
135
+ * for await (const run of client.beta.threads.runs.list(
136
+ * 'thread_id',
137
+ * )) {
138
+ * // ...
139
+ * }
140
+ * ```
107
141
*/
108
142
list (
109
143
threadId : string ,
@@ -128,6 +162,14 @@ export class Runs extends APIResource {
128
162
129
163
/**
130
164
* Cancels a run that is `in_progress`.
165
+ *
166
+ * @example
167
+ * ```ts
168
+ * const run = await client.beta.threads.runs.cancel(
169
+ * 'thread_id',
170
+ * 'run_id',
171
+ * );
172
+ * ```
131
173
*/
132
174
cancel ( threadId : string , runId : string , options ?: Core . RequestOptions ) : Core . APIPromise < Run > {
133
175
return this . _client . post ( `/threads/${ threadId } /runs/${ runId } /cancel` , {
@@ -229,6 +271,16 @@ export class Runs extends APIResource {
229
271
* `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
230
272
* tool calls once they're all completed. All outputs must be submitted in a single
231
273
* request.
274
+ *
275
+ * @example
276
+ * ```ts
277
+ * const run =
278
+ * await client.beta.threads.runs.submitToolOutputs(
279
+ * 'thread_id',
280
+ * 'run_id',
281
+ * { tool_outputs: [{}] },
282
+ * );
283
+ * ```
232
284
*/
233
285
submitToolOutputs (
234
286
threadId : string ,
0 commit comments