SmartAgentAdapter
Namespace: Wisej.AI.Adapters
Assembly: Wisej.AI
Represents an AI agent capable of interacting with other adapters and agents.
- C#
- VB.NET
public class SmartAgentAdapter : SmartAdapter
Public Class SmartAgentAdapter
Inherits 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 .
| Name | Type | Description |
|---|---|---|
| prompt | String | Initial 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.
| Parameter | Type | Description |
|---|---|---|
| sender | SmartAdapter | The sender adapter initiating the request. |
| message | Message | The message to be processed by the agent. |
Returns: Task<Message>. A task representing the asynchronous operation, with a Message as the result.
Throws:
- InvalidOperationException Thrown when the SmartAdapter is busy.
- ArgumentNullException Thrown when the sender is null.
RunAsyncCore(control)
Executes the core logic of the agent asynchronously.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The 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.
| Parameter | Type | Description |
|---|---|---|
| adapter | SmartAdapter | The adapter to which the agent will be subscribed. |
Throws:
- ArgumentNullException Thrown when the adapter is null.
Unsubscribe(adapter)
Unsubscribes the agent from the specified adapter.
| Parameter | Type | Description |
|---|---|---|
| adapter | SmartAdapter | The adapter from which the agent will be unsubscribed. |
Throws:
- ArgumentNullException Thrown when the adapter is null.
Implements
| Name | Description |
|---|---|
| IToolProvider | Represents a provider that supplies tools. |