2
2
3
3
import { APIResource } from '../../resource' ;
4
4
import * as ResponsesAPI from './responses' ;
5
+ import { ResponseItemsPage } from './responses' ;
5
6
import { CursorPage , type CursorPageParams , PagePromise } from '../../pagination' ;
6
7
import { RequestOptions } from '../../internal/request-options' ;
7
8
import { path } from '../../internal/utils/path' ;
@@ -14,62 +15,23 @@ export class InputItems extends APIResource {
14
15
responseID : string ,
15
16
query : InputItemListParams | null | undefined = { } ,
16
17
options ?: RequestOptions ,
17
- ) : PagePromise <
18
- ResponseItemListDataPage ,
19
- | ResponseItemList . Message
20
- | ResponsesAPI . ResponseOutputMessage
21
- | ResponsesAPI . ResponseFileSearchToolCall
22
- | ResponsesAPI . ResponseComputerToolCall
23
- | ResponseItemList . ComputerCallOutput
24
- | ResponsesAPI . ResponseFunctionWebSearch
25
- | ResponsesAPI . ResponseFunctionToolCall
26
- | ResponseItemList . FunctionCallOutput
27
- > {
18
+ ) : PagePromise < ResponseItemsPage , ResponsesAPI . ResponseItem > {
28
19
return this . _client . getAPIList (
29
20
path `/responses/${ responseID } /input_items` ,
30
- CursorPage <
31
- | ResponseItemList . Message
32
- | ResponsesAPI . ResponseOutputMessage
33
- | ResponsesAPI . ResponseFileSearchToolCall
34
- | ResponsesAPI . ResponseComputerToolCall
35
- | ResponseItemList . ComputerCallOutput
36
- | ResponsesAPI . ResponseFunctionWebSearch
37
- | ResponsesAPI . ResponseFunctionToolCall
38
- | ResponseItemList . FunctionCallOutput
39
- > ,
21
+ CursorPage < ResponsesAPI . ResponseItem > ,
40
22
{ query, ...options } ,
41
23
) ;
42
24
}
43
25
}
44
26
45
- export type ResponseItemListDataPage = CursorPage <
46
- | ResponseItemList . Message
47
- | ResponsesAPI . ResponseOutputMessage
48
- | ResponsesAPI . ResponseFileSearchToolCall
49
- | ResponsesAPI . ResponseComputerToolCall
50
- | ResponseItemList . ComputerCallOutput
51
- | ResponsesAPI . ResponseFunctionWebSearch
52
- | ResponsesAPI . ResponseFunctionToolCall
53
- | ResponseItemList . FunctionCallOutput
54
- > ;
55
-
56
27
/**
57
28
* A list of Response items.
58
29
*/
59
30
export interface ResponseItemList {
60
31
/**
61
32
* A list of items used to generate this response.
62
33
*/
63
- data : Array <
64
- | ResponseItemList . Message
65
- | ResponsesAPI . ResponseOutputMessage
66
- | ResponsesAPI . ResponseFileSearchToolCall
67
- | ResponsesAPI . ResponseComputerToolCall
68
- | ResponseItemList . ComputerCallOutput
69
- | ResponsesAPI . ResponseFunctionWebSearch
70
- | ResponsesAPI . ResponseFunctionToolCall
71
- | ResponseItemList . FunctionCallOutput
72
- > ;
34
+ data : Array < ResponsesAPI . ResponseItem > ;
73
35
74
36
/**
75
37
* The ID of the first item in the list.
@@ -92,142 +54,6 @@ export interface ResponseItemList {
92
54
object : 'list' ;
93
55
}
94
56
95
- export namespace ResponseItemList {
96
- export interface Message {
97
- /**
98
- * The unique ID of the message input.
99
- */
100
- id : string ;
101
-
102
- /**
103
- * A list of one or many input items to the model, containing different content
104
- * types.
105
- */
106
- content : ResponsesAPI . ResponseInputMessageContentList ;
107
-
108
- /**
109
- * The role of the message input. One of `user`, `system`, or `developer`.
110
- */
111
- role : 'user' | 'system' | 'developer' ;
112
-
113
- /**
114
- * The status of item. One of `in_progress`, `completed`, or `incomplete`.
115
- * Populated when items are returned via API.
116
- */
117
- status ?: 'in_progress' | 'completed' | 'incomplete' ;
118
-
119
- /**
120
- * The type of the message input. Always set to `message`.
121
- */
122
- type ?: 'message' ;
123
- }
124
-
125
- export interface ComputerCallOutput {
126
- /**
127
- * The unique ID of the computer call tool output.
128
- */
129
- id : string ;
130
-
131
- /**
132
- * The ID of the computer tool call that produced the output.
133
- */
134
- call_id : string ;
135
-
136
- /**
137
- * A computer screenshot image used with the computer use tool.
138
- */
139
- output : ComputerCallOutput . Output ;
140
-
141
- /**
142
- * The type of the computer tool call output. Always `computer_call_output`.
143
- */
144
- type : 'computer_call_output' ;
145
-
146
- /**
147
- * The safety checks reported by the API that have been acknowledged by the
148
- * developer.
149
- */
150
- acknowledged_safety_checks ?: Array < ComputerCallOutput . AcknowledgedSafetyCheck > ;
151
-
152
- /**
153
- * The status of the message input. One of `in_progress`, `completed`, or
154
- * `incomplete`. Populated when input items are returned via API.
155
- */
156
- status ?: 'in_progress' | 'completed' | 'incomplete' ;
157
- }
158
-
159
- export namespace ComputerCallOutput {
160
- /**
161
- * A computer screenshot image used with the computer use tool.
162
- */
163
- export interface Output {
164
- /**
165
- * Specifies the event type. For a computer screenshot, this property is always set
166
- * to `computer_screenshot`.
167
- */
168
- type : 'computer_screenshot' ;
169
-
170
- /**
171
- * The identifier of an uploaded file that contains the screenshot.
172
- */
173
- file_id ?: string ;
174
-
175
- /**
176
- * The URL of the screenshot image.
177
- */
178
- image_url ?: string ;
179
- }
180
-
181
- /**
182
- * A pending safety check for the computer call.
183
- */
184
- export interface AcknowledgedSafetyCheck {
185
- /**
186
- * The ID of the pending safety check.
187
- */
188
- id : string ;
189
-
190
- /**
191
- * The type of the pending safety check.
192
- */
193
- code : string ;
194
-
195
- /**
196
- * Details about the pending safety check.
197
- */
198
- message : string ;
199
- }
200
- }
201
-
202
- export interface FunctionCallOutput {
203
- /**
204
- * The unique ID of the function call tool output.
205
- */
206
- id : string ;
207
-
208
- /**
209
- * The unique ID of the function tool call generated by the model.
210
- */
211
- call_id : string ;
212
-
213
- /**
214
- * A JSON string of the output of the function tool call.
215
- */
216
- output : string ;
217
-
218
- /**
219
- * The type of the function tool call output. Always `function_call_output`.
220
- */
221
- type : 'function_call_output' ;
222
-
223
- /**
224
- * The status of the item. One of `in_progress`, `completed`, or `incomplete`.
225
- * Populated when items are returned via API.
226
- */
227
- status ?: 'in_progress' | 'completed' | 'incomplete' ;
228
- }
229
- }
230
-
231
57
export interface InputItemListParams extends CursorPageParams {
232
58
/**
233
59
* An item ID to list items before, used in pagination.
@@ -244,9 +70,7 @@ export interface InputItemListParams extends CursorPageParams {
244
70
}
245
71
246
72
export declare namespace InputItems {
247
- export {
248
- type ResponseItemList as ResponseItemList ,
249
- type ResponseItemListDataPage as ResponseItemListDataPage ,
250
- type InputItemListParams as InputItemListParams ,
251
- } ;
73
+ export { type ResponseItemList as ResponseItemList , type InputItemListParams as InputItemListParams } ;
252
74
}
75
+
76
+ export { type ResponseItemsPage } ;
0 commit comments