Skip to content

Commit 569f434

Browse files
fix(api): align types of input items / output items for typescript
1 parent 2cc39fe commit 569f434

File tree

12 files changed

+142
-165
lines changed

12 files changed

+142
-165
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

lib/openai/models/responses/response_apply_patch_tool_call.rb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ class ResponseApplyPatchToolCall < OpenAI::Internal::Type::BaseModel
1717
# @return [String]
1818
required :call_id, String
1919

20+
# @!attribute operation
21+
# One of the create_file, delete_file, or update_file operations applied via
22+
# apply_patch.
23+
#
24+
# @return [OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile]
25+
required :operation, union: -> { OpenAI::Responses::ResponseApplyPatchToolCall::Operation }
26+
2027
# @!attribute status
2128
# The status of the apply patch tool call. One of `in_progress` or `completed`.
2229
#
@@ -35,14 +42,7 @@ class ResponseApplyPatchToolCall < OpenAI::Internal::Type::BaseModel
3542
# @return [String, nil]
3643
optional :created_by, String
3744

38-
# @!attribute operation
39-
# One of the create_file, delete_file, or update_file operations applied via
40-
# apply_patch.
41-
#
42-
# @return [OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile, nil]
43-
optional :operation, union: -> { OpenAI::Responses::ResponseApplyPatchToolCall::Operation }
44-
45-
# @!method initialize(id:, call_id:, status:, created_by: nil, operation: nil, type: :apply_patch_call)
45+
# @!method initialize(id:, call_id:, operation:, status:, created_by: nil, type: :apply_patch_call)
4646
# Some parameter documentations has been truncated, see
4747
# {OpenAI::Models::Responses::ResponseApplyPatchToolCall} for more details.
4848
#
@@ -52,27 +52,14 @@ class ResponseApplyPatchToolCall < OpenAI::Internal::Type::BaseModel
5252
#
5353
# @param call_id [String] The unique ID of the apply patch tool call generated by the model.
5454
#
55+
# @param operation [OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile] One of the create_file, delete_file, or update_file operations applied via apply
56+
#
5557
# @param status [Symbol, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Status] The status of the apply patch tool call. One of `in_progress` or `completed`.
5658
#
5759
# @param created_by [String] The ID of the entity that created this tool call.
5860
#
59-
# @param operation [OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile] One of the create_file, delete_file, or update_file operations applied via apply
60-
#
6161
# @param type [Symbol, :apply_patch_call] The type of the item. Always `apply_patch_call`.
6262

63-
# The status of the apply patch tool call. One of `in_progress` or `completed`.
64-
#
65-
# @see OpenAI::Models::Responses::ResponseApplyPatchToolCall#status
66-
module Status
67-
extend OpenAI::Internal::Type::Enum
68-
69-
IN_PROGRESS = :in_progress
70-
COMPLETED = :completed
71-
72-
# @!method self.values
73-
# @return [Array<Symbol>]
74-
end
75-
7663
# One of the create_file, delete_file, or update_file operations applied via
7764
# apply_patch.
7865
#
@@ -173,6 +160,19 @@ class UpdateFile < OpenAI::Internal::Type::BaseModel
173160
# @!method self.variants
174161
# @return [Array(OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile)]
175162
end
163+
164+
# The status of the apply patch tool call. One of `in_progress` or `completed`.
165+
#
166+
# @see OpenAI::Models::Responses::ResponseApplyPatchToolCall#status
167+
module Status
168+
extend OpenAI::Internal::Type::Enum
169+
170+
IN_PROGRESS = :in_progress
171+
COMPLETED = :completed
172+
173+
# @!method self.values
174+
# @return [Array<Symbol>]
175+
end
176176
end
177177
end
178178
end

lib/openai/models/responses/response_apply_patch_tool_call_output.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ class ResponseApplyPatchToolCallOutput < OpenAI::Internal::Type::BaseModel
1717
# @return [String]
1818
required :call_id, String
1919

20-
# @!attribute output
21-
# Optional textual output returned by the apply patch tool.
22-
#
23-
# @return [String, nil]
24-
required :output, String, nil?: true
25-
2620
# @!attribute status
2721
# The status of the apply patch tool call output. One of `completed` or `failed`.
2822
#
@@ -41,7 +35,13 @@ class ResponseApplyPatchToolCallOutput < OpenAI::Internal::Type::BaseModel
4135
# @return [String, nil]
4236
optional :created_by, String
4337

44-
# @!method initialize(id:, call_id:, output:, status:, created_by: nil, type: :apply_patch_call_output)
38+
# @!attribute output
39+
# Optional textual output returned by the apply patch tool.
40+
#
41+
# @return [String, nil]
42+
optional :output, String, nil?: true
43+
44+
# @!method initialize(id:, call_id:, status:, created_by: nil, output: nil, type: :apply_patch_call_output)
4545
# Some parameter documentations has been truncated, see
4646
# {OpenAI::Models::Responses::ResponseApplyPatchToolCallOutput} for more details.
4747
#
@@ -51,12 +51,12 @@ class ResponseApplyPatchToolCallOutput < OpenAI::Internal::Type::BaseModel
5151
#
5252
# @param call_id [String] The unique ID of the apply patch tool call generated by the model.
5353
#
54-
# @param output [String, nil] Optional textual output returned by the apply patch tool.
55-
#
5654
# @param status [Symbol, OpenAI::Models::Responses::ResponseApplyPatchToolCallOutput::Status] The status of the apply patch tool call output. One of `completed` or `failed`.
5755
#
5856
# @param created_by [String] The ID of the entity that created this tool call output.
5957
#
58+
# @param output [String, nil] Optional textual output returned by the apply patch tool.
59+
#
6060
# @param type [Symbol, :apply_patch_call_output] The type of the item. Always `apply_patch_call_output`.
6161

6262
# The status of the apply patch tool call output. One of `completed` or `failed`.

lib/openai/models/responses/response_input_item.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ class ApplyPatchCallOutput < OpenAI::Internal::Type::BaseModel
956956
# or errors).
957957
#
958958
# @return [String, nil]
959-
optional :output, String
959+
optional :output, String, nil?: true
960960

961961
# @!method initialize(call_id:, status:, id: nil, output: nil, type: :apply_patch_call_output)
962962
# Some parameter documentations has been truncated, see
@@ -971,7 +971,7 @@ class ApplyPatchCallOutput < OpenAI::Internal::Type::BaseModel
971971
#
972972
# @param id [String, nil] The unique ID of the apply patch tool call output. Populated when this item is r
973973
#
974-
# @param output [String] Optional human-readable log text from the apply patch tool (e.g., patch results
974+
# @param output [String, nil] Optional human-readable log text from the apply patch tool (e.g., patch results
975975
#
976976
# @param type [Symbol, :apply_patch_call_output] The type of the item. Always `apply_patch_call_output`.
977977

rbi/openai/models/responses/response_apply_patch_tool_call.rbi

Lines changed: 53 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ module OpenAI
2121
sig { returns(String) }
2222
attr_accessor :call_id
2323

24+
# One of the create_file, delete_file, or update_file operations applied via
25+
# apply_patch.
26+
sig do
27+
returns(
28+
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants
29+
)
30+
end
31+
attr_accessor :operation
32+
2433
# The status of the apply patch tool call. One of `in_progress` or `completed`.
2534
sig do
2635
returns(
@@ -40,43 +49,20 @@ module OpenAI
4049
sig { params(created_by: String).void }
4150
attr_writer :created_by
4251

43-
# One of the create_file, delete_file, or update_file operations applied via
44-
# apply_patch.
45-
sig do
46-
returns(
47-
T.nilable(
48-
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants
49-
)
50-
)
51-
end
52-
attr_reader :operation
53-
54-
sig do
55-
params(
56-
operation:
57-
T.any(
58-
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::CreateFile::OrHash,
59-
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile::OrHash,
60-
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile::OrHash
61-
)
62-
).void
63-
end
64-
attr_writer :operation
65-
6652
# A tool call that applies file diffs by creating, deleting, or updating files.
6753
sig do
6854
params(
6955
id: String,
7056
call_id: String,
71-
status:
72-
OpenAI::Responses::ResponseApplyPatchToolCall::Status::OrSymbol,
73-
created_by: String,
7457
operation:
7558
T.any(
7659
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::CreateFile::OrHash,
7760
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile::OrHash,
7861
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile::OrHash
7962
),
63+
status:
64+
OpenAI::Responses::ResponseApplyPatchToolCall::Status::OrSymbol,
65+
created_by: String,
8066
type: Symbol
8167
).returns(T.attached_class)
8268
end
@@ -86,13 +72,13 @@ module OpenAI
8672
id:,
8773
# The unique ID of the apply patch tool call generated by the model.
8874
call_id:,
75+
# One of the create_file, delete_file, or update_file operations applied via
76+
# apply_patch.
77+
operation:,
8978
# The status of the apply patch tool call. One of `in_progress` or `completed`.
9079
status:,
9180
# The ID of the entity that created this tool call.
9281
created_by: nil,
93-
# One of the create_file, delete_file, or update_file operations applied via
94-
# apply_patch.
95-
operation: nil,
9682
# The type of the item. Always `apply_patch_call`.
9783
type: :apply_patch_call
9884
)
@@ -103,53 +89,18 @@ module OpenAI
10389
{
10490
id: String,
10591
call_id: String,
92+
operation:
93+
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants,
10694
status:
10795
OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol,
10896
type: Symbol,
109-
created_by: String,
110-
operation:
111-
OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants
97+
created_by: String
11298
}
11399
)
114100
end
115101
def to_hash
116102
end
117103

118-
# The status of the apply patch tool call. One of `in_progress` or `completed`.
119-
module Status
120-
extend OpenAI::Internal::Type::Enum
121-
122-
TaggedSymbol =
123-
T.type_alias do
124-
T.all(
125-
Symbol,
126-
OpenAI::Responses::ResponseApplyPatchToolCall::Status
127-
)
128-
end
129-
OrSymbol = T.type_alias { T.any(Symbol, String) }
130-
131-
IN_PROGRESS =
132-
T.let(
133-
:in_progress,
134-
OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
135-
)
136-
COMPLETED =
137-
T.let(
138-
:completed,
139-
OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
140-
)
141-
142-
sig do
143-
override.returns(
144-
T::Array[
145-
OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
146-
]
147-
)
148-
end
149-
def self.values
150-
end
151-
end
152-
153104
# One of the create_file, delete_file, or update_file operations applied via
154105
# apply_patch.
155106
module Operation
@@ -294,6 +245,41 @@ module OpenAI
294245
def self.variants
295246
end
296247
end
248+
249+
# The status of the apply patch tool call. One of `in_progress` or `completed`.
250+
module Status
251+
extend OpenAI::Internal::Type::Enum
252+
253+
TaggedSymbol =
254+
T.type_alias do
255+
T.all(
256+
Symbol,
257+
OpenAI::Responses::ResponseApplyPatchToolCall::Status
258+
)
259+
end
260+
OrSymbol = T.type_alias { T.any(Symbol, String) }
261+
262+
IN_PROGRESS =
263+
T.let(
264+
:in_progress,
265+
OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
266+
)
267+
COMPLETED =
268+
T.let(
269+
:completed,
270+
OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
271+
)
272+
273+
sig do
274+
override.returns(
275+
T::Array[
276+
OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
277+
]
278+
)
279+
end
280+
def self.values
281+
end
282+
end
297283
end
298284
end
299285
end

rbi/openai/models/responses/response_apply_patch_tool_call_output.rbi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ module OpenAI
2121
sig { returns(String) }
2222
attr_accessor :call_id
2323

24-
# Optional textual output returned by the apply patch tool.
25-
sig { returns(T.nilable(String)) }
26-
attr_accessor :output
27-
2824
# The status of the apply patch tool call output. One of `completed` or `failed`.
2925
sig do
3026
returns(
@@ -44,15 +40,19 @@ module OpenAI
4440
sig { params(created_by: String).void }
4541
attr_writer :created_by
4642

43+
# Optional textual output returned by the apply patch tool.
44+
sig { returns(T.nilable(String)) }
45+
attr_accessor :output
46+
4747
# The output emitted by an apply patch tool call.
4848
sig do
4949
params(
5050
id: String,
5151
call_id: String,
52-
output: T.nilable(String),
5352
status:
5453
OpenAI::Responses::ResponseApplyPatchToolCallOutput::Status::OrSymbol,
5554
created_by: String,
55+
output: T.nilable(String),
5656
type: Symbol
5757
).returns(T.attached_class)
5858
end
@@ -62,12 +62,12 @@ module OpenAI
6262
id:,
6363
# The unique ID of the apply patch tool call generated by the model.
6464
call_id:,
65-
# Optional textual output returned by the apply patch tool.
66-
output:,
6765
# The status of the apply patch tool call output. One of `completed` or `failed`.
6866
status:,
6967
# The ID of the entity that created this tool call output.
7068
created_by: nil,
69+
# Optional textual output returned by the apply patch tool.
70+
output: nil,
7171
# The type of the item. Always `apply_patch_call_output`.
7272
type: :apply_patch_call_output
7373
)
@@ -78,11 +78,11 @@ module OpenAI
7878
{
7979
id: String,
8080
call_id: String,
81-
output: T.nilable(String),
8281
status:
8382
OpenAI::Responses::ResponseApplyPatchToolCallOutput::Status::TaggedSymbol,
8483
type: Symbol,
85-
created_by: String
84+
created_by: String,
85+
output: T.nilable(String)
8686
}
8787
)
8888
end

0 commit comments

Comments
 (0)