import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as SarvamAI from "../../../index.js"; export declare namespace TextClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class TextClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: TextClient.Options); /** * **Translation** converts text from one language to another while preserving its meaning. * For Example: **'मैं ऑफिस जा रहा हूँ'** translates to **'I am going to the office'** in English, where the script and language change, but the original meaning remains the same. * * Available languages: * - **`bn-IN`**: Bengali * - **`en-IN`**: English * - **`gu-IN`**: Gujarati * - **`hi-IN`**: Hindi * - **`kn-IN`**: Kannada * - **`ml-IN`**: Malayalam * - **`mr-IN`**: Marathi * - **`od-IN`**: Odia * - **`pa-IN`**: Punjabi * - **`ta-IN`**: Tamil * - **`te-IN`**: Telugu * * ### Newly added languages: * - **`as-IN`**: Assamese * - **`brx-IN`**: Bodo * - **`doi-IN`**: Dogri * - **`kok-IN`**: Konkani * - **`ks-IN`**: Kashmiri * - **`mai-IN`**: Maithili * - **`mni-IN`**: Manipuri (Meiteilon) * - **`ne-IN`**: Nepali * - **`sa-IN`**: Sanskrit * - **`sat-IN`**: Santali * - **`sd-IN`**: Sindhi * - **`ur-IN`**: Urdu * * For hands-on practice, you can explore the notebook tutorial on [Translate API Tutorial](https://github.com/sarvamai/sarvam-ai-cookbook/blob/main/notebooks/translate/Translate_API_Tutorial.ipynb). * * @param {SarvamAI.TranslationRequest} request * @param {TextClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link SarvamAI.BadRequestError} * @throws {@link SarvamAI.ForbiddenError} * @throws {@link SarvamAI.UnprocessableEntityError} * @throws {@link SarvamAI.TooManyRequestsError} * @throws {@link SarvamAI.InternalServerError} * * @example * await client.text.translate({ * input: "input", * source_language_code: "auto", * target_language_code: "bn-IN" * }) */ translate(request: SarvamAI.TranslationRequest, requestOptions?: TextClient.RequestOptions): core.HttpResponsePromise; private __translate; /** * Identifies the language (e.g., en-IN, hi-IN) and script (e.g., Latin, Devanagari) of the input text, supporting multiple languages. * * @param {SarvamAI.LanguageIdentificationRequest} request * @param {TextClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link SarvamAI.BadRequestError} * @throws {@link SarvamAI.ForbiddenError} * @throws {@link SarvamAI.UnprocessableEntityError} * @throws {@link SarvamAI.TooManyRequestsError} * @throws {@link SarvamAI.InternalServerError} * * @example * await client.text.identifyLanguage({ * input: "input" * }) */ identifyLanguage(request: SarvamAI.LanguageIdentificationRequest, requestOptions?: TextClient.RequestOptions): core.HttpResponsePromise; private __identifyLanguage; /** * **Transliteration** converts text from one script to another while preserving the original pronunciation. For example, **'नमस्ते'** becomes **'namaste'** in English, and **'how are you'** can be written as **'हाउ आर यू'** in Devanagari. This process ensures that the sound of the original text remains intact, even when written in a different script. * * Transliteration is useful when you want to represent words phonetically across different writing systems, such as converting **'मैं ऑफिस जा रहा हूँ'** to **'main office ja raha hun'** in English letters. * * **Translation**, on the other hand, converts text from one language to another while preserving the meaning rather than pronunciation. For example, **'मैं ऑफिस जा रहा हूँ'** translates to **'I am going to the office'** in English, changing both the script and the language while conveying the intended message. * ### Examples of **Transliteration**: * - **'Good morning'** becomes **'गुड मॉर्निंग'** in Hindi, where the pronunciation is preserved but the meaning is not translated. * - **'सुप्रभात'** becomes **'suprabhat'** in English. * * Available languages: * - **`en-IN`**: English * - **`hi-IN`**: Hindi * - **`bn-IN`**: Bengali * - **`gu-IN`**: Gujarati * - **`kn-IN`**: Kannada * - **`ml-IN`**: Malayalam * - **`mr-IN`**: Marathi * - **`od-IN`**: Odia * - **`pa-IN`**: Punjabi * - **`ta-IN`**: Tamil * - **`te-IN`**: Telugu * * For hands-on practice, you can explore the notebook tutorial on [Transliterate API Tutorial](https://github.com/sarvamai/sarvam-ai-cookbook/blob/main/notebooks/transliterate/Transliterate_API_Tutorial.ipynb). * * @param {SarvamAI.TransliterationRequest} request * @param {TextClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link SarvamAI.BadRequestError} * @throws {@link SarvamAI.ForbiddenError} * @throws {@link SarvamAI.UnprocessableEntityError} * @throws {@link SarvamAI.TooManyRequestsError} * @throws {@link SarvamAI.InternalServerError} * * @example * await client.text.transliterate({ * input: "input", * source_language_code: "auto", * target_language_code: "bn-IN" * }) */ transliterate(request: SarvamAI.TransliterationRequest, requestOptions?: TextClient.RequestOptions): core.HttpResponsePromise; private __transliterate; }