Skip to content

Translation

Shows how to translate text between languages via EdenAI.

This example assumes using EdenAI; is in scope and apiKey contains your EdenAI API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using var client = new EdenAIClient(apiKey);

// Translate text using the EdenAI unified API.
// Multiple providers are supported including Google, Amazon, Microsoft, and DeepL.
var response = await client.AutomaticTranslation
    .TranslationTranslationAutomaticTranslationCreateAsync(
        request: new TranslationautomaticTranslationAutomaticTranslationRequest
        {
            Providers = ["google"],
            Text = "Hello, how are you?",
            TargetLanguage = "fr",
        });