SummarizerContext Class
Wordize.AI.SummarizerContext class. Document summarization context.
SummarizerContext class
Document summarization context.
public class SummarizerContext : ProcessorContext
Constructors
Name | Description |
---|---|
SummarizerContext(AiModel) |
Properties
Name | Description |
---|---|
FontSettings { get; set; } | Allows to specify document font settings. |
LayoutOptions { get; } | Document layout options used by the processor. |
SummarizeOptions { get; } | Set of options used when summarizing a document with AI. |
WarningCallback { get; set; } | Warning callback used by the processor. |
Examples
Shows how to create custom OpenAiModel and perform document summarization using Fluent API.
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);
SummarizerContext context = new SummarizerContext(model);
context.SummarizeOptions.SummaryLength = SummaryLength.VeryShort;
Summarizer.Create(context)
.From(MyDir + "SimpleAI.docx")
.To(ArtifactsDir + "Summarize.docx")
.Execute();
See Also
- class ProcessorContext
- namespace Wordize.AI
- assembly Wordize