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)

Returns: Task<String>.
Throws:
ArgumentNullException When question is null.
evaluate_expression(expression)

Evaluates a mathematical expression asynchronously.
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.
OnControlCreated(control)

OnControlDisposed(control)

OnReadingReport(e)

Raises the ReadingReport event.
ResetSession(removeMessages)

Resets the conversation history.
removeMessages
Indicates whether all messages from the ChatBox control should also be removed.
RunAsyncCore(control)

Executes the core logic asynchronously for running 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
Represents a provider that supplies tools.
Last updated