Skip to content

Commit 7f36e50

Browse files
docs: swap examples used in readme (#408)
docs: document how to forcibly omit required field
1 parent 10c4047 commit 7f36e50

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,21 @@ JsonValue complexValue = JsonValue.from(Map.of(
781781
));
782782
```
783783

784+
Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.
785+
786+
To forcibly omit a required parameter or property, pass [`JsonMissing`](openai-java-core/src/main/kotlin/com/openai/core/Values.kt):
787+
788+
```java
789+
import com.openai.core.JsonMissing;
790+
import com.openai.models.ChatModel;
791+
import com.openai.models.chat.completions.ChatCompletionCreateParams;
792+
793+
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
794+
.model(ChatModel.O3_MINI)
795+
.messages(JsonMissing.of())
796+
.build();
797+
```
798+
784799
### Response properties
785800

786801
To access undocumented response properties, call the `_additionalProperties()` method:

0 commit comments

Comments
 (0)