Skip to content

Commit 96ed4db

Browse files
stainless-app[bot]RobertCraigie
authored andcommitted
fix(types): improve responses type names
1 parent 3ca8965 commit 96ed4db

File tree

5 files changed

+180
-215
lines changed

5 files changed

+180
-215
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f763c1a35c8b9b02f1e31b9b2e09e21f98bfe8413e5079c86cbb07da2dd7779b.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f3bce04386c4fcfd5037e0477fbaa39010003fd1558eb5185fe4a71dd6a05fdd.yml

api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ Types:
547547
- <code><a href="./src/resources/responses/responses.ts">ResponseCodeInterpreterToolCall</a></code>
548548
- <code><a href="./src/resources/responses/responses.ts">ResponseCompletedEvent</a></code>
549549
- <code><a href="./src/resources/responses/responses.ts">ResponseComputerToolCall</a></code>
550+
- <code><a href="./src/resources/responses/responses.ts">ResponseComputerToolCallOutputItem</a></code>
551+
- <code><a href="./src/resources/responses/responses.ts">ResponseComputerToolCallOutputScreenshot</a></code>
550552
- <code><a href="./src/resources/responses/responses.ts">ResponseContent</a></code>
551553
- <code><a href="./src/resources/responses/responses.ts">ResponseContentPartAddedEvent</a></code>
552554
- <code><a href="./src/resources/responses/responses.ts">ResponseContentPartDoneEvent</a></code>
@@ -563,6 +565,8 @@ Types:
563565
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionCallArgumentsDeltaEvent</a></code>
564566
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionCallArgumentsDoneEvent</a></code>
565567
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionToolCall</a></code>
568+
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionToolCallItem</a></code>
569+
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionToolCallOutputItem</a></code>
566570
- <code><a href="./src/resources/responses/responses.ts">ResponseFunctionWebSearch</a></code>
567571
- <code><a href="./src/resources/responses/responses.ts">ResponseInProgressEvent</a></code>
568572
- <code><a href="./src/resources/responses/responses.ts">ResponseIncludable</a></code>
@@ -574,7 +578,9 @@ Types:
574578
- <code><a href="./src/resources/responses/responses.ts">ResponseInputImage</a></code>
575579
- <code><a href="./src/resources/responses/responses.ts">ResponseInputItem</a></code>
576580
- <code><a href="./src/resources/responses/responses.ts">ResponseInputMessageContentList</a></code>
581+
- <code><a href="./src/resources/responses/responses.ts">ResponseInputMessageItem</a></code>
577582
- <code><a href="./src/resources/responses/responses.ts">ResponseInputText</a></code>
583+
- <code><a href="./src/resources/responses/responses.ts">ResponseItem</a></code>
578584
- <code><a href="./src/resources/responses/responses.ts">ResponseOutputAudio</a></code>
579585
- <code><a href="./src/resources/responses/responses.ts">ResponseOutputItem</a></code>
580586
- <code><a href="./src/resources/responses/responses.ts">ResponseOutputItemAddedEvent</a></code>
@@ -615,4 +621,4 @@ Types:
615621

616622
Methods:
617623

618-
- <code title="get /responses/{response_id}/input_items">client.responses.inputItems.<a href="./src/resources/responses/input-items.ts">list</a>(responseID, { ...params }) -> ResponseItemListDataPage</code>
624+
- <code title="get /responses/{response_id}/input_items">client.responses.inputItems.<a href="./src/resources/responses/input-items.ts">list</a>(responseID, { ...params }) -> ResponseItemsPage</code>

src/resources/responses/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export {
4-
InputItems,
5-
type ResponseItemList,
6-
type InputItemListParams,
7-
type ResponseItemListDataPage,
8-
} from './input-items';
3+
export { InputItems, type ResponseItemList, type InputItemListParams } from './input-items';
94
export { Responses } from './responses';

src/resources/responses/input-items.ts

Lines changed: 7 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { APIResource } from '../../resource';
44
import * as ResponsesAPI from './responses';
5+
import { ResponseItemsPage } from './responses';
56
import { CursorPage, type CursorPageParams, PagePromise } from '../../pagination';
67
import { RequestOptions } from '../../internal/request-options';
78
import { path } from '../../internal/utils/path';
@@ -14,62 +15,23 @@ export class InputItems extends APIResource {
1415
responseID: string,
1516
query: InputItemListParams | null | undefined = {},
1617
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> {
2819
return this._client.getAPIList(
2920
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>,
4022
{ query, ...options },
4123
);
4224
}
4325
}
4426

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-
5627
/**
5728
* A list of Response items.
5829
*/
5930
export interface ResponseItemList {
6031
/**
6132
* A list of items used to generate this response.
6233
*/
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>;
7335

7436
/**
7537
* The ID of the first item in the list.
@@ -92,142 +54,6 @@ export interface ResponseItemList {
9254
object: 'list';
9355
}
9456

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-
23157
export interface InputItemListParams extends CursorPageParams {
23258
/**
23359
* An item ID to list items before, used in pagination.
@@ -244,9 +70,7 @@ export interface InputItemListParams extends CursorPageParams {
24470
}
24571

24672
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 };
25274
}
75+
76+
export { type ResponseItemsPage };

0 commit comments

Comments
 (0)