Parameters for text embedding requests.

interface EmbeddingParameters {
    return_options?: WatsonXAI.EmbeddingReturnOptions;
    truncate_input_tokens?: number;
}

Properties

The return options for text embeddings.

truncate_input_tokens?: number

Represents the maximum number of input tokens accepted. This can be used to avoid requests failing due to input being longer than configured limits. If the text is truncated, then it truncates the start of the input (on the left), so the end of the input will remain the same. If this value exceeds the maximum sequence length (refer to the documentation to find this value for the model) then the call will fail if the total number of tokens exceeds the maximum sequence length. Zero means don't truncate.