@@ -439,6 +439,76 @@ export interface ConversationItemTruncatedEvent {
439
439
type : 'conversation.item.truncated' ;
440
440
}
441
441
442
+ /**
443
+ * The item to add to the conversation.
444
+ */
445
+ export interface ConversationItemWithReference {
446
+ /**
447
+ * For an item of type (`message` | `function_call` | `function_call_output`) this
448
+ * field allows the client to assign the unique ID of the item. It is not required
449
+ * because the server will generate one if not provided.
450
+ *
451
+ * For an item of type `item_reference`, this field is required and is a reference
452
+ * to any item that has previously existed in the conversation.
453
+ */
454
+ id ?: string ;
455
+
456
+ /**
457
+ * The arguments of the function call (for `function_call` items).
458
+ */
459
+ arguments ?: string ;
460
+
461
+ /**
462
+ * The ID of the function call (for `function_call` and `function_call_output`
463
+ * items). If passed on a `function_call_output` item, the server will check that a
464
+ * `function_call` item with the same ID exists in the conversation history.
465
+ */
466
+ call_id ?: string ;
467
+
468
+ /**
469
+ * The content of the message, applicable for `message` items.
470
+ *
471
+ * - Message items of role `system` support only `input_text` content
472
+ * - Message items of role `user` support `input_text` and `input_audio` content
473
+ * - Message items of role `assistant` support `text` content.
474
+ */
475
+ content ?: Array < ConversationItemContent > ;
476
+
477
+ /**
478
+ * The name of the function being called (for `function_call` items).
479
+ */
480
+ name ?: string ;
481
+
482
+ /**
483
+ * Identifier for the API object being returned - always `realtime.item`.
484
+ */
485
+ object ?: 'realtime.item' ;
486
+
487
+ /**
488
+ * The output of the function call (for `function_call_output` items).
489
+ */
490
+ output ?: string ;
491
+
492
+ /**
493
+ * The role of the message sender (`user`, `assistant`, `system`), only applicable
494
+ * for `message` items.
495
+ */
496
+ role ?: 'user' | 'assistant' | 'system' ;
497
+
498
+ /**
499
+ * The status of the item (`completed`, `incomplete`). These have no effect on the
500
+ * conversation, but are accepted for consistency with the
501
+ * `conversation.item.created` event.
502
+ */
503
+ status ?: 'completed' | 'incomplete' ;
504
+
505
+ /**
506
+ * The type of the item (`message`, `function_call`, `function_call_output`,
507
+ * `item_reference`).
508
+ */
509
+ type ?: 'message' | 'function_call' | 'function_call_output' | 'item_reference' ;
510
+ }
511
+
442
512
/**
443
513
* Returned when an error occurs, which could be a client problem or a server
444
514
* problem. Most errors are recoverable and the session will stay open, we
@@ -1336,11 +1406,12 @@ export namespace ResponseCreateEvent {
1336
1406
conversation ?: ( string & { } ) | 'auto' | 'none' ;
1337
1407
1338
1408
/**
1339
- * Input items to include in the prompt for the model. Creates a new context for
1340
- * this response, without including the default conversation. Can include
1341
- * references to items from the default conversation.
1409
+ * Input items to include in the prompt for the model. Using this field creates a
1410
+ * new context for this Response instead of using the default conversation. An
1411
+ * empty array `[]` will clear the context for this Response. Note that this can
1412
+ * include references to items from the default conversation.
1342
1413
*/
1343
- input ?: Array < RealtimeAPI . ConversationItem > ;
1414
+ input ?: Array < RealtimeAPI . ConversationItemWithReference > ;
1344
1415
1345
1416
/**
1346
1417
* The default system instructions (i.e. system message) prepended to model calls.
0 commit comments