SmartReportAdapter

Wisej.AI.Adapters.SmartReportAdapter

Namespace: Wisej.AI.Adapters

Assembly: Wisej.AI (3.5.0.0)

Enhances the ChatBox control to allow seamless PDF report queries using an AI provider.

public class SmartReportAdapter : SmartAdapter

Utilizes these services: IDocumentConversionService. The SmartReportAdapter class extends the functionality of a ChatBox to provide capabilities for reading and interpreting reports. It utilizes prompts and sessions to interact with the user and process report data.

Constructors

SmartReportAdapter()

Initializes a new instance of the SmartReportAdapter class.

Properties

AutoReset

Boolean: Gets or sets a value indicating whether the history of the conversation is cleared after each response. (Default: False)

BotAvatar

String: Gets or sets the avatar image source for the bot. (Default: "resource.wx/Wisej.AI/Icons/wisej-avatar.svg")

BotName

String: Gets or sets the name of the bot. (Default: "Wisej.AI")

ChatBox

ChatBox: Gets the ChatBox control associated with this adapter.

ConversionService

IDocumentConversionService: Gets or sets the document conversion service used for converting documents to text.

Prompt

String: Gets or sets the prompt to execute. Used only when the adapter is not connected to a ChatBox. (Default: null)

ReportPdfSource

Stream: Gets or sets the PDF source stream for the report.

User

User: Gets the user associated with the bot.

Methods

AskAsync(question)

Parameter
Type
Description

question

Returns: Task<String>.

Throws:

evaluate_expression(expression)

Evaluates a mathematical expression asynchronously.

Parameter
Type
Description

expression

The mathematical expression to evaluate.

Returns: Task<Object>. A task that represents the asynchronous operation. The task result contains the evaluated result of the expression.

This method uses the browser's evaluation engine to compute the result of the given expression.

OnAnswerReceived(e)

Raises the AnswerReceived event.

Parameter
Type
Description

e

The AnswerReceivedArgs instance containing the event data.

OnControlCreated(control)

Parameter
Type
Description

control

OnControlDisposed(control)

Parameter
Type
Description

control

OnReadingReport(e)

Raises the ReadingReport event.

Parameter
Type
Description

e

The ReadingReportEventArgs instance containing the event data.

ResetSession(removeMessages)

Resets the conversation history.

Parameter
Type
Description

removeMessages

Indicates whether all messages from the ChatBox control should also be removed.

RunAsyncCore(control)

Executes the core logic asynchronously for running the session.

Parameter
Type
Description

control

The control associated with the session.

Returns: Task<Message>. A task representing the asynchronous operation.

Events

AnswerReceived

AnswerReceivedHandler Occurs when an answer is received from the session.

ReadingReport

ReadingReportEventHandler Occurs when a report is being read.

Implements

Name
Description

Represents a provider that supplies tools.

Last updated