• Translates the provided text into the specified target language.

    Parameters

    • text: string

      The text to be translated.

    • target: string = 'ja'

      The target language code for the translation (defaults to 'ja' for Japanese).

    Returns Promise<string>

    A promise that resolves with the translated string.

    Throws

    Will throw an error if the translation fails.

    Example

    import { translate } from "@skeet-framework/ai"

    const translatedText = await translate("Hello", "es")
    console.log(translatedText); // Outputs: "Hola"

Generated using TypeDoc