Package com.openai.models
Class CustomToolInputFormat.Grammar
-
- All Implemented Interfaces:
public final class CustomToolInputFormat.Grammar
A grammar defined by the user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
CustomToolInputFormat.Grammar.Builder
A builder for Grammar.
public final class
CustomToolInputFormat.Grammar.Syntax
The syntax of the grammar definition. One of
lark
orregex
.
-
Method Summary
Modifier and Type Method Description final String
definition()
The grammar definition. final CustomToolInputFormat.Grammar.Syntax
syntax()
The syntax of the grammar definition. final JsonValue
_type()
Grammar format. final JsonField<String>
_definition()
Returns the raw JSON value of definition. final JsonField<CustomToolInputFormat.Grammar.Syntax>
_syntax()
Returns the raw JSON value of syntax. final Map<String, JsonValue>
_additionalProperties()
final CustomToolInputFormat.Grammar.Builder
toBuilder()
final CustomToolInputFormat.Grammar
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static CustomToolInputFormat.Grammar.Builder
builder()
Returns a mutable builder for constructing an instance of Grammar. -
-
Method Detail
-
definition
final String definition()
The grammar definition.
-
syntax
final CustomToolInputFormat.Grammar.Syntax syntax()
The syntax of the grammar definition. One of
lark
orregex
.
-
_type
final JsonValue _type()
Grammar format. 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).
-
_definition
final JsonField<String> _definition()
Returns the raw JSON value of definition.
Unlike definition, this method doesn't throw if the JSON field has an unexpected type.
-
_syntax
final JsonField<CustomToolInputFormat.Grammar.Syntax> _syntax()
Returns the raw JSON value of syntax.
Unlike syntax, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final CustomToolInputFormat.Grammar.Builder toBuilder()
-
validate
final CustomToolInputFormat.Grammar validate()
-
builder
final static CustomToolInputFormat.Grammar.Builder builder()
Returns a mutable builder for constructing an instance of Grammar.
The following fields are required:
.definition() .syntax()
-
-
-
-