Skip to content

ModernMT

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official ModernMT OpenAPI specification using AutoSDK
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • Support .Net Framework/.Net Standard 2.0

Usage

1
2
3
using ModernMT;

using var client = new ModernMTClient(apiKey);

MeaiTools

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
var apiKey =
    Environment.GetEnvironmentVariable("MODERNMT_API_KEY") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("MODERNMT_API_KEY environment variable is not found.");

using var client = new ModernMTClient(apiKey);

// Create AIFunction tools for translation.
var translateTool = client.AsTranslateTool();

var listLanguagesTool = client.AsListLanguagesTool();

var listMemoriesTool = client.AsListMemoriesTool();

var detectLanguageTool = client.AsDetectLanguageTool();

Translation

1
2
3
4
5
6
7
8
var apiKey =
    Environment.GetEnvironmentVariable("MODERNMT_API_KEY") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("MODERNMT_API_KEY environment variable is not found.");

using var client = new ModernMTClient(apiKey);

// The client provides access to translation, memories, and language detection.

Generate

Basic example showing how to create a client and make a request.

1
using var client = new ModernMTClient(apiKey);

Support

Priority place for bugs: https://github.com/tryAGI/ModernMT/issues
Priority place for ideas and general questions: https://github.com/tryAGI/ModernMT/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.