TokenLikelihood¶
-
class
oci.generative_ai_inference.models.
TokenLikelihood
(**kwargs)¶ Bases:
object
An object that contains the returned token and its corresponding likelihood.
Methods
__init__
(**kwargs)Initializes a new TokenLikelihood object with values from keyword arguments. Attributes
likelihood
Gets the likelihood of this TokenLikelihood. token
Gets the token of this TokenLikelihood. -
__init__
(**kwargs)¶ Initializes a new TokenLikelihood object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):
Parameters: - token (str) – The value to assign to the token property of this TokenLikelihood.
- likelihood (float) – The value to assign to the likelihood property of this TokenLikelihood.
-
likelihood
¶ Gets the likelihood of this TokenLikelihood. The likelihood of this token during generation.
Returns: The likelihood of this TokenLikelihood. Return type: float
-
token
¶ Gets the token of this TokenLikelihood. A word, part of a word, or a punctuation.
For example, apple is a token and friendship is made up of two tokens, friend and ship. When you run a model, you can set the maximum number of output tokens. Estimate three tokens per word.
Returns: The token of this TokenLikelihood. Return type: str
-