Skip to main content

SmartAgentAdapter

Namespace: Wisej.AI.Adapters

Assembly: Wisej.AI

Represents an AI agent capable of interacting with other adapters and agents.

public class SmartAgentAdapter : SmartAdapter

This abstract class provides the foundational structure for creating AI agents that can communicate and collaborate with other adapters and agents.

Constructors​

SmartAgentAdapter()​

Initializes a new instance of the SmartAgentAdapter class.

SmartAgentAdapter(prompt)​

Initializes a new instance of the SmartAgentAdapter class with the specified prompt .

NameTypeDescription
promptStringInitial system prompt.

Properties​

IncomingMessage​

Message: Gets or sets the incoming message to be processed by the agent.

Prompt​

String: Gets or sets the prompt used by the agent.

Methods​

RunAgentAsync(sender, message)​

Executes the agent asynchronously with the specified sender and message.

ParameterTypeDescription
senderSmartAdapterThe sender adapter initiating the request.
messageMessageThe message to be processed by the agent.

Returns: Task<Message>. A task representing the asynchronous operation, with a Message as the result.

Throws:

RunAsyncCore(control)​

Executes the core logic of the agent asynchronously.

ParameterTypeDescription
controlControlThe control parameter for the operation.

Returns: Task<Message>. A task representing the asynchronous operation, with a Message as the result.

Subscribe(adapter)​

Subscribes the agent to the specified adapter.

ParameterTypeDescription
adapterSmartAdapterThe adapter to which the agent will be subscribed.

Throws:

Unsubscribe(adapter)​

Unsubscribes the agent from the specified adapter.

ParameterTypeDescription
adapterSmartAdapterThe adapter from which the agent will be unsubscribed.

Throws:

Implements​

NameDescription
IToolProviderRepresents a provider that supplies tools.