Skip to content

Commit 6e60f41

Browse files
feat(api): add o3-mini (#192)
fix(types): correct metadata type + other fixes
1 parent 9d90f9e commit 6e60f41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2471
-647
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: 60
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-3904ef6b29a89c98f93a9b7da19879695f3c440564be6384db7af1b734611ede.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-6204952a29973265b9c0d66fc67ffaf53c6a90ae4d75cdacf9d147676f5274c9.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ import com.openai.models.ChatModel;
9797

9898
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
9999
.addUserMessage("Say this is a test")
100-
.model(ChatModel.O1)
100+
.model(ChatModel.O3_MINI)
101101
.build();
102102
ChatCompletion chatCompletion = client.chat().completions().create(params);
103103
```

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

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ private constructor(
3333
@JsonProperty("instructions")
3434
@ExcludeMissing
3535
private val instructions: JsonField<String> = JsonMissing.of(),
36-
@JsonProperty("metadata") @ExcludeMissing private val metadata: JsonValue = JsonMissing.of(),
36+
@JsonProperty("metadata")
37+
@ExcludeMissing
38+
private val metadata: JsonField<Metadata> = JsonMissing.of(),
3739
@JsonProperty("model") @ExcludeMissing private val model: JsonField<String> = JsonMissing.of(),
3840
@JsonProperty("name") @ExcludeMissing private val name: JsonField<String> = JsonMissing.of(),
3941
@JsonProperty("object") @ExcludeMissing private val object_: JsonValue = JsonMissing.of(),
@@ -71,10 +73,13 @@ private constructor(
7173

7274
/**
7375
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
74-
* additional information about the object in a structured format. Keys can be a maximum of 64
75-
* characters long and values can be a maximum of 512 characters long.
76+
* additional information about the object in a structured format, and querying for objects via
77+
* API or the dashboard.
78+
*
79+
* Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
80+
* length of 512 characters.
7681
*/
77-
@JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonValue = metadata
82+
fun metadata(): Optional<Metadata> = Optional.ofNullable(metadata.getNullable("metadata"))
7883

7984
/**
8085
* ID of the model to use. You can use the
@@ -159,6 +164,16 @@ private constructor(
159164
@ExcludeMissing
160165
fun _instructions(): JsonField<String> = instructions
161166

167+
/**
168+
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
169+
* additional information about the object in a structured format, and querying for objects via
170+
* API or the dashboard.
171+
*
172+
* Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
173+
* length of 512 characters.
174+
*/
175+
@JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField<Metadata> = metadata
176+
162177
/**
163178
* ID of the model to use. You can use the
164179
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of
@@ -239,6 +254,7 @@ private constructor(
239254
createdAt()
240255
description()
241256
instructions()
257+
metadata().ifPresent { it.validate() }
242258
model()
243259
name()
244260
_object_().let {
@@ -268,7 +284,7 @@ private constructor(
268284
private var createdAt: JsonField<Long>? = null
269285
private var description: JsonField<String>? = null
270286
private var instructions: JsonField<String>? = null
271-
private var metadata: JsonValue? = null
287+
private var metadata: JsonField<Metadata>? = null
272288
private var model: JsonField<String>? = null
273289
private var name: JsonField<String>? = null
274290
private var object_: JsonValue = JsonValue.from("assistant")
@@ -340,10 +356,33 @@ private constructor(
340356

341357
/**
342358
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
343-
* storing additional information about the object in a structured format. Keys can be a
344-
* maximum of 64 characters long and values can be a maximum of 512 characters long.
359+
* storing additional information about the object in a structured format, and querying for
360+
* objects via API or the dashboard.
361+
*
362+
* Keys are strings with a maximum length of 64 characters. Values are strings with a
363+
* maximum length of 512 characters.
364+
*/
365+
fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata))
366+
367+
/**
368+
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
369+
* storing additional information about the object in a structured format, and querying for
370+
* objects via API or the dashboard.
371+
*
372+
* Keys are strings with a maximum length of 64 characters. Values are strings with a
373+
* maximum length of 512 characters.
374+
*/
375+
fun metadata(metadata: Optional<Metadata>) = metadata(metadata.orElse(null))
376+
377+
/**
378+
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
379+
* storing additional information about the object in a structured format, and querying for
380+
* objects via API or the dashboard.
381+
*
382+
* Keys are strings with a maximum length of 64 characters. Values are strings with a
383+
* maximum length of 512 characters.
345384
*/
346-
fun metadata(metadata: JsonValue) = apply { this.metadata = metadata }
385+
fun metadata(metadata: JsonField<Metadata>) = apply { this.metadata = metadata }
347386

348387
/**
349388
* ID of the model to use. You can use the

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

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ private constructor(
7070
@JsonProperty("in_progress_at")
7171
@ExcludeMissing
7272
private val inProgressAt: JsonField<Long> = JsonMissing.of(),
73-
@JsonProperty("metadata") @ExcludeMissing private val metadata: JsonValue = JsonMissing.of(),
73+
@JsonProperty("metadata")
74+
@ExcludeMissing
75+
private val metadata: JsonField<Metadata> = JsonMissing.of(),
7476
@JsonProperty("output_file_id")
7577
@ExcludeMissing
7678
private val outputFileId: JsonField<String> = JsonMissing.of(),
@@ -135,10 +137,13 @@ private constructor(
135137

136138
/**
137139
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
138-
* additional information about the object in a structured format. Keys can be a maximum of 64
139-
* characters long and values can be a maximum of 512 characters long.
140+
* additional information about the object in a structured format, and querying for objects via
141+
* API or the dashboard.
142+
*
143+
* Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
144+
* length of 512 characters.
140145
*/
141-
@JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonValue = metadata
146+
fun metadata(): Optional<Metadata> = Optional.ofNullable(metadata.getNullable("metadata"))
142147

143148
/** The ID of the file containing the outputs of successfully executed requests. */
144149
fun outputFileId(): Optional<String> =
@@ -206,6 +211,16 @@ private constructor(
206211
@ExcludeMissing
207212
fun _inProgressAt(): JsonField<Long> = inProgressAt
208213

214+
/**
215+
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
216+
* additional information about the object in a structured format, and querying for objects via
217+
* API or the dashboard.
218+
*
219+
* Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
220+
* length of 512 characters.
221+
*/
222+
@JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField<Metadata> = metadata
223+
209224
/** The ID of the file containing the outputs of successfully executed requests. */
210225
@JsonProperty("output_file_id")
211226
@ExcludeMissing
@@ -248,6 +263,7 @@ private constructor(
248263
failedAt()
249264
finalizingAt()
250265
inProgressAt()
266+
metadata().ifPresent { it.validate() }
251267
outputFileId()
252268
requestCounts().ifPresent { it.validate() }
253269
validated = true
@@ -280,7 +296,7 @@ private constructor(
280296
private var failedAt: JsonField<Long> = JsonMissing.of()
281297
private var finalizingAt: JsonField<Long> = JsonMissing.of()
282298
private var inProgressAt: JsonField<Long> = JsonMissing.of()
283-
private var metadata: JsonValue = JsonMissing.of()
299+
private var metadata: JsonField<Metadata> = JsonMissing.of()
284300
private var outputFileId: JsonField<String> = JsonMissing.of()
285301
private var requestCounts: JsonField<BatchRequestCounts> = JsonMissing.of()
286302
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -410,10 +426,33 @@ private constructor(
410426

411427
/**
412428
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
413-
* storing additional information about the object in a structured format. Keys can be a
414-
* maximum of 64 characters long and values can be a maximum of 512 characters long.
429+
* storing additional information about the object in a structured format, and querying for
430+
* objects via API or the dashboard.
431+
*
432+
* Keys are strings with a maximum length of 64 characters. Values are strings with a
433+
* maximum length of 512 characters.
434+
*/
435+
fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata))
436+
437+
/**
438+
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
439+
* storing additional information about the object in a structured format, and querying for
440+
* objects via API or the dashboard.
441+
*
442+
* Keys are strings with a maximum length of 64 characters. Values are strings with a
443+
* maximum length of 512 characters.
444+
*/
445+
fun metadata(metadata: Optional<Metadata>) = metadata(metadata.orElse(null))
446+
447+
/**
448+
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
449+
* storing additional information about the object in a structured format, and querying for
450+
* objects via API or the dashboard.
451+
*
452+
* Keys are strings with a maximum length of 64 characters. Values are strings with a
453+
* maximum length of 512 characters.
415454
*/
416-
fun metadata(metadata: JsonValue) = apply { this.metadata = metadata }
455+
fun metadata(metadata: JsonField<Metadata>) = apply { this.metadata = metadata }
417456

418457
/** The ID of the file containing the outputs of successfully executed requests. */
419458
fun outputFileId(outputFileId: String) = outputFileId(JsonField.of(outputFileId))

0 commit comments

Comments
 (0)