Skip to content

Commit edc0e1c

Browse files
fix(api): align types of input items / output items for typescript
1 parent 1f2d35e commit edc0e1c

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 135
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-ca24bc4d8125b5153514ce643c4e3220f25971b7d67ca384d56d493c72c0d977.yml
3-
openapi_spec_hash: c6f048c7b3d29f4de48fde0e845ba33f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a7e92d12ebe89ca019a7ac5b29759064eefa2c38fe08d03516f2620e66abb32b.yml
3+
openapi_spec_hash: acbc703b2739447abc6312b2d753631c
44
config_hash: b876221dfb213df9f0a999e75d38a65e

src/resources/responses/responses.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,15 @@ export interface ResponseApplyPatchToolCall {
709709
*/
710710
call_id: string;
711711

712+
/**
713+
* One of the create_file, delete_file, or update_file operations applied via
714+
* apply_patch.
715+
*/
716+
operation:
717+
| ResponseApplyPatchToolCall.CreateFile
718+
| ResponseApplyPatchToolCall.DeleteFile
719+
| ResponseApplyPatchToolCall.UpdateFile;
720+
712721
/**
713722
* The status of the apply patch tool call. One of `in_progress` or `completed`.
714723
*/
@@ -723,15 +732,6 @@ export interface ResponseApplyPatchToolCall {
723732
* The ID of the entity that created this tool call.
724733
*/
725734
created_by?: string;
726-
727-
/**
728-
* One of the create_file, delete_file, or update_file operations applied via
729-
* apply_patch.
730-
*/
731-
operation?:
732-
| ResponseApplyPatchToolCall.CreateFile
733-
| ResponseApplyPatchToolCall.DeleteFile
734-
| ResponseApplyPatchToolCall.UpdateFile;
735735
}
736736

737737
export namespace ResponseApplyPatchToolCall {
@@ -806,11 +806,6 @@ export interface ResponseApplyPatchToolCallOutput {
806806
*/
807807
call_id: string;
808808

809-
/**
810-
* Optional textual output returned by the apply patch tool.
811-
*/
812-
output: string | null;
813-
814809
/**
815810
* The status of the apply patch tool call output. One of `completed` or `failed`.
816811
*/
@@ -825,6 +820,11 @@ export interface ResponseApplyPatchToolCallOutput {
825820
* The ID of the entity that created this tool call output.
826821
*/
827822
created_by?: string;
823+
824+
/**
825+
* Optional textual output returned by the apply patch tool.
826+
*/
827+
output?: string | null;
828828
}
829829

830830
/**
@@ -3275,7 +3275,7 @@ export namespace ResponseInputItem {
32753275
* Optional human-readable log text from the apply patch tool (e.g., patch results
32763276
* or errors).
32773277
*/
3278-
output?: string;
3278+
output?: string | null;
32793279
}
32803280

32813281
/**

tests/responsesItems.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import OpenAI from 'openai/index';
2+
const openai = new OpenAI({ apiKey: 'example-api-key' });
3+
4+
describe('responses item types', () => {
5+
test('response output items are compatible with input items', async () => {
6+
expect(true).toBe(true);
7+
});
8+
});
9+
10+
const unused = async () => {
11+
const response = await openai.responses.create({
12+
model: 'gpt-5.1',
13+
input: 'You are a helpful assistant.',
14+
});
15+
await openai.responses.create({
16+
model: 'gpt-5.1',
17+
// check type compatibility
18+
input: response.output,
19+
});
20+
expect(true).toBe(true);
21+
};

0 commit comments

Comments
 (0)