Package com.openai.models
Class CompletionCreateParams.LogitBias
-
- All Implemented Interfaces:
public final class CompletionCreateParams.LogitBias
Modify the likelihood of specified tokens appearing in the completion.
Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this /tokenizer?view=bpe to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
As an example, you can pass
{"50256": -100}
to prevent the <|endoftext|> token from being generated.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
CompletionCreateParams.LogitBias.Builder
-
Method Summary
Modifier and Type Method Description final Map<String, JsonValue>
_additionalProperties()
final CompletionCreateParams.LogitBias
validate()
final CompletionCreateParams.LogitBias.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static CompletionCreateParams.LogitBias.Builder
builder()
-
-
Method Detail
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final CompletionCreateParams.LogitBias validate()
-
toBuilder
final CompletionCreateParams.LogitBias.Builder toBuilder()
-
builder
final static CompletionCreateParams.LogitBias.Builder builder()
-
-
-
-