EmbedTextDetails

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

Bases: object

Details for the request to embed texts.

Attributes

EMBEDDING_TYPES_BASE64 A constant which can be used with the embedding_types property of a EmbedTextDetails.
EMBEDDING_TYPES_BINARY A constant which can be used with the embedding_types property of a EmbedTextDetails.
EMBEDDING_TYPES_FLOAT A constant which can be used with the embedding_types property of a EmbedTextDetails.
EMBEDDING_TYPES_INT8 A constant which can be used with the embedding_types property of a EmbedTextDetails.
EMBEDDING_TYPES_UBINARY A constant which can be used with the embedding_types property of a EmbedTextDetails.
EMBEDDING_TYPES_UINT8 A constant which can be used with the embedding_types property of a EmbedTextDetails.
INPUT_TYPE_CLASSIFICATION A constant which can be used with the input_type property of a EmbedTextDetails.
INPUT_TYPE_CLUSTERING A constant which can be used with the input_type property of a EmbedTextDetails.
INPUT_TYPE_IMAGE A constant which can be used with the input_type property of a EmbedTextDetails.
INPUT_TYPE_SEARCH_DOCUMENT A constant which can be used with the input_type property of a EmbedTextDetails.
INPUT_TYPE_SEARCH_QUERY A constant which can be used with the input_type property of a EmbedTextDetails.
TRUNCATE_END A constant which can be used with the truncate property of a EmbedTextDetails.
TRUNCATE_NONE A constant which can be used with the truncate property of a EmbedTextDetails.
TRUNCATE_START A constant which can be used with the truncate property of a EmbedTextDetails.
compartment_id [Required] Gets the compartment_id of this EmbedTextDetails.
embedding_types Gets the embedding_types of this EmbedTextDetails.
input_type Gets the input_type of this EmbedTextDetails.
inputs [Required] Gets the inputs of this EmbedTextDetails.
is_echo Gets the is_echo of this EmbedTextDetails.
output_dimensions Gets the output_dimensions of this EmbedTextDetails.
serving_mode [Required] Gets the serving_mode of this EmbedTextDetails.
truncate Gets the truncate of this EmbedTextDetails.

Methods

__init__(**kwargs) Initializes a new EmbedTextDetails object with values from keyword arguments.
EMBEDDING_TYPES_BASE64 = 'base64'

A constant which can be used with the embedding_types property of a EmbedTextDetails. This constant has a value of “base64”

EMBEDDING_TYPES_BINARY = 'binary'

A constant which can be used with the embedding_types property of a EmbedTextDetails. This constant has a value of “binary”

EMBEDDING_TYPES_FLOAT = 'float'

A constant which can be used with the embedding_types property of a EmbedTextDetails. This constant has a value of “float”

EMBEDDING_TYPES_INT8 = 'int8'

A constant which can be used with the embedding_types property of a EmbedTextDetails. This constant has a value of “int8”

EMBEDDING_TYPES_UBINARY = 'ubinary'

A constant which can be used with the embedding_types property of a EmbedTextDetails. This constant has a value of “ubinary”

EMBEDDING_TYPES_UINT8 = 'uint8'

A constant which can be used with the embedding_types property of a EmbedTextDetails. This constant has a value of “uint8”

INPUT_TYPE_CLASSIFICATION = 'CLASSIFICATION'

A constant which can be used with the input_type property of a EmbedTextDetails. This constant has a value of “CLASSIFICATION”

INPUT_TYPE_CLUSTERING = 'CLUSTERING'

A constant which can be used with the input_type property of a EmbedTextDetails. This constant has a value of “CLUSTERING”

INPUT_TYPE_IMAGE = 'IMAGE'

A constant which can be used with the input_type property of a EmbedTextDetails. This constant has a value of “IMAGE”

INPUT_TYPE_SEARCH_DOCUMENT = 'SEARCH_DOCUMENT'

A constant which can be used with the input_type property of a EmbedTextDetails. This constant has a value of “SEARCH_DOCUMENT”

INPUT_TYPE_SEARCH_QUERY = 'SEARCH_QUERY'

A constant which can be used with the input_type property of a EmbedTextDetails. This constant has a value of “SEARCH_QUERY”

TRUNCATE_END = 'END'

A constant which can be used with the truncate property of a EmbedTextDetails. This constant has a value of “END”

TRUNCATE_NONE = 'NONE'

A constant which can be used with the truncate property of a EmbedTextDetails. This constant has a value of “NONE”

TRUNCATE_START = 'START'

A constant which can be used with the truncate property of a EmbedTextDetails. This constant has a value of “START”

__init__(**kwargs)

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

Parameters:
  • inputs (list[str]) – The value to assign to the inputs property of this EmbedTextDetails.
  • serving_mode (oci.generative_ai_inference.models.ServingMode) – The value to assign to the serving_mode property of this EmbedTextDetails.
  • compartment_id (str) – The value to assign to the compartment_id property of this EmbedTextDetails.
  • is_echo (bool) – The value to assign to the is_echo property of this EmbedTextDetails.
  • embedding_types (list[str]) – The value to assign to the embedding_types property of this EmbedTextDetails. Allowed values for items in this list are: “float”, “int8”, “uint8”, “binary”, “ubinary”, “base64”
  • output_dimensions (int) – The value to assign to the output_dimensions property of this EmbedTextDetails.
  • truncate (str) – The value to assign to the truncate property of this EmbedTextDetails. Allowed values for this property are: “NONE”, “START”, “END”
  • input_type (str) – The value to assign to the input_type property of this EmbedTextDetails. Allowed values for this property are: “SEARCH_DOCUMENT”, “SEARCH_QUERY”, “CLASSIFICATION”, “CLUSTERING”, “IMAGE”
compartment_id

[Required] Gets the compartment_id of this EmbedTextDetails. The OCID of compartment in which to call the Generative AI service to create text embeddings.

Returns:The compartment_id of this EmbedTextDetails.
Return type:str
embedding_types

Gets the embedding_types of this EmbedTextDetails. Specifies the types of embeddings you want to get back. Supports list of enums. Supported values :float, int8, uint8, binary, ubinary, base64. If nothing is passed default will be considered as float.

Allowed values for items in this list are: “float”, “int8”, “uint8”, “binary”, “ubinary”, “base64”

Returns:The embedding_types of this EmbedTextDetails.
Return type:list[str]
input_type

Gets the input_type of this EmbedTextDetails. Specifies the input type.

Allowed values for this property are: “SEARCH_DOCUMENT”, “SEARCH_QUERY”, “CLASSIFICATION”, “CLUSTERING”, “IMAGE”

Returns:The input_type of this EmbedTextDetails.
Return type:str
inputs

[Required] Gets the inputs of this EmbedTextDetails. Provide a list of strings or one base64 encoded image with input_type setting to IMAGE. If text embedding, each string can be words, a phrase, or a paragraph. The maximum length of each string entry in the list is 512 tokens.

Returns:The inputs of this EmbedTextDetails.
Return type:list[str]
is_echo

Gets the is_echo of this EmbedTextDetails. Whether or not to include the original inputs in the response. Results are index-based.

Returns:The is_echo of this EmbedTextDetails.
Return type:bool
output_dimensions

Gets the output_dimensions of this EmbedTextDetails. The number of dimensions of the output embedding. This is only available for embed-v4 and newer models. Possible values are 256, 512, 1024, and 1536.

Returns:The output_dimensions of this EmbedTextDetails.
Return type:int
serving_mode

[Required] Gets the serving_mode of this EmbedTextDetails.

Returns:The serving_mode of this EmbedTextDetails.
Return type:oci.generative_ai_inference.models.ServingMode
truncate

Gets the truncate of this EmbedTextDetails. For an input that’s longer than the maximum token length, specifies which part of the input text will be truncated.

Allowed values for this property are: “NONE”, “START”, “END”

Returns:The truncate of this EmbedTextDetails.
Return type:str