Skip to main content

SmartObject

Namespace: Wisej.AI

Assembly: Wisej.AI

Provides common events and properties to SmartPrompt, SmartSession, and SmartHub objects.

public class SmartObject : Component

Properties​

HasTools​

Boolean: Gets a value indicating whether the session has tools.

Parameters​

ParameterCollection: Gets the collection of parameters for the session.

Tools​

ToolCollection: Gets the collection of tools available in the session.

Usage​

Metrics: Gets the usage metrics for the session.

Methods​

ClearTools()​

Clears all tools from the smart prompt.

OnAfterInvokeTool(args)​

Raises the AfterInvokeTool event.

ParameterTypeDescription
argsInvokeToolEventArgsThe InvokeToolEventArgs instance containing the event data.

OnAfterResponseReceived(args)​

Raises the AfterResponseReceived event.

ParameterTypeDescription
argsMessagesEventArgsThe MessagesEventArgs instance containing the event data.

OnBeforeInvokeTool(args)​

Raises the BeforeInvokeTool event.

ParameterTypeDescription
argsInvokeToolEventArgsThe InvokeToolEventArgs instance containing the event data.

OnBeforeSendRequest(args)​

Raises the BeforeSendRequest event.

ParameterTypeDescription
argsMessagesEventArgsThe MessagesEventArgs instance containing the event data.

OnConvertParameter(args)​

Raises the ConvertParameter event.

ParameterTypeDescription
argsConvertParameterEventArgsThe ConvertParameterEventArgs instance containing the event data.

OnDone(e)​

Raises the Done event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

OnError(args)​

Raises the Error event.

ParameterTypeDescription
argsErrorEventArgsThe ErrorEventArgs instance containing the event data.

OnPrepareMessages(e)​

Raises the PrepareMessages event.

ParameterTypeDescription
eMessagesEventArgsAn MessagesEventArgs that contains the event data.

OnStart(e)​

Raises the Start event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Events​

AfterInvokeTool​

InvokeToolEventHandler Occurs after a tool is invoked.

AfterResponseReceived​

MessagesEventHandler Occurs after a response is received.

BeforeInvokeTool​

InvokeToolEventHandler Occurs before a tool is invoked.

BeforeSendRequest​

MessagesEventHandler Occurs before a request is sent.

ConvertParameter​

ConvertParameterEventHandler Occurs when a parameter needs to be converted.

Done​

EventHandler Occurs when the session is done processing a question.

Error​

ErrorEventHandler Occurs when an error is encountered.

PrepareMessages​

MessagesEventHandler Occurs after the messages have been prepared and before they are send to the AI.

Start​

EventHandler Occurs when the session starts processing a question.

Inherited By​

NameDescription
SmartAgentPromptTODO:
SmartParallelPromptRepresents a smart parallel prompt that can execute multiple tasks concurrently.
SmartHubRepresents a SmartHub component that provides AI capabilities to controls within a container.
SmartPromptRepresents a smart prompt component that can process and manage prompts with tools and parameters.
SmartRealtimeSession
SmartSessionRepresents a session that manages interactions with a smart hub and endpoint, handling prompts, messages, and tools within the session context.