RerankTextDetails

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

Bases: object

Details required for a rerank request.

Methods:

__init__(**kwargs)

Initializes a new RerankTextDetails object with values from keyword arguments.

Attributes:

compartment_id

[Required] Gets the compartment_id of this RerankTextDetails.

documents

[Required] Gets the documents of this RerankTextDetails.

input

[Required] Gets the input of this RerankTextDetails.

is_echo

Gets the is_echo of this RerankTextDetails.

max_chunks_per_document

Gets the max_chunks_per_document of this RerankTextDetails.

max_tokens_per_document

Gets the max_tokens_per_document of this RerankTextDetails.

serving_mode

[Required] Gets the serving_mode of this RerankTextDetails.

top_n

Gets the top_n of this RerankTextDetails.

__init__(**kwargs)

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

Parameters
  • input (str) – The value to assign to the input property of this RerankTextDetails.

  • compartment_id (str) – The value to assign to the compartment_id property of this RerankTextDetails.

  • serving_mode (oci.generative_ai_inference.models.ServingMode) – The value to assign to the serving_mode property of this RerankTextDetails.

  • documents (list[str]) – The value to assign to the documents property of this RerankTextDetails.

  • top_n (int) – The value to assign to the top_n property of this RerankTextDetails.

  • is_echo (bool) – The value to assign to the is_echo property of this RerankTextDetails.

  • max_chunks_per_document (int) – The value to assign to the max_chunks_per_document property of this RerankTextDetails.

  • max_tokens_per_document (int) – The value to assign to the max_tokens_per_document property of this RerankTextDetails.

property compartment_id

[Required] Gets the compartment_id of this RerankTextDetails. The OCID of the compartment to call into the Generative AI service LLMs.

Returns

The compartment_id of this RerankTextDetails.

Return type

str

property documents

[Required] Gets the documents of this RerankTextDetails. A list of document strings to rerank based on the query asked.

Returns

The documents of this RerankTextDetails.

Return type

list[str]

property input

[Required] Gets the input of this RerankTextDetails. Input query for search in the documents.

Returns

The input of this RerankTextDetails.

Return type

str

property is_echo

Gets the is_echo of this RerankTextDetails. Whether or not to return the documents in the response.

Returns

The is_echo of this RerankTextDetails.

Return type

bool

property max_chunks_per_document

Gets the max_chunks_per_document of this RerankTextDetails. The maximum number of chunks to produce internally from a document.

Returns

The max_chunks_per_document of this RerankTextDetails.

Return type

int

property max_tokens_per_document

Gets the max_tokens_per_document of this RerankTextDetails. Used to truncate the long documents with the specified no of tokens.

Returns

The max_tokens_per_document of this RerankTextDetails.

Return type

int

property serving_mode

[Required] Gets the serving_mode of this RerankTextDetails.

Returns

The serving_mode of this RerankTextDetails.

Return type

oci.generative_ai_inference.models.ServingMode

property top_n

Gets the top_n of this RerankTextDetails. The number of most relevant documents or indices to return. Defaults to the length of the documents.

Returns

The top_n of this RerankTextDetails.

Return type

int