SmartAdapter
Wisej.AI.SmartAdapter
Namespace: Wisej.AI
Assembly: Wisej.AI (3.5.0.0)
Represents an abstract base class for creating smart adapters that interact with AI endpoints.
public class SmartAdapter : Component, IToolProvider
Constructors
SmartAdapter()

Initializes a new instance of the SmartAdapter class.
SmartAdapter(container)

Initializes a new instance of the SmartAdapter class attached to an IContainer implementation to allow for disposing the SmartAdapter when the service container is disposed.
Properties
Agents

AgentCollection: Gets the collection of agents associated with this adapter.
AutoRun

Boolean: Gets or sets a value indicating whether the adapter should automatically run. (Default: True
)
AutoUpdate

Boolean: Gets or sets a value indicating whether the adapter should automatically update the browser when is done processing (requires a working WebSocket connection). (Default: True
)
Busy

Boolean: Gets or sets a value indicating whether the adapter is busy. (Default: False
)
Controls

IList<Control>: Gets the list of controls associated with this adapter.
HasTools

Boolean: Gets a value indicating whether the adapter has any tools.
Hub

SmartHub: Gets or sets the SmartHub associated with this adapter.
Name

String: Gets or sets the name of the adapter.
Parameters

ParameterCollection: Gets the collection of parameters associated with this adapter.
Session

SmartSession: Gets the SmartSession in use by the adapter.
SystemPrompt

String: Gets or sets the system prompt used by the adapter. (Default: ""
)
Tools

ToolCollection: Gets the collection of tools associated with this adapter.
Usage

Metrics: Gets the usage metrics for the session.
Methods
ClearTools()

Clears all tools from the adapter.
CreateSession(prompt)

Creates a new session with an optional prompt.
Returns: SmartSession. A new SmartSession instance.
CreateSession<T>(systemPrompt)

Creates a new session of a specified type with an optional prompt.
T
The type of session to create.
Returns: T. A new session of type T .
Dispose(disposing)

Releases the unmanaged resources used by the SmartAdapter and optionally releases the managed resources.
disposing
True to release both managed and unmanaged resources; false to release only unmanaged resources.
GetJSON(message)

Returns the JSON string returned in the message by stripping the enclosing markers (json and
) if present.
Returns: String. JSON string.
IsAssociatedWith(control)

Determines whether a control is associated with the adapter.
Returns: Boolean. True if the control is associated; otherwise, false.
NotifyAgentsAsync(message)

Notifies all agents asynchronously with a message.
Returns: Task. A task representing the asynchronous operation.
OnBusyChanged(e)

Raises the BusyChanged event.
OnControlCreated(control)

Called when a control is created.
OnControlDisposed(control)

Called when a control is disposed.
OnDone(e)

Raises the Done event.
OnStart(e)

Raises the Start event.
RegisterControl(control)

Registers a control with the adapter.
RemoveTool(tool)

Removes a tool from the adapter.
Returns: SmartAdapter.
RemoveTools(target)

Removes the tools from the specified object.
Returns: SmartAdapter. The current SmartAdapter instance.
RunAsync(control)

Runs the adapter asynchronously.
Returns: Task<Message>. A task representing the asynchronous operation.
UnregisterControl(control)

Unregisters a control from the adapter.
UseTool(tool)

Adds a tool to the adapter.
Returns: SmartAdapter.
UseTools(target)

Adds multiple tools to the adapter from a target object.
Returns: SmartAdapter.
Events
BusyChanged

EventHandler Occurs when the busy state of the adapter changes.
Done

EventHandler Occurs when the adapter has completed processing.
Start

EventHandler Occurs when the adapter starts processing.
Inherited By
Transcribes the audio file of the of the associated Audio control to its Text property in the original language of the audio. speech-to-text
Represents a smart calendar adapter that extends the functionality of a SmartAdapter.
Represents an adapter that enhances a chart control with AI features.
Represents an adapter that enhances a ChartJS control with several AI features.
Adds semantic filtering to the ComboBox auto-complete functionality.
Enhances all the controls in the associated container with the AI-powered capability to extract structured data from unstructured text.
Represents a document adapter that can perform AI tasks using a document as a data source and interact with the user through a ChatBox control.
Converts unstructured text into a structured .NET object.
Represents an adapter for a PictureBox that generates images based on a description using the OpenAI DALL-E endpoint.
Represents an adapter that generates a data set from a database schema and a user-provided description.
Represents a smart adapter that provides real-time data processing capabilities for use with the OpenAIEndpointRealtime endpoint.
Enhances the ChatBox control to allow seamless PDF report queries using an AI provider.
Enhances a TextBox control with several AI features, including suggestions, translation, and auto-correction.
Implements
Represents a provider that supplies tools.
Last updated