Table of Contents

Class PrintMessageMiddleware

Namespace
AutoGen.Core
Assembly
AutoGen.Core.dll

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

string

Methods

InvokeAsync(MiddlewareContext, IAgent, CancellationToken)

The method to invoke the middleware

public Task<IMessage> InvokeAsync(MiddlewareContext context, IAgent agent, CancellationToken cancellationToken = default)

Parameters

context MiddlewareContext
agent IAgent
cancellationToken CancellationToken

Returns

Task<IMessage>

InvokeAsync(MiddlewareContext, IStreamingAgent, CancellationToken)

public IAsyncEnumerable<IMessage> InvokeAsync(MiddlewareContext context, IStreamingAgent agent, CancellationToken cancellationToken = default)

Parameters

context MiddlewareContext
agent IStreamingAgent
cancellationToken CancellationToken

Returns

IAsyncEnumerable<IMessage>