Interface IAgent
Represents an agent within the runtime that can process messages, maintain state, and be closed when no longer needed.
- Inherited Members
Properties
Id
Gets the unique identifier of the agent.
Property Value
Metadata
Gets metadata associated with the agent.
Property Value
Methods
OnMessageAsync(object, MessageContext)
Handles an incoming message for the agent. This should only be called by the runtime, not by other agents.
Parameters
message
objectThe received message. The type should match one of the expected subscription types.
messageContext
MessageContext The context of the message, providing additional metadata.
Returns
- Value
Task <object> A task representing the asynchronous operation, returning a response to the message. The response can be
null
if no reply is necessary.
Exceptions
- Operation
Canceled Exception Thrown if the message was cancelled.
- Cant
Handle Exception Thrown if the agent cannot handle the message.