Skip to content
An image in 8-bit minimalist style shows two flat-colored square tokens: one with a checkmark symbolizing "OK", and one with an "X" for "ERR". The squares are joined by lines indicating adjustment or transition between states. The design uses five distinct colors, features bold, basic shapes, and has no text, people, or background details.

Choices

You can specify a list of preferred words (choices) in the script metadata. It will increase the probability of the model generating the specified words.

  • Each word should match a single token for the desired model!
  • For some models, GenAIScript does not have a token encoder so it won’t be able to compute the logit bias for the choices
script({
choices: ["OK", "ERR"],
})
...
ERR

You can tune the probability of each choice by providing a weight for each choice. The default weight is 5.

script({
choices: ["OK", { token: "ERR", weight: 10 }],
})

For models where GenAIScript does not have a token encoder, you can provide the pre-encoded tokens.

script({
choices: [{ token: 12345, weight: 10 }],
})

Internally, GenAIScript tokenizes the word and build the logit_bias for each token.

  • choices: OK, ERR
  • logit bias: {"5175":5,"5392":5}

You can enable logprobs to visualize the confidence of the tokens generated by the model.


ERR .