Translator.TranslateToImages
Translator TranslateToImages method. Translates the provided document into the specified target language. This operation leverages the connected AI model for content translating.
TranslateToImages(string, ImageSaveOptions, AiModel, Language)
Translates the provided document into the specified target language. This operation leverages the connected AI model for content translating.
public static Stream[] TranslateToImages(string inputFile, ImageSaveOptions saveOptions,
AiModel model, Language language)
Parameter | Type | Description |
---|---|---|
inputFile | String | The input file name. |
saveOptions | ImageSaveOptions | Image save options. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
language | Language | The target language for AI-powered text translation. |
Return Value
Returns array of image streams. The streams should be disposed by the end user.
Examples
Demonstrates how to translate a document and save the result as an array of image streams.
string apiUrl = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_URL", EnvironmentVariableTarget.User);
string apiName = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_NAME", EnvironmentVariableTarget.User);
string apiKey = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_KEY", EnvironmentVariableTarget.User);
AiModel model = OpenAiModel.Create(apiUrl, apiName, apiKey);
Stream[] pages = Translator.TranslateToImages(MyDir + "SimpleAI.docx", new ImageSaveOptions(SaveFormat.Png), model, Language.Ukrainian);
See Also
- class ImageSaveOptions
- class AiModel
- enum Language
- class Translator
- namespace Wordize.AI
- assembly Wordize
TranslateToImages(Stream, ImageSaveOptions, AiModel, Language)
Translates the provided document into the specified target language. This operation leverages the connected AI model for content translating.
public static Stream[] TranslateToImages(Stream inputStream, ImageSaveOptions saveOptions,
AiModel model, Language language)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
saveOptions | ImageSaveOptions | Image save options. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
language | Language | The target language for AI-powered text translation. |
Return Value
Returns array of image streams. The streams should be disposed by the end user.
See Also
- class ImageSaveOptions
- class AiModel
- enum Language
- class Translator
- namespace Wordize.AI
- assembly Wordize