Skip to content

Commit d7f4751

Browse files
feat(api): gpt 5.2
1 parent 118a835 commit d7f4751

40 files changed

+196
-109
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: 136
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-88d85ff87ad8983262af2b729762a6e05fd509468bb691529bc2f81e4ce27c69.yml
3-
openapi_spec_hash: 46a55acbccd0147534017b92c1f4dd99
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-41f98da99f44ebe6204fce5c1dc9940f85f3472779e797b674c4fdc20306c77d.yml
3+
openapi_spec_hash: c61259027f421f501bdc6b23cf9e430e
44
config_hash: 141b101c9f13b90e21af74e1686f1f41

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
8282

8383
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
8484
.addUserMessage("Say this is a test")
85-
.model(ChatModel.GPT_5_1)
85+
.model(ChatModel.GPT_5_2)
8686
.build();
8787
ChatCompletion chatCompletion = client.chat().completions().create(params);
8888
```
@@ -188,7 +188,7 @@ OpenAIClient client = OpenAIOkHttpClient.fromEnv();
188188

189189
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
190190
.addUserMessage("Say this is a test")
191-
.model(ChatModel.GPT_5_1)
191+
.model(ChatModel.GPT_5_2)
192192
.build();
193193
CompletableFuture<ChatCompletion> chatCompletion = client.async().chat().completions().create(params);
194194
```
@@ -209,7 +209,7 @@ OpenAIClientAsync client = OpenAIOkHttpClientAsync.fromEnv();
209209

210210
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
211211
.addUserMessage("Say this is a test")
212-
.model(ChatModel.GPT_5_1)
212+
.model(ChatModel.GPT_5_2)
213213
.build();
214214
CompletableFuture<ChatCompletion> chatCompletion = client.chat().completions().create(params);
215215
```
@@ -1143,7 +1143,7 @@ import com.openai.models.chat.completions.ChatCompletionCreateParams;
11431143

11441144
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
11451145
.addUserMessage("Say this is a test")
1146-
.model(ChatModel.GPT_5_1)
1146+
.model(ChatModel.GPT_5_2)
11471147
.build();
11481148
HttpResponseFor<ChatCompletion> chatCompletion = client.chat().completions().withRawResponse().create(params);
11491149

@@ -1616,7 +1616,7 @@ import com.openai.models.chat.completions.ChatCompletionCreateParams;
16161616

16171617
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
16181618
.messages(JsonValue.from(42))
1619-
.model(ChatModel.GPT_5_1)
1619+
.model(ChatModel.GPT_5_2)
16201620
.build();
16211621
```
16221622

@@ -1669,7 +1669,7 @@ import com.openai.models.ChatModel;
16691669
import com.openai.models.chat.completions.ChatCompletionCreateParams;
16701670

16711671
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
1672-
.model(ChatModel.GPT_5_1)
1672+
.model(ChatModel.GPT_5_2)
16731673
.messages(JsonMissing.of())
16741674
.build();
16751675
```

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
2020

2121
companion object {
2222

23+
@JvmField val GPT_5_2 = of("gpt-5.2")
24+
25+
@JvmField val GPT_5_2_2025_12_11 = of("gpt-5.2-2025-12-11")
26+
27+
@JvmField val GPT_5_2_CHAT_LATEST = of("gpt-5.2-chat-latest")
28+
29+
@JvmField val GPT_5_2_PRO = of("gpt-5.2-pro")
30+
31+
@JvmField val GPT_5_2_PRO_2025_12_11 = of("gpt-5.2-pro-2025-12-11")
32+
2333
@JvmField val GPT_5_1 = of("gpt-5.1")
2434

2535
@JvmField val GPT_5_1_2025_11_13 = of("gpt-5.1-2025-11-13")
@@ -161,6 +171,11 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
161171

162172
/** An enum containing [ChatModel]'s known values. */
163173
enum class Known {
174+
GPT_5_2,
175+
GPT_5_2_2025_12_11,
176+
GPT_5_2_CHAT_LATEST,
177+
GPT_5_2_PRO,
178+
GPT_5_2_PRO_2025_12_11,
164179
GPT_5_1,
165180
GPT_5_1_2025_11_13,
166181
GPT_5_1_CODEX,
@@ -240,6 +255,11 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
240255
* - It was constructed with an arbitrary value using the [of] method.
241256
*/
242257
enum class Value {
258+
GPT_5_2,
259+
GPT_5_2_2025_12_11,
260+
GPT_5_2_CHAT_LATEST,
261+
GPT_5_2_PRO,
262+
GPT_5_2_PRO_2025_12_11,
243263
GPT_5_1,
244264
GPT_5_1_2025_11_13,
245265
GPT_5_1_CODEX,
@@ -320,6 +340,11 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
320340
*/
321341
fun value(): Value =
322342
when (this) {
343+
GPT_5_2 -> Value.GPT_5_2
344+
GPT_5_2_2025_12_11 -> Value.GPT_5_2_2025_12_11
345+
GPT_5_2_CHAT_LATEST -> Value.GPT_5_2_CHAT_LATEST
346+
GPT_5_2_PRO -> Value.GPT_5_2_PRO
347+
GPT_5_2_PRO_2025_12_11 -> Value.GPT_5_2_PRO_2025_12_11
323348
GPT_5_1 -> Value.GPT_5_1
324349
GPT_5_1_2025_11_13 -> Value.GPT_5_1_2025_11_13
325350
GPT_5_1_CODEX -> Value.GPT_5_1_CODEX
@@ -400,6 +425,11 @@ class ChatModel @JsonCreator private constructor(private val value: JsonField<St
400425
*/
401426
fun known(): Known =
402427
when (this) {
428+
GPT_5_2 -> Known.GPT_5_2
429+
GPT_5_2_2025_12_11 -> Known.GPT_5_2_2025_12_11
430+
GPT_5_2_CHAT_LATEST -> Known.GPT_5_2_CHAT_LATEST
431+
GPT_5_2_PRO -> Known.GPT_5_2_PRO
432+
GPT_5_2_PRO_2025_12_11 -> Known.GPT_5_2_PRO_2025_12_11
403433
GPT_5_1 -> Known.GPT_5_1
404434
GPT_5_1_2025_11_13 -> Known.GPT_5_1_2025_11_13
405435
GPT_5_1_CODEX -> Known.GPT_5_1_CODEX

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private constructor(
5353
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
5454
* `none`.
5555
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
56-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
56+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
5757
*
5858
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
5959
* server responded with an unexpected value).
@@ -77,7 +77,8 @@ private constructor(
7777
* A summary of the reasoning performed by the model. This can be useful for debugging and
7878
* understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`.
7979
*
80-
* `concise` is only supported for `computer-use-preview` models.
80+
* `concise` is supported for `computer-use-preview` models and all reasoning models after
81+
* `gpt-5`.
8182
*
8283
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
8384
* server responded with an unexpected value).
@@ -154,7 +155,7 @@ private constructor(
154155
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
155156
* `none`.
156157
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
157-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
158+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
158159
*/
159160
fun effort(effort: ReasoningEffort?) = effort(JsonField.ofNullable(effort))
160161

@@ -201,7 +202,8 @@ private constructor(
201202
* A summary of the reasoning performed by the model. This can be useful for debugging and
202203
* understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`.
203204
*
204-
* `concise` is only supported for `computer-use-preview` models.
205+
* `concise` is supported for `computer-use-preview` models and all reasoning models after
206+
* `gpt-5`.
205207
*/
206208
fun summary(summary: Summary?) = summary(JsonField.ofNullable(summary))
207209

@@ -422,7 +424,8 @@ private constructor(
422424
* A summary of the reasoning performed by the model. This can be useful for debugging and
423425
* understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`.
424426
*
425-
* `concise` is only supported for `computer-use-preview` models.
427+
* `concise` is supported for `computer-use-preview` models and all reasoning models after
428+
* `gpt-5`.
426429
*/
427430
class Summary @JsonCreator private constructor(private val value: JsonField<String>) : Enum {
428431

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import com.openai.errors.OpenAIInvalidDataException
1717
* reasoning values in gpt-5.1.
1818
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
1919
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
20-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
20+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
2121
*/
2222
class ReasoningEffort @JsonCreator private constructor(private val value: JsonField<String>) :
2323
Enum {

openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantCreateParams.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private constructor(
106106
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
107107
* `none`.
108108
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
109-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
109+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
110110
*
111111
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
112112
* server responded with an unexpected value).
@@ -413,7 +413,7 @@ private constructor(
413413
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
414414
* `none`.
415415
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
416-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
416+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
417417
*/
418418
fun reasoningEffort(reasoningEffort: ReasoningEffort?) = apply {
419419
body.reasoningEffort(reasoningEffort)
@@ -883,7 +883,7 @@ private constructor(
883883
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
884884
* `none`.
885885
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
886-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
886+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
887887
*
888888
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
889889
* server responded with an unexpected value).
@@ -1222,7 +1222,7 @@ private constructor(
12221222
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
12231223
* support `none`.
12241224
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1225-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
1225+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
12261226
*/
12271227
fun reasoningEffort(reasoningEffort: ReasoningEffort?) =
12281228
reasoningEffort(JsonField.ofNullable(reasoningEffort))

openai-java-core/src/main/kotlin/com/openai/models/beta/assistants/AssistantUpdateParams.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private constructor(
9898
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
9999
* `none`.
100100
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
101-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
101+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
102102
*
103103
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
104104
* server responded with an unexpected value).
@@ -407,7 +407,7 @@ private constructor(
407407
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
408408
* `none`.
409409
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
410-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
410+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
411411
*/
412412
fun reasoningEffort(reasoningEffort: ReasoningEffort?) = apply {
413413
body.reasoningEffort(reasoningEffort)
@@ -877,7 +877,7 @@ private constructor(
877877
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
878878
* `none`.
879879
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
880-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
880+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
881881
*
882882
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
883883
* server responded with an unexpected value).
@@ -1209,7 +1209,7 @@ private constructor(
12091209
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
12101210
* support `none`.
12111211
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1212-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
1212+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
12131213
*/
12141214
fun reasoningEffort(reasoningEffort: ReasoningEffort?) =
12151215
reasoningEffort(JsonField.ofNullable(reasoningEffort))

openai-java-core/src/main/kotlin/com/openai/models/beta/threads/runs/RunCreateParams.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private constructor(
175175
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
176176
* `none`.
177177
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
178-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
178+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
179179
*
180180
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
181181
* server responded with an unexpected value).
@@ -702,7 +702,7 @@ private constructor(
702702
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
703703
* `none`.
704704
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
705-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
705+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
706706
*/
707707
fun reasoningEffort(reasoningEffort: ReasoningEffort?) = apply {
708708
body.reasoningEffort(reasoningEffort)
@@ -1302,7 +1302,7 @@ private constructor(
13021302
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
13031303
* `none`.
13041304
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1305-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
1305+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
13061306
*
13071307
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
13081308
* server responded with an unexpected value).
@@ -1852,7 +1852,7 @@ private constructor(
18521852
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
18531853
* support `none`.
18541854
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1855-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
1855+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
18561856
*/
18571857
fun reasoningEffort(reasoningEffort: ReasoningEffort?) =
18581858
reasoningEffort(JsonField.ofNullable(reasoningEffort))

openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private constructor(
286286
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
287287
* `none`.
288288
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
289-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
289+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
290290
*
291291
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
292292
* server responded with an unexpected value).
@@ -1407,7 +1407,7 @@ private constructor(
14071407
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
14081408
* `none`.
14091409
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1410-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
1410+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
14111411
*/
14121412
fun reasoningEffort(reasoningEffort: ReasoningEffort?) = apply {
14131413
body.reasoningEffort(reasoningEffort)
@@ -2446,7 +2446,7 @@ private constructor(
24462446
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support
24472447
* `none`.
24482448
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
2449-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
2449+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
24502450
*
24512451
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the
24522452
* server responded with an unexpected value).
@@ -3743,7 +3743,7 @@ private constructor(
37433743
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
37443744
* support `none`.
37453745
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
3746-
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
3746+
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
37473747
*/
37483748
fun reasoningEffort(reasoningEffort: ReasoningEffort?) =
37493749
reasoningEffort(JsonField.ofNullable(reasoningEffort))

openai-java-core/src/main/kotlin/com/openai/models/evals/EvalCreateParams.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5478,7 +5478,8 @@ private constructor(
54785478
.build()
54795479

54805480
/**
5481-
* The input text. This may include template strings.
5481+
* The input messages evaluated by the grader. Supports text, output text, input image,
5482+
* and input audio content blocks, and may include template strings.
54825483
*
54835484
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
54845485
* unexpectedly missing or null (e.g. if the server responded with an unexpected
@@ -5644,7 +5645,10 @@ private constructor(
56445645
additionalProperties = scoreModel.additionalProperties.toMutableMap()
56455646
}
56465647

5647-
/** The input text. This may include template strings. */
5648+
/**
5649+
* The input messages evaluated by the grader. Supports text, output text, input
5650+
* image, and input audio content blocks, and may include template strings.
5651+
*/
56485652
fun input(input: List<ScoreModelGrader.Input>) = input(JsonField.of(input))
56495653

56505654
/**

0 commit comments

Comments
 (0)