@@ -10,24 +10,21 @@ import { path } from '../../../internal/utils/path';
1010
1111export class Completions extends APIResource {
1212 /**
13- * FastAPI wrapper around async chat completions
14- *
15- * This endpoint creates an asynchronous chat completion job and returns a job ID
16- * that can be used to poll for results.
13+ * Submit an asynchronous chat completion request.
1714 */
1815 create ( body : CompletionCreateParams , options ?: RequestOptions ) : APIPromise < CompletionCreateResponse > {
1916 return this . _client . post ( '/async/chat/completions' , { body, ...options } ) ;
2017 }
2118
2219 /**
23- * list all async chat completion requests for a given user.
20+ * Retrieve a list of all asynchronous chat completion requests for a given user.
2421 */
2522 list ( options ?: RequestOptions ) : APIPromise < CompletionListResponse > {
2623 return this . _client . get ( '/async/chat/completions' , options ) ;
2724 }
2825
2926 /**
30- * get the response for a given async chat completion request.
27+ * Retrieve the response for a given asynchronous chat completion request.
3128 */
3229 get (
3330 apiRequest : string ,
@@ -37,6 +34,7 @@ export class Completions extends APIResource {
3734 const {
3835 'x-client-env' : xClientEnv ,
3936 'x-client-name' : xClientName ,
37+ 'x-created-at-epoch-seconds' : xCreatedAtEpochSeconds ,
4038 'x-request-time' : xRequestTime ,
4139 'x-usage-tier' : xUsageTier ,
4240 'x-user-id' : xUserID ,
@@ -49,6 +47,9 @@ export class Completions extends APIResource {
4947 {
5048 ...( xClientEnv != null ? { 'x-client-env' : xClientEnv } : undefined ) ,
5149 ...( xClientName != null ? { 'x-client-name' : xClientName } : undefined ) ,
50+ ...( xCreatedAtEpochSeconds != null ?
51+ { 'x-created-at-epoch-seconds' : xCreatedAtEpochSeconds }
52+ : undefined ) ,
5253 ...( xRequestTime != null ? { 'x-request-time' : xRequestTime } : undefined ) ,
5354 ...( xUsageTier != null ? { 'x-usage-tier' : xUsageTier } : undefined ) ,
5455 ...( xUserID != null ? { 'x-user-id' : xUserID } : undefined ) ,
@@ -176,6 +177,8 @@ export namespace CompletionCreateParams {
176177
177178 image_format_filter ?: Array < string > | null ;
178179
180+ language_preference ?: string | null ;
181+
179182 last_updated_after_filter ?: string | null ;
180183
181184 last_updated_before_filter ?: string | null ;
@@ -234,8 +237,12 @@ export namespace CompletionCreateParams {
234237
235238 stream ?: boolean | null ;
236239
240+ stream_mode ?: 'full' | 'concise' ;
241+
237242 temperature ?: number | null ;
238243
244+ thread_id ?: string | null ;
245+
239246 tool_choice ?: 'none' | 'auto' | 'required' | null ;
240247
241248 tools ?: Array < Request . Tool > | null ;
@@ -250,6 +257,8 @@ export namespace CompletionCreateParams {
250257
251258 updated_before_timestamp ?: number | null ;
252259
260+ use_threads ?: boolean | null ;
261+
253262 web_search_options ?: Request . WebSearchOptions ;
254263 }
255264
@@ -335,7 +344,7 @@ export namespace CompletionCreateParams {
335344
336345 search_context_size ?: 'low' | 'medium' | 'high' ;
337346
338- search_type ?: 'fast' | 'pro' | 'auto' ;
347+ search_type ?: 'fast' | 'pro' | 'auto' | null ;
339348
340349 user_location ?: WebSearchOptions . UserLocation | null ;
341350 }
@@ -372,6 +381,11 @@ export interface CompletionGetParams {
372381 */
373382 'x-client-name' ?: string ;
374383
384+ /**
385+ * Header param:
386+ */
387+ 'x-created-at-epoch-seconds' ?: string ;
388+
375389 /**
376390 * Header param:
377391 */
0 commit comments