Skip to content

Commit 5acfb76

Browse files
feat(api): add keys field to computer action types in ComputerAction/ResponseComputerToolCall
1 parent ef6cb11 commit 5acfb76

9 files changed

Lines changed: 623 additions & 48 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 151
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0fea07225431c8d0cf5fc1a70c9363a91d259f7a169f410717e162de1b24e489.yml
3-
openapi_spec_hash: 41b34c1678ec0e95daf62ca4cd52c8f8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-13599f99dceef322e19171dcc63d90f638d225a445999442249e1ed7a4924c43.yml
3+
openapi_spec_hash: aac8cf8ec3c7dc6d14ecf5dbb289ee7c
44
config_hash: 96fbf82cf74a44ccd513f5acf0956ffd

openai-java-core/src/main/kotlin/com/openai/models/responses/ComputerAction.kt

Lines changed: 274 additions & 20 deletions
Large diffs are not rendered by default.

openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseComputerToolCall.kt

Lines changed: 298 additions & 20 deletions
Large diffs are not rendered by default.

openai-java-core/src/test/kotlin/com/openai/models/conversations/items/ConversationItemTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,15 @@ internal class ConversationItemTest {
460460
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
461461
.x(0L)
462462
.y(0L)
463+
.addKey("string")
463464
.build()
464465
)
465466
.addAction(
466467
ComputerAction.Click.builder()
467468
.button(ComputerAction.Click.Button.LEFT)
468469
.x(0L)
469470
.y(0L)
471+
.addKey("string")
470472
.build()
471473
)
472474
.build()
@@ -521,13 +523,15 @@ internal class ConversationItemTest {
521523
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
522524
.x(0L)
523525
.y(0L)
526+
.addKey("string")
524527
.build()
525528
)
526529
.addAction(
527530
ComputerAction.Click.builder()
528531
.button(ComputerAction.Click.Button.LEFT)
529532
.x(0L)
530533
.y(0L)
534+
.addKey("string")
531535
.build()
532536
)
533537
.build()

openai-java-core/src/test/kotlin/com/openai/models/responses/ComputerActionTest.kt

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ internal class ComputerActionTest {
2121
.button(ComputerAction.Click.Button.LEFT)
2222
.x(0L)
2323
.y(0L)
24+
.addKey("string")
2425
.build()
2526

2627
val computerAction = ComputerAction.ofClick(click)
@@ -45,6 +46,7 @@ internal class ComputerActionTest {
4546
.button(ComputerAction.Click.Button.LEFT)
4647
.x(0L)
4748
.y(0L)
49+
.addKey("string")
4850
.build()
4951
)
5052

@@ -59,7 +61,7 @@ internal class ComputerActionTest {
5961

6062
@Test
6163
fun ofDoubleClick() {
62-
val doubleClick = ComputerAction.DoubleClick.builder().x(0L).y(0L).build()
64+
val doubleClick = ComputerAction.DoubleClick.builder().addKey("string").x(0L).y(0L).build()
6365

6466
val computerAction = ComputerAction.ofDoubleClick(doubleClick)
6567

@@ -78,7 +80,9 @@ internal class ComputerActionTest {
7880
fun ofDoubleClickRoundtrip() {
7981
val jsonMapper = jsonMapper()
8082
val computerAction =
81-
ComputerAction.ofDoubleClick(ComputerAction.DoubleClick.builder().x(0L).y(0L).build())
83+
ComputerAction.ofDoubleClick(
84+
ComputerAction.DoubleClick.builder().addKey("string").x(0L).y(0L).build()
85+
)
8286

8387
val roundtrippedComputerAction =
8488
jsonMapper.readValue(
@@ -94,6 +98,7 @@ internal class ComputerActionTest {
9498
val drag =
9599
ComputerAction.Drag.builder()
96100
.addPath(ComputerAction.Drag.Path.builder().x(0L).y(0L).build())
101+
.addKey("string")
97102
.build()
98103

99104
val computerAction = ComputerAction.ofDrag(drag)
@@ -116,6 +121,7 @@ internal class ComputerActionTest {
116121
ComputerAction.ofDrag(
117122
ComputerAction.Drag.builder()
118123
.addPath(ComputerAction.Drag.Path.builder().x(0L).y(0L).build())
124+
.addKey("string")
119125
.build()
120126
)
121127

@@ -162,7 +168,7 @@ internal class ComputerActionTest {
162168

163169
@Test
164170
fun ofMove() {
165-
val move = ComputerAction.Move.builder().x(0L).y(0L).build()
171+
val move = ComputerAction.Move.builder().x(0L).y(0L).addKey("string").build()
166172

167173
val computerAction = ComputerAction.ofMove(move)
168174

@@ -181,7 +187,9 @@ internal class ComputerActionTest {
181187
fun ofMoveRoundtrip() {
182188
val jsonMapper = jsonMapper()
183189
val computerAction =
184-
ComputerAction.ofMove(ComputerAction.Move.builder().x(0L).y(0L).build())
190+
ComputerAction.ofMove(
191+
ComputerAction.Move.builder().x(0L).y(0L).addKey("string").build()
192+
)
185193

186194
val roundtrippedComputerAction =
187195
jsonMapper.readValue(
@@ -224,7 +232,14 @@ internal class ComputerActionTest {
224232

225233
@Test
226234
fun ofScroll() {
227-
val scroll = ComputerAction.Scroll.builder().scrollX(0L).scrollY(0L).x(0L).y(0L).build()
235+
val scroll =
236+
ComputerAction.Scroll.builder()
237+
.scrollX(0L)
238+
.scrollY(0L)
239+
.x(0L)
240+
.y(0L)
241+
.addKey("string")
242+
.build()
228243

229244
val computerAction = ComputerAction.ofScroll(scroll)
230245

@@ -244,7 +259,13 @@ internal class ComputerActionTest {
244259
val jsonMapper = jsonMapper()
245260
val computerAction =
246261
ComputerAction.ofScroll(
247-
ComputerAction.Scroll.builder().scrollX(0L).scrollY(0L).x(0L).y(0L).build()
262+
ComputerAction.Scroll.builder()
263+
.scrollX(0L)
264+
.scrollY(0L)
265+
.x(0L)
266+
.y(0L)
267+
.addKey("string")
268+
.build()
248269
)
249270

250271
val roundtrippedComputerAction =

openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseComputerToolCallTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ internal class ResponseComputerToolCallTest {
3030
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
3131
.x(0L)
3232
.y(0L)
33+
.addKey("string")
3334
.build()
3435
)
3536
.addAction(
3637
ComputerAction.Click.builder()
3738
.button(ComputerAction.Click.Button.LEFT)
3839
.x(0L)
3940
.y(0L)
41+
.addKey("string")
4042
.build()
4143
)
4244
.build()
@@ -62,6 +64,7 @@ internal class ResponseComputerToolCallTest {
6264
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
6365
.x(0L)
6466
.y(0L)
67+
.addKey("string")
6568
.build()
6669
)
6770
)
@@ -72,6 +75,7 @@ internal class ResponseComputerToolCallTest {
7275
.button(ComputerAction.Click.Button.LEFT)
7376
.x(0L)
7477
.y(0L)
78+
.addKey("string")
7579
.build()
7680
)
7781
)
@@ -98,13 +102,15 @@ internal class ResponseComputerToolCallTest {
98102
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
99103
.x(0L)
100104
.y(0L)
105+
.addKey("string")
101106
.build()
102107
)
103108
.addAction(
104109
ComputerAction.Click.builder()
105110
.button(ComputerAction.Click.Button.LEFT)
106111
.x(0L)
107112
.y(0L)
113+
.addKey("string")
108114
.build()
109115
)
110116
.build()

openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseInputItemTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,15 @@ internal class ResponseInputItemTest {
364364
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
365365
.x(0L)
366366
.y(0L)
367+
.addKey("string")
367368
.build()
368369
)
369370
.addAction(
370371
ComputerAction.Click.builder()
371372
.button(ComputerAction.Click.Button.LEFT)
372373
.x(0L)
373374
.y(0L)
375+
.addKey("string")
374376
.build()
375377
)
376378
.build()
@@ -429,13 +431,15 @@ internal class ResponseInputItemTest {
429431
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
430432
.x(0L)
431433
.y(0L)
434+
.addKey("string")
432435
.build()
433436
)
434437
.addAction(
435438
ComputerAction.Click.builder()
436439
.button(ComputerAction.Click.Button.LEFT)
437440
.x(0L)
438441
.y(0L)
442+
.addKey("string")
439443
.build()
440444
)
441445
.build()

openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseItemTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,15 @@ internal class ResponseItemTest {
282282
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
283283
.x(0L)
284284
.y(0L)
285+
.addKey("string")
285286
.build()
286287
)
287288
.addAction(
288289
ComputerAction.Click.builder()
289290
.button(ComputerAction.Click.Button.LEFT)
290291
.x(0L)
291292
.y(0L)
293+
.addKey("string")
292294
.build()
293295
)
294296
.build()
@@ -341,13 +343,15 @@ internal class ResponseItemTest {
341343
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
342344
.x(0L)
343345
.y(0L)
346+
.addKey("string")
344347
.build()
345348
)
346349
.addAction(
347350
ComputerAction.Click.builder()
348351
.button(ComputerAction.Click.Button.LEFT)
349352
.x(0L)
350353
.y(0L)
354+
.addKey("string")
351355
.build()
352356
)
353357
.build()

openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseOutputItemTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,15 @@ internal class ResponseOutputItemTest {
354354
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
355355
.x(0L)
356356
.y(0L)
357+
.addKey("string")
357358
.build()
358359
)
359360
.addAction(
360361
ComputerAction.Click.builder()
361362
.button(ComputerAction.Click.Button.LEFT)
362363
.x(0L)
363364
.y(0L)
365+
.addKey("string")
364366
.build()
365367
)
366368
.build()
@@ -411,13 +413,15 @@ internal class ResponseOutputItemTest {
411413
.button(ResponseComputerToolCall.Action.Click.Button.LEFT)
412414
.x(0L)
413415
.y(0L)
416+
.addKey("string")
414417
.build()
415418
)
416419
.addAction(
417420
ComputerAction.Click.builder()
418421
.button(ComputerAction.Click.Button.LEFT)
419422
.x(0L)
420423
.y(0L)
424+
.addKey("string")
421425
.build()
422426
)
423427
.build()

0 commit comments

Comments
 (0)