We are happy to announce the new monthly 25.4 version of Wordize is published.
Issue | Description |
---|---|
WRDZNET-61 | Wrap exception in fluent API. |
WRDZNET-62 | HarfBuzz worked only with Fluent API |
WRDZNET-39 | Provide Wordize.AI module. |
What’s new
Provided Wordize.AI module
Wordize includes the Wordize.AI
module — a powerful extension that brings advanced AI capabilities into your document workflows.
It enables operations such as summarization, grammar checking, and translation by leveraging cutting-edge models from Anthropic, Google, and OpenAI.
To use these features, the module must be connected to the respective API(s) via your own API credentials.
Configuring AI Model
Wordize.AI
module cab be connected to Anthropic, Google, and OpenAI, just use the appropriate AiModel
class and specify AiModelType
.
- Anthropic AI Model:
AiModel model = AnthropicAiModel.Create(AiModelType.Claude35Haiku, "<your_api_key>");
- Google AI Model:
AiModel model = GoogleAiModel.Create(AiModelType.Gemini15Flash, "<your_api_key>");
- OpenAI Model:
AiModel model = OpenAiModel.Create(AiModelType.Gpt4OMini, "<your_api_key>").WithOrganization("<organization>").WithProject("<project>");
In addition to standard models, you can use an LLM deployed on your own server. Simply select the appropriate AiModel
class and specify the Url
, Name
, and ApiKey
.
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Document Translation
To translate a document, simply specify the input and output files, configure the AI model, and set the target language.
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Translator.Translate("in.docx", "out.docx", model, Language.Ukrainian);
If you need to render the translation result as images, you can use the TranslateToImages
method:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Stream[] pages = Translator.TranslateToImages("in.docx", new ImageSaveOptions(SaveFormat.Png), model, Language.Ukrainian);
Document translation using the Fluent API is convenient when you need to save the output in multiple file formats:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
TranslatorContext context = new TranslatorContext(model) { Language = Language.Ukrainian };
Translator.Create(context)
.From("in.docx")
.To("out.docx")
.To("out.pdf")
.To("out.xps")
.Execute();
Document Summarization
Pass your input document or multiple documents into the Summarizer
to generate a summary that provides a concise representation of the content.
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Summarizer.Summarize("in.docx", "out.docx", model, new SummarizeOptions() { SummaryLength = SummaryLength.VeryShort });
Render the summary to images using SummarizeToImages
method:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Stream[] pages = Summarizer.SummarizeToImages("in.docx", new ImageSaveOptions(SaveFormat.Png), model);
Conveniently specify multiple input documents for summarization and save the output in all required document formats with a single call using Fluent API:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
SummarizerContext context = new SummarizerContext(model);
context.SummarizeOptions.SummaryLength = SummaryLength.Long;
Summarizer.Create(context)
.From("in1.docx")
.From("in2.docx")
.To("summary.docx")
.To("summary.pdf")
.To("summary.html")
.Execute();
Checking Grammar
Use the GrammarChecker
to correct spelling, fix grammatical errors and typos, enhance stylistic quality, and optionally track changes using revisions for later review.
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
GrammarChecker.CheckGrammar("in.docx", "out.docx", model);
Mark corrections with revisions:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
GrammarChecker.CheckGrammar("in.docx", "out.docx", model, new CheckGrammarOptions() { MakeRevisions = true });
Render the checked result to images using CheckGrammarToImages
method:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Stream[] pages = GrammarChecker.CheckGrammarToImages("in.docx", new ImageSaveOptions(SaveFormat.Png), model, new CheckGrammarOptions() { ImproveStylistics = true });
Checking grammar with Fluent API:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
GrammarCheckerContext context = new GrammarCheckerContext(model);
context.CheckGrammarOptions.MakeRevisions = true;
GrammarChecker.Create(context)
.From("in.docx")
.To("out.docx")
.Execute();