Package com.openai.models
Class ResponseFormatTextGrammar
-
- All Implemented Interfaces:
public final class ResponseFormatTextGrammar
A custom grammar for the model to follow when generating text. Learn more in the custom grammars guide.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ResponseFormatTextGrammar.Builder
A builder for ResponseFormatTextGrammar.
-
Method Summary
Modifier and Type Method Description final String
grammar()
The custom grammar for the model to follow. final JsonValue
_type()
The type of response format being defined. final JsonField<String>
_grammar()
Returns the raw JSON value of grammar. final Map<String, JsonValue>
_additionalProperties()
final ResponseFormatTextGrammar.Builder
toBuilder()
final ResponseFormatTextGrammar
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ResponseFormatTextGrammar.Builder
builder()
Returns a mutable builder for constructing an instance of ResponseFormatTextGrammar. -
-
Method Detail
-
_type
final JsonValue _type()
The type of response format being defined. Always
grammar
.Expected to always return the following:
JsonValue.from("grammar")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_grammar
final JsonField<String> _grammar()
Returns the raw JSON value of grammar.
Unlike grammar, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ResponseFormatTextGrammar.Builder toBuilder()
-
validate
final ResponseFormatTextGrammar validate()
-
builder
final static ResponseFormatTextGrammar.Builder builder()
Returns a mutable builder for constructing an instance of ResponseFormatTextGrammar.
The following fields are required:
.grammar()
-
-
-
-