File manager - Edit - /usr/lib/mysqlsh/lib/python3.9/site-packages/oci/generative_ai_inference/models/embed_text_details.py
Back
# coding: utf-8 # Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. # NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130 from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 from oci.decorators import init_model_state_from_kwargs @init_model_state_from_kwargs class EmbedTextDetails(object): """ Details for the request to embed texts. """ #: A constant which can be used with the embedding_types property of a EmbedTextDetails. #: This constant has a value of "float" EMBEDDING_TYPES_FLOAT = "float" #: A constant which can be used with the embedding_types property of a EmbedTextDetails. #: This constant has a value of "int8" EMBEDDING_TYPES_INT8 = "int8" #: A constant which can be used with the embedding_types property of a EmbedTextDetails. #: This constant has a value of "uint8" EMBEDDING_TYPES_UINT8 = "uint8" #: A constant which can be used with the embedding_types property of a EmbedTextDetails. #: This constant has a value of "binary" EMBEDDING_TYPES_BINARY = "binary" #: A constant which can be used with the embedding_types property of a EmbedTextDetails. #: This constant has a value of "ubinary" EMBEDDING_TYPES_UBINARY = "ubinary" #: A constant which can be used with the embedding_types property of a EmbedTextDetails. #: This constant has a value of "base64" EMBEDDING_TYPES_BASE64 = "base64" #: A constant which can be used with the truncate property of a EmbedTextDetails. #: This constant has a value of "NONE" TRUNCATE_NONE = "NONE" #: A constant which can be used with the truncate property of a EmbedTextDetails. #: This constant has a value of "START" TRUNCATE_START = "START" #: A constant which can be used with the truncate property of a EmbedTextDetails. #: This constant has a value of "END" TRUNCATE_END = "END" #: 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_DOCUMENT = "SEARCH_DOCUMENT" #: A constant which can be used with the input_type property of a EmbedTextDetails. #: This constant has a value of "SEARCH_QUERY" 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 "CLASSIFICATION" INPUT_TYPE_CLASSIFICATION = "CLASSIFICATION" #: A constant which can be used with the input_type property of a EmbedTextDetails. #: This constant has a value of "CLUSTERING" INPUT_TYPE_CLUSTERING = "CLUSTERING" #: A constant which can be used with the input_type property of a EmbedTextDetails. #: This constant has a value of "IMAGE" INPUT_TYPE_IMAGE = "IMAGE" def __init__(self, **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): :param inputs: The value to assign to the inputs property of this EmbedTextDetails. :type inputs: list[str] :param serving_mode: The value to assign to the serving_mode property of this EmbedTextDetails. :type serving_mode: oci.generative_ai_inference.models.ServingMode :param compartment_id: The value to assign to the compartment_id property of this EmbedTextDetails. :type compartment_id: str :param is_echo: The value to assign to the is_echo property of this EmbedTextDetails. :type is_echo: bool :param embedding_types: 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" :type embedding_types: list[str] :param output_dimensions: The value to assign to the output_dimensions property of this EmbedTextDetails. :type output_dimensions: int :param truncate: The value to assign to the truncate property of this EmbedTextDetails. Allowed values for this property are: "NONE", "START", "END" :type truncate: str :param input_type: 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" :type input_type: str """ self.swagger_types = { 'inputs': 'list[str]', 'serving_mode': 'ServingMode', 'compartment_id': 'str', 'is_echo': 'bool', 'embedding_types': 'list[str]', 'output_dimensions': 'int', 'truncate': 'str', 'input_type': 'str' } self.attribute_map = { 'inputs': 'inputs', 'serving_mode': 'servingMode', 'compartment_id': 'compartmentId', 'is_echo': 'isEcho', 'embedding_types': 'embeddingTypes', 'output_dimensions': 'outputDimensions', 'truncate': 'truncate', 'input_type': 'inputType' } self._inputs = None self._serving_mode = None self._compartment_id = None self._is_echo = None self._embedding_types = None self._output_dimensions = None self._truncate = None self._input_type = None @property def inputs(self): """ **[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. :return: The inputs of this EmbedTextDetails. :rtype: list[str] """ return self._inputs @inputs.setter def inputs(self, inputs): """ Sets 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. :param inputs: The inputs of this EmbedTextDetails. :type: list[str] """ self._inputs = inputs @property def serving_mode(self): """ **[Required]** Gets the serving_mode of this EmbedTextDetails. :return: The serving_mode of this EmbedTextDetails. :rtype: oci.generative_ai_inference.models.ServingMode """ return self._serving_mode @serving_mode.setter def serving_mode(self, serving_mode): """ Sets the serving_mode of this EmbedTextDetails. :param serving_mode: The serving_mode of this EmbedTextDetails. :type: oci.generative_ai_inference.models.ServingMode """ self._serving_mode = serving_mode @property def compartment_id(self): """ **[Required]** Gets the compartment_id of this EmbedTextDetails. The OCID of compartment in which to call the Generative AI service to create text embeddings. :return: The compartment_id of this EmbedTextDetails. :rtype: str """ return self._compartment_id @compartment_id.setter def compartment_id(self, compartment_id): """ Sets the compartment_id of this EmbedTextDetails. The OCID of compartment in which to call the Generative AI service to create text embeddings. :param compartment_id: The compartment_id of this EmbedTextDetails. :type: str """ self._compartment_id = compartment_id @property def is_echo(self): """ Gets the is_echo of this EmbedTextDetails. Whether or not to include the original inputs in the response. Results are index-based. :return: The is_echo of this EmbedTextDetails. :rtype: bool """ return self._is_echo @is_echo.setter def is_echo(self, is_echo): """ Sets the is_echo of this EmbedTextDetails. Whether or not to include the original inputs in the response. Results are index-based. :param is_echo: The is_echo of this EmbedTextDetails. :type: bool """ self._is_echo = is_echo @property def embedding_types(self): """ 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" :return: The embedding_types of this EmbedTextDetails. :rtype: list[str] """ return self._embedding_types @embedding_types.setter def embedding_types(self, embedding_types): """ Sets 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. :param embedding_types: The embedding_types of this EmbedTextDetails. :type: list[str] """ allowed_values = ["float", "int8", "uint8", "binary", "ubinary", "base64"] if embedding_types and embedding_types is not NONE_SENTINEL: for value in embedding_types: if not value_allowed_none_or_none_sentinel(value, allowed_values): raise ValueError( f"Invalid value for `embedding_types`, must be None or one of {allowed_values}" ) self._embedding_types = embedding_types @property def output_dimensions(self): """ 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. :return: The output_dimensions of this EmbedTextDetails. :rtype: int """ return self._output_dimensions @output_dimensions.setter def output_dimensions(self, output_dimensions): """ Sets 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. :param output_dimensions: The output_dimensions of this EmbedTextDetails. :type: int """ self._output_dimensions = output_dimensions @property def truncate(self): """ 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" :return: The truncate of this EmbedTextDetails. :rtype: str """ return self._truncate @truncate.setter def truncate(self, truncate): """ Sets 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. :param truncate: The truncate of this EmbedTextDetails. :type: str """ allowed_values = ["NONE", "START", "END"] if not value_allowed_none_or_none_sentinel(truncate, allowed_values): raise ValueError( f"Invalid value for `truncate`, must be None or one of {allowed_values}" ) self._truncate = truncate @property def input_type(self): """ Gets the input_type of this EmbedTextDetails. Specifies the input type. Allowed values for this property are: "SEARCH_DOCUMENT", "SEARCH_QUERY", "CLASSIFICATION", "CLUSTERING", "IMAGE" :return: The input_type of this EmbedTextDetails. :rtype: str """ return self._input_type @input_type.setter def input_type(self, input_type): """ Sets the input_type of this EmbedTextDetails. Specifies the input type. :param input_type: The input_type of this EmbedTextDetails. :type: str """ allowed_values = ["SEARCH_DOCUMENT", "SEARCH_QUERY", "CLASSIFICATION", "CLUSTERING", "IMAGE"] if not value_allowed_none_or_none_sentinel(input_type, allowed_values): raise ValueError( f"Invalid value for `input_type`, must be None or one of {allowed_values}" ) self._input_type = input_type def __repr__(self): return formatted_flat_dict(self) def __eq__(self, other): if other is None: return False return self.__dict__ == other.__dict__ def __ne__(self, other): return not self == other
| ver. 1.4 |
Github
|
.
| PHP 8.2.32 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings