Open
Description
Confirm this is a Node library issue and not an underlying OpenAI API issue
- This is an issue with the Node library
Describe the bug
ResponseOutputTextAnnotationAddedEvent
interface property type
has its value response.output_text_annotation.added
but the actual type returned by the API is response.output_text.annotation.added
.
To Reproduce
Compare SDK ResponseOutputTextAnnotationAddedEvent
interface type
with the actual API returned object.
Code snippets
Current implementation:
"""
/**
* Emitted when an annotation is added to output text content.
*/
export interface ResponseOutputTextAnnotationAddedEvent {
/**
* The annotation object being added. (See annotation schema for details.)
*/
annotation: unknown;
/**
* The index of the annotation within the content part.
*/
annotation_index: number;
/**
* The index of the content part within the output item.
*/
content_index: number;
/**
* The unique identifier of the item to which the annotation is being added.
*/
item_id: string;
/**
* The index of the output item in the response's output array.
*/
output_index: number;
/**
* The sequence number of this event.
*/
sequence_number: number;
/**
* The type of the event. Always 'response.output_text_annotation.added'.
*/
type: 'response.output_text_annotation.added';
}
Desired implementation example including added Annotation type and type
property set to 'response.output_text.annotation.added':
type FileCitationAnnotation = {
type: "file_citation";
file_id: string;
filename: string;
index: number;
};
type FilePathAnnotation = {
type: "file_path";
file_path: string;
index: number;
};
type Annotation = FileCitationAnnotation | FilePathAnnotation;
/**
* Emitted when an annotation is added to output text content.
*/
export interface ResponseOutputTextAnnotationAddedEvent {
annotation: Annotation;
/**
* The index of the annotation within the content part.
*/
annotation_index: number;
/**
* The index of the content part within the output item.
*/
content_index: number;
/**
* The unique identifier of the item to which the annotation is being added.
*/
item_id: string;
/**
* The index of the output item in the response's output array.
*/
output_index: number;
/**
* The sequence number of this event.
*/
sequence_number: number;
/**
* The type of the event. Always 'response.output_text.annotation.added'.
*/
type: 'response.output_text.annotation.added';
}
OS
MacOS
Node version
20.11.1
Library version
4.103.0