Class PrintMessageMiddleware
The middleware that prints the reply from agent to the console.
public class PrintMessageMiddleware : IStreamingMiddleware, IMiddleware
- Inheritance
-
PrintMessageMiddleware
- Implements
- Inherited Members
Properties
Name
the name of the middleware
public string? Name { get; }
Property Value
Methods
InvokeAsync(MiddlewareContext, IAgent, CancellationToken)
The method to invoke the middleware
public Task<IMessage> InvokeAsync(MiddlewareContext context, IAgent agent, CancellationToken cancellationToken = default)
Parameters
context
MiddlewareContextagent
IAgentcancellationToken
CancellationToken
Returns
InvokeAsync(MiddlewareContext, IStreamingAgent, CancellationToken)
The streaming version of InvokeAsync(MiddlewareContext, IAgent, CancellationToken).
public IAsyncEnumerable<IMessage> InvokeAsync(MiddlewareContext context, IStreamingAgent agent, CancellationToken cancellationToken = default)
Parameters
context
MiddlewareContextagent
IStreamingAgentcancellationToken
CancellationToken