@@ -290,6 +290,12 @@ export namespace ChatCompletionChunk {
290290 * A chat completion delta generated by streamed model responses.
291291 */
292292 export interface Delta {
293+ /**
294+ * A list of annotations providing citations and references for the content in the
295+ * message.
296+ */
297+ annotations ?: Array < Delta . Annotation > ;
298+
293299 /**
294300 * The contents of the chunk message.
295301 */
@@ -322,6 +328,70 @@ export namespace ChatCompletionChunk {
322328 }
323329
324330 export namespace Delta {
331+ /**
332+ * An annotation that provides citations or references for content in a message.
333+ */
334+ export interface Annotation {
335+ /**
336+ * The type of annotation.
337+ */
338+ type : 'document_citation' | 'function_citation' ;
339+
340+ /**
341+ * A citation referencing a specific document that was provided in the request.
342+ */
343+ document_citation ?: Annotation . DocumentCitation ;
344+
345+ /**
346+ * A citation referencing the result of a function or tool call.
347+ */
348+ function_citation ?: Annotation . FunctionCitation ;
349+ }
350+
351+ export namespace Annotation {
352+ /**
353+ * A citation referencing a specific document that was provided in the request.
354+ */
355+ export interface DocumentCitation {
356+ /**
357+ * The ID of the document being cited, corresponding to a document provided in the
358+ * request.
359+ */
360+ document_id : string ;
361+
362+ /**
363+ * The character index in the message content where this citation ends.
364+ */
365+ end_index : number ;
366+
367+ /**
368+ * The character index in the message content where this citation begins.
369+ */
370+ start_index : number ;
371+ }
372+
373+ /**
374+ * A citation referencing the result of a function or tool call.
375+ */
376+ export interface FunctionCitation {
377+ /**
378+ * The character index in the message content where this citation ends.
379+ */
380+ end_index : number ;
381+
382+ /**
383+ * The character index in the message content where this citation begins.
384+ */
385+ start_index : number ;
386+
387+ /**
388+ * The ID of the tool call being cited, corresponding to a tool call made during
389+ * the conversation.
390+ */
391+ tool_call_id : string ;
392+ }
393+ }
394+
325395 export interface ExecutedTool {
326396 /**
327397 * The arguments passed to the tool in JSON format.
@@ -897,6 +967,12 @@ export interface ChatCompletionMessage {
897967 */
898968 role : 'assistant' ;
899969
970+ /**
971+ * A list of annotations providing citations and references for the content in the
972+ * message.
973+ */
974+ annotations ?: Array < ChatCompletionMessage . Annotation > ;
975+
900976 /**
901977 * A list of tools that were executed during the chat completion for compound AI
902978 * systems.
@@ -922,6 +998,70 @@ export interface ChatCompletionMessage {
922998}
923999
9241000export namespace ChatCompletionMessage {
1001+ /**
1002+ * An annotation that provides citations or references for content in a message.
1003+ */
1004+ export interface Annotation {
1005+ /**
1006+ * The type of annotation.
1007+ */
1008+ type : 'document_citation' | 'function_citation' ;
1009+
1010+ /**
1011+ * A citation referencing a specific document that was provided in the request.
1012+ */
1013+ document_citation ?: Annotation . DocumentCitation ;
1014+
1015+ /**
1016+ * A citation referencing the result of a function or tool call.
1017+ */
1018+ function_citation ?: Annotation . FunctionCitation ;
1019+ }
1020+
1021+ export namespace Annotation {
1022+ /**
1023+ * A citation referencing a specific document that was provided in the request.
1024+ */
1025+ export interface DocumentCitation {
1026+ /**
1027+ * The ID of the document being cited, corresponding to a document provided in the
1028+ * request.
1029+ */
1030+ document_id : string ;
1031+
1032+ /**
1033+ * The character index in the message content where this citation ends.
1034+ */
1035+ end_index : number ;
1036+
1037+ /**
1038+ * The character index in the message content where this citation begins.
1039+ */
1040+ start_index : number ;
1041+ }
1042+
1043+ /**
1044+ * A citation referencing the result of a function or tool call.
1045+ */
1046+ export interface FunctionCitation {
1047+ /**
1048+ * The character index in the message content where this citation ends.
1049+ */
1050+ end_index : number ;
1051+
1052+ /**
1053+ * The character index in the message content where this citation begins.
1054+ */
1055+ start_index : number ;
1056+
1057+ /**
1058+ * The ID of the tool call being cited, corresponding to a tool call made during
1059+ * the conversation.
1060+ */
1061+ tool_call_id : string ;
1062+ }
1063+ }
1064+
9251065 export interface ExecutedTool {
9261066 /**
9271067 * The arguments passed to the tool in JSON format.
0 commit comments