Choice

class oci.generative_ai_inference.models.Choice(**kwargs)

Bases: object

Represents a single instance of the generated text.

Methods

__init__(**kwargs) Initializes a new Choice object with values from keyword arguments.

Attributes

finish_reason [Required] Gets the finish_reason of this Choice.
index [Required] Gets the index of this Choice.
logprobs Gets the logprobs of this Choice.
text [Required] Gets the text of this Choice.
__init__(**kwargs)

Initializes a new Choice object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • index (int) – The value to assign to the index property of this Choice.
  • text (str) – The value to assign to the text property of this Choice.
  • finish_reason (str) – The value to assign to the finish_reason property of this Choice.
  • logprobs (oci.generative_ai_inference.models.Logprobs) – The value to assign to the logprobs property of this Choice.
finish_reason

[Required] Gets the finish_reason of this Choice. The reason why the model stopped generating tokens.

Stops if the model hits a natural stop point or a provided stop sequence. Returns the length if the tokens reach the specified maximum number of tokens.

Returns:The finish_reason of this Choice.
Return type:str
index

[Required] Gets the index of this Choice. The index of the generated text.

Returns:The index of this Choice.
Return type:int
logprobs

Gets the logprobs of this Choice.

Returns:The logprobs of this Choice.
Return type:oci.generative_ai_inference.models.Logprobs
text

[Required] Gets the text of this Choice. The generated text.

Returns:The text of this Choice.
Return type:str