Class
BaseSummaryProvider

Base class for summary providers using AI chat clients.

Definition

Namespace:Telerik.Windows.Controls.FixedDocumentViewersUI.AIProviders

Assembly:Telerik.Windows.Controls.FixedDocumentViewersUI.dll

Syntax:

cs-api-definition
[CLSCompliant(false)]
public abstract class BaseSummaryProvider : ISummaryProvider

Inheritance: objectBaseSummaryProvider

Derived Classes: AzureOpenAISummaryProviderLlamaSummaryProviderOpenAISummaryProvider

Implements: ISummaryProvider

Constructors

BaseSummaryProvider()

Declaration

cs-api-definition
protected BaseSummaryProvider()

Properties

ChatClient

Gets or sets the AI chat client used for summarization and question answering.

Declaration

cs-api-definition
public IChatClient ChatClient { get; set; }

Property Value

IChatClient

MaxTokenCount

Gets or sets the maximum number of tokens that can be processed. Default is 128000.

Declaration

cs-api-definition
public int MaxTokenCount { get; set; }

Property Value

int

Model

Gets or sets the model name used by the AI chat client for processing requests.

Declaration

cs-api-definition
public string Model { get; set; }

Property Value

string

PromptAddition

Gets or sets additional instructions to be appended to the prompt for summarization or question answering.

Declaration

cs-api-definition
public string PromptAddition { get; set; }

Property Value

string

Implements ISummaryProvider.PromptAddition

Methods

AskQuestion(string, SimpleTextDocument)

Asks a question about the specified document and returns the AI-generated answer.

Declaration

cs-api-definition
public string AskQuestion(string question, SimpleTextDocument simpleDocument)

Parameters

question

string

The question to ask.

simpleDocument

SimpleTextDocument

The document to use as context for the question.

Returns

string

The answer string generated by the AI model.

Implements ISummaryProvider.AskQuestion(string, SimpleTextDocument)

CreateChatClient()

When implemented in a derived class, creates and initializes the AI chat client.

Declaration

cs-api-definition
protected abstract void CreateChatClient()

GetSummary(SimpleTextDocument)

Generates a summary for the specified document using the AI chat client.

Declaration

cs-api-definition
public string GetSummary(SimpleTextDocument simpleDocument)

Parameters

simpleDocument

SimpleTextDocument

The document to summarize.

Returns

string

A summary string generated by the AI model.

Implements ISummaryProvider.GetSummary(SimpleTextDocument)

OnSummaryResourcesCalculated(object, SummaryResourcesCalculatedEventArgs)

Raises the SummaryResourcesCalculated event.

Declaration

cs-api-definition
protected virtual void OnSummaryResourcesCalculated(object sender, SummaryResourcesCalculatedEventArgs e)

Parameters

sender

object

The event source.

e

SummaryResourcesCalculatedEventArgs

The event data.

SecureStringToString(SecureString)

Returns the actual key.

Declaration

cs-api-definition
protected virtual string SecureStringToString(SecureString secureString)

Parameters

secureString

SecureString

Returns

string

SummarizationProcessor_SummaryResourcesCalculated(object, SummaryResourcesCalculatedEventArgs)

Handles the event when summary resources are calculated, allowing execution to continue. Also raises the SummaryResourcesCalculated event for external subscribers.

Declaration

cs-api-definition
protected virtual void SummarizationProcessor_SummaryResourcesCalculated(object sender, SummaryResourcesCalculatedEventArgs e)

Parameters

sender

object

The event source.

e

SummaryResourcesCalculatedEventArgs

The event data containing summary resource information.

Events

SummaryResourcesCalculated

Occurs when summary resources are calculated during summarization.

Declaration

cs-api-definition
public event EventHandler<SummaryResourcesCalculatedEventArgs> SummaryResourcesCalculated

Event Value

EventHandler<SummaryResourcesCalculatedEventArgs>