Summarizer.SummarizeToImages

Summarizer SummarizeToImages method. Generates summary for the document with options to control the summary length and other settings and renders the result to images.

SummarizeToImages(string, ImageSaveOptionsAiModelSummarizeOptions)

Generates summary for the document, with options to control the summary length and other settings and renders the result to images.

public static Stream[] SummarizeToImages(string inputFile, ImageSaveOptions saveOptions, 
    AiModel model, SummarizeOptions options = null)
ParameterTypeDescription
inputFileStringThe input file name.
saveOptionsImageSaveOptionsImage save options.
modelAiModelSpecifies the AI model responsible for generating the summary of a document.
optionsSummarizeOptionsOptional set of options used when summarizing a document with AI.

Return Value

Returns array of image streams. The streams should be disposed by the end user.

Examples

Demonstrates how to summarize 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 = Summarizer.SummarizeToImages(MyDir + "SimpleAI.docx", new ImageSaveOptions(SaveFormat.Png), model);

See Also


SummarizeToImages(string[], ImageSaveOptionsAiModelSummarizeOptions)

Generates summaries for an array of documents, with options to control the summary length and other settings and renders the result to images. This method utilizes the connected AI model for processing each document in the array.

public static Stream[] SummarizeToImages(string[] inputFiles, ImageSaveOptions saveOptions, 
    AiModel model, SummarizeOptions options = null)
ParameterTypeDescription
inputFilesString[]The input file names.
saveOptionsImageSaveOptionsImage save options.
modelAiModelSpecifies the AI model responsible for generating the summary of a document.
optionsSummarizeOptionsOptional set of options used when summarizing a document with AI.

Return Value

Returns array of image streams. The streams should be disposed by the end user.

See Also


SummarizeToImages(Stream, ImageSaveOptionsAiModelSummarizeOptions)

Generates summary for the document, with options to control the summary length and other settings and renders the result to images.

public static Stream[] SummarizeToImages(Stream inputStream, ImageSaveOptions saveOptions, 
    AiModel model, SummarizeOptions options = null)
ParameterTypeDescription
inputStreamStreamThe input stream.
saveOptionsImageSaveOptionsImage save options.
modelAiModelSpecifies the AI model responsible for generating the summary of a document.
optionsSummarizeOptionsOptional set of options used when summarizing a document with AI.

Return Value

Returns array of image streams. The streams should be disposed by the end user.

See Also


SummarizeToImages(Stream[], ImageSaveOptionsAiModelSummarizeOptions)

Generates summaries for an array of documents, with options to control the summary length and other settings and renders the result to images. This method utilizes the connected AI model for processing each document in the array.

public static Stream[] SummarizeToImages(Stream[] inputStreams, ImageSaveOptions saveOptions, 
    AiModel model, SummarizeOptions options = null)
ParameterTypeDescription
inputStreamsStream[]The input streams.
saveOptionsImageSaveOptionsImage save options.
modelAiModelSpecifies the AI model responsible for generating the summary of a document.
optionsSummarizeOptionsOptional set of options used when summarizing a document with AI.

Return Value

Returns array of image streams. The streams should be disposed by the end user.

See Also