CohereChatResponse

class oci.generative_ai_inference.models.CohereChatResponse(**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_GENERIC str(object=’’) -> str
FINISH_REASON_COMPLETE A constant which can be used with the finish_reason property of a CohereChatResponse.
FINISH_REASON_ERROR A constant which can be used with the finish_reason property of a CohereChatResponse.
FINISH_REASON_ERROR_LIMIT A constant which can be used with the finish_reason property of a CohereChatResponse.
FINISH_REASON_ERROR_TOXIC A constant which can be used with the finish_reason property of a CohereChatResponse.
FINISH_REASON_MAX_TOKENS A constant which can be used with the finish_reason property of a CohereChatResponse.
FINISH_REASON_USER_CANCEL A constant which can be used with the finish_reason property of a CohereChatResponse.
api_format [Required] Gets the api_format of this BaseChatResponse.
citations Gets the citations of this CohereChatResponse.
documents Gets the documents of this CohereChatResponse.
finish_reason [Required] Gets the finish_reason of this CohereChatResponse.
is_search_required Gets the is_search_required of this CohereChatResponse.
search_queries Gets the search_queries of this CohereChatResponse.
text [Required] Gets the text of this CohereChatResponse.

Methods

__init__(**kwargs) Initializes a new CohereChatResponse 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_GENERIC = 'GENERIC'
FINISH_REASON_COMPLETE = 'COMPLETE'

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

FINISH_REASON_ERROR = 'ERROR'

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

FINISH_REASON_ERROR_LIMIT = 'ERROR_LIMIT'

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

FINISH_REASON_ERROR_TOXIC = 'ERROR_TOXIC'

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

FINISH_REASON_MAX_TOKENS = 'MAX_TOKENS'

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

FINISH_REASON_USER_CANCEL = 'USER_CANCEL'

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

__init__(**kwargs)

Initializes a new CohereChatResponse object with values from keyword arguments. The default value of the api_format attribute of this class is COHERE 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 CohereChatResponse. Allowed values for this property are: “COHERE”, “GENERIC”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • text (str) – The value to assign to the text property of this CohereChatResponse.
  • citations (list[oci.generative_ai_inference.models.Citation]) – The value to assign to the citations property of this CohereChatResponse.
  • is_search_required (bool) – The value to assign to the is_search_required property of this CohereChatResponse.
  • finish_reason (str) – The value to assign to the finish_reason property of this CohereChatResponse. Allowed values for this property are: “COMPLETE”, “ERROR_TOXIC”, “ERROR_LIMIT”, “ERROR”, “USER_CANCEL”, “MAX_TOKENS”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • search_queries (list[oci.generative_ai_inference.models.SearchQuery]) – The value to assign to the search_queries property of this CohereChatResponse.
  • documents (list[object]) – The value to assign to the documents property of this CohereChatResponse.
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”, ‘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
citations

Gets the citations of this CohereChatResponse. Inline citations for the generated reply.

Returns:The citations of this CohereChatResponse.
Return type:list[oci.generative_ai_inference.models.Citation]
documents

Gets the documents of this CohereChatResponse. Documents seen by the model when generating the reply. Each document is a JSON String representing the field and values of the document.

Returns:The documents of this CohereChatResponse.
Return type:list[object]
finish_reason

[Required] Gets the finish_reason of this CohereChatResponse. Why the generation was completed.

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

Returns:The finish_reason of this CohereChatResponse.
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.

is_search_required

Gets the is_search_required of this CohereChatResponse. Denotes that a search for documents is required.

Returns:The is_search_required of this CohereChatResponse.
Return type:bool
search_queries

Gets the search_queries of this CohereChatResponse. Generated search queries.

Returns:The search_queries of this CohereChatResponse.
Return type:list[oci.generative_ai_inference.models.SearchQuery]
text

[Required] Gets the text of this CohereChatResponse. Contents of the reply generated by the model.

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