Table of Contents

Class TranslationProgressEventArgs

Namespace
LMKit.Translation.Events
Assembly
LM-Kit.NET.dll

Provides data for the TranslationProgress event, reporting chunk-level progress during a translation operation.

public sealed class TranslationProgressEventArgs : EventArgs
Inheritance
TranslationProgressEventArgs
Inherited Members

Examples

var translator = new TextTranslation(model);

translator.TranslationProgress += (sender, e) =>
{
    Console.WriteLine($"Chunk {e.ChunkIndex + 1}/{e.TotalChunks} translated");
};

string result = await translator.TranslateAsync(longText, Language.French);

Constructors

TranslationProgressEventArgs(int, int, string)

Initializes a new instance of the TranslationProgressEventArgs class.

Fields

Stop

A flag indicating whether the translation process should be terminated prematurely. Set to true to stop translating remaining chunks.

Properties

ChunkIndex

Gets the zero-based index of the chunk that was just translated.

TotalChunks

Gets the total number of chunks to translate.

TranslatedChunk

Gets the translated text of the current chunk.

Share