@@ -50,6 +50,14 @@ export class Runs extends APIResource {
5050
5151 /**
5252 * Create a run.
53+ *
54+ * @example
55+ * ```ts
56+ * const run = await client.beta.threads.runs.create(
57+ * 'thread_id',
58+ * { assistant_id: 'assistant_id' },
59+ * );
60+ * ```
5361 */
5462 create ( threadID : string , params : RunCreateParamsNonStreaming , options ?: RequestOptions ) : APIPromise < Run > ;
5563 create (
@@ -79,6 +87,14 @@ export class Runs extends APIResource {
7987
8088 /**
8189 * Retrieves a run.
90+ *
91+ * @example
92+ * ```ts
93+ * const run = await client.beta.threads.runs.retrieve(
94+ * 'run_id',
95+ * { thread_id: 'thread_id' },
96+ * );
97+ * ```
8298 */
8399 retrieve ( runID : string , params : RunRetrieveParams , options ?: RequestOptions ) : APIPromise < Run > {
84100 const { thread_id } = params ;
@@ -90,6 +106,14 @@ export class Runs extends APIResource {
90106
91107 /**
92108 * Modifies a run.
109+ *
110+ * @example
111+ * ```ts
112+ * const run = await client.beta.threads.runs.update(
113+ * 'run_id',
114+ * { thread_id: 'thread_id' },
115+ * );
116+ * ```
93117 */
94118 update ( runID : string , params : RunUpdateParams , options ?: RequestOptions ) : APIPromise < Run > {
95119 const { thread_id, ...body } = params ;
@@ -102,6 +126,16 @@ export class Runs extends APIResource {
102126
103127 /**
104128 * Returns a list of runs belonging to a thread.
129+ *
130+ * @example
131+ * ```ts
132+ * // Automatically fetches more pages as needed.
133+ * for await (const run of client.beta.threads.runs.list(
134+ * 'thread_id',
135+ * )) {
136+ * // ...
137+ * }
138+ * ```
105139 */
106140 list (
107141 threadID : string ,
@@ -117,6 +151,14 @@ export class Runs extends APIResource {
117151
118152 /**
119153 * Cancels a run that is `in_progress`.
154+ *
155+ * @example
156+ * ```ts
157+ * const run = await client.beta.threads.runs.cancel(
158+ * 'run_id',
159+ * { thread_id: 'thread_id' },
160+ * );
161+ * ```
120162 */
121163 cancel ( runID : string , params : RunCancelParams , options ?: RequestOptions ) : APIPromise < Run > {
122164 const { thread_id } = params ;
@@ -210,6 +252,15 @@ export class Runs extends APIResource {
210252 * `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
211253 * tool calls once they're all completed. All outputs must be submitted in a single
212254 * request.
255+ *
256+ * @example
257+ * ```ts
258+ * const run =
259+ * await client.beta.threads.runs.submitToolOutputs(
260+ * 'run_id',
261+ * { thread_id: 'thread_id', tool_outputs: [{}] },
262+ * );
263+ * ```
213264 */
214265 submitToolOutputs (
215266 runID : string ,
0 commit comments