CohereChatResponseV2

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

Bases: oci.generative_ai_inference.models.base_chat_response.BaseChatResponse

The response to the chat conversation.

Attributes

API_FORMAT_COHERE str(object=’’) -> str
API_FORMAT_COHEREV2 str(object=’’) -> str
API_FORMAT_GENERIC str(object=’’) -> str
FINISH_REASON_COMPLETE A constant which can be used with the finish_reason property of a CohereChatResponseV2.
FINISH_REASON_ERROR A constant which can be used with the finish_reason property of a CohereChatResponseV2.
FINISH_REASON_MAX_TOKENS A constant which can be used with the finish_reason property of a CohereChatResponseV2.
FINISH_REASON_STOP_SEQUENCE A constant which can be used with the finish_reason property of a CohereChatResponseV2.
FINISH_REASON_TOOL_CALL A constant which can be used with the finish_reason property of a CohereChatResponseV2.
api_format [Required] Gets the api_format of this BaseChatResponse.
error_message Gets the error_message of this CohereChatResponseV2.
finish_reason [Required] Gets the finish_reason of this CohereChatResponseV2.
id [Required] Gets the id of this CohereChatResponseV2.
log_probabilities Gets the log_probabilities of this CohereChatResponseV2.
message [Required] Gets the message of this CohereChatResponseV2.
usage Gets the usage of this CohereChatResponseV2.

Methods

__init__(**kwargs) Initializes a new CohereChatResponseV2 object with values from keyword arguments.
get_subtype(object_dictionary) Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
API_FORMAT_COHERE = 'COHERE'
API_FORMAT_COHEREV2 = 'COHEREV2'
API_FORMAT_GENERIC = 'GENERIC'
FINISH_REASON_COMPLETE = 'COMPLETE'

A constant which can be used with the finish_reason property of a CohereChatResponseV2. This constant has a value of “COMPLETE”

FINISH_REASON_ERROR = 'ERROR'

A constant which can be used with the finish_reason property of a CohereChatResponseV2. This constant has a value of “ERROR”

FINISH_REASON_MAX_TOKENS = 'MAX_TOKENS'

A constant which can be used with the finish_reason property of a CohereChatResponseV2. This constant has a value of “MAX_TOKENS”

FINISH_REASON_STOP_SEQUENCE = 'STOP_SEQUENCE'

A constant which can be used with the finish_reason property of a CohereChatResponseV2. This constant has a value of “STOP_SEQUENCE”

FINISH_REASON_TOOL_CALL = 'TOOL_CALL'

A constant which can be used with the finish_reason property of a CohereChatResponseV2. This constant has a value of “TOOL_CALL”

__init__(**kwargs)

Initializes a new CohereChatResponseV2 object with values from keyword arguments. The default value of the api_format attribute of this class is COHEREV2 and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • api_format (str) – The value to assign to the api_format property of this CohereChatResponseV2. Allowed values for this property are: “COHERE”, “GENERIC”, “COHEREV2”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • id (str) – The value to assign to the id property of this CohereChatResponseV2.
  • message (oci.generative_ai_inference.models.CohereAssistantMessageV2) – The value to assign to the message property of this CohereChatResponseV2.
  • finish_reason (str) – The value to assign to the finish_reason property of this CohereChatResponseV2. Allowed values for this property are: “COMPLETE”, “STOP_SEQUENCE”, “MAX_TOKENS”, “TOOL_CALL”, “ERROR”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • log_probabilities (list[oci.generative_ai_inference.models.LogProbability]) – The value to assign to the log_probabilities property of this CohereChatResponseV2.
  • error_message (str) – The value to assign to the error_message property of this CohereChatResponseV2.
  • usage (oci.generative_ai_inference.models.Usage) – The value to assign to the usage property of this CohereChatResponseV2.
api_format

[Required] Gets the api_format of this BaseChatResponse. The API format for the model’s response.

Allowed values for this property are: “COHERE”, “GENERIC”, “COHEREV2”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The api_format of this BaseChatResponse.
Return type:str
error_message

Gets the error_message of this CohereChatResponseV2. If there is an error during the streaming scenario, then the errorMessage parameter contains details for the error.

Returns:The error_message of this CohereChatResponseV2.
Return type:str
finish_reason

[Required] Gets the finish_reason of this CohereChatResponseV2. Why the generation stopped.

Allowed values for this property are: “COMPLETE”, “STOP_SEQUENCE”, “MAX_TOKENS”, “TOOL_CALL”, “ERROR”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The finish_reason of this CohereChatResponseV2.
Return type:str
static get_subtype(object_dictionary)

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.

id

[Required] Gets the id of this CohereChatResponseV2. Unique identifier for the generated reply

Returns:The id of this CohereChatResponseV2.
Return type:str
log_probabilities

Gets the log_probabilities of this CohereChatResponseV2. The log probabilities of the generated tokens.

Returns:The log_probabilities of this CohereChatResponseV2.
Return type:list[oci.generative_ai_inference.models.LogProbability]
message

[Required] Gets the message of this CohereChatResponseV2.

Returns:The message of this CohereChatResponseV2.
Return type:oci.generative_ai_inference.models.CohereAssistantMessageV2
usage

Gets the usage of this CohereChatResponseV2.

Returns:The usage of this CohereChatResponseV2.
Return type:oci.generative_ai_inference.models.Usage