Interface Translate

Translate represents an object that contains the result for the translate call.

interface Translate {
    best_score: number;
    best_translation: string;
    best_translation_model: string;
    created: number;
    id: string;
    object: string;
    translations: Translation[];
    createdDate(): Date;
}

Properties

best_score: number

best_score represents the best score for the best translation.

best_translation: string

best_translation represents the best translation of the input text.

best_translation_model: string

best_translation_model represents the model used for the best translation.

created: number

created represents the unix timestamp for when the request was received.

id: string

id represents a unique identifier for the result.

object: string

object represent the type of the result document.

translations: Translation[]

translations represents the collection of translations to choose from.

Methods

  • createdDate converts the created unix timestamp into a JS Date.

    Returns Date