Table of Contents

Class SemanticKernelChatMessageContentConnector

Namespace
AutoGen.SemanticKernel
Assembly
AutoGen.SemanticKernel.dll

This middleware converts the incoming IMessage to Microsoft.SemanticKernel.ChatMessageContent before passing to agent. And converts the reply message from Microsoft.SemanticKernel.ChatMessageContent to IMessage before returning to the caller.

requirement for agent

- Input message type: IMessage<T> where T is Microsoft.SemanticKernel.ChatMessageContent

- Reply message type: IMessage<T> where T is Microsoft.SemanticKernel.ChatMessageContent

- (streaming) Reply message type: IMessage<T> where T is Microsoft.SemanticKernel.StreamingChatMessageContent

This middleware supports the following message types:

- TextMessage

- ImageMessage

- MultiModalMessage

This middleware returns the following message types:

- TextMessage

- ImageMessage

- MultiModalMessage

- (streaming) TextMessageUpdate

public class SemanticKernelChatMessageContentConnector : IStreamingMiddleware, IMiddleware
Inheritance
SemanticKernelChatMessageContentConnector
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>