Table of Contents

Class GroupChatExtension

Namespace
AutoGen.Core
Assembly
AutoGen.Core.dll
public static class GroupChatExtension
Inheritance
GroupChatExtension
Inherited Members

Fields

CLEAR_MESSAGES

public const string CLEAR_MESSAGES = "[GROUPCHAT_CLEAR_MESSAGES]"

Field Value

string

TERMINATE

public const string TERMINATE = "[GROUPCHAT_TERMINATE]"

Field Value

string

Methods

AddInitializeMessage(IAgent, string, IGroupChat)

[Obsolete("please use SendIntroduction")]
public static void AddInitializeMessage(this IAgent agent, string message, IGroupChat groupChat)

Parameters

agent IAgent
message string
groupChat IGroupChat

IsGroupChatClearMessage(IMessage)

public static bool IsGroupChatClearMessage(this IMessage message)

Parameters

message IMessage

Returns

bool

IsGroupChatTerminateMessage(IMessage)

Return true if IMessage contains TERMINATE, otherwise false.

public static bool IsGroupChatTerminateMessage(this IMessage message)

Parameters

message IMessage

Returns

bool

MessageToKeep(IGroupChat, IEnumerable<IMessage>)

public static IEnumerable<IMessage> MessageToKeep(this IGroupChat _, IEnumerable<IMessage> messages)

Parameters

_ IGroupChat
messages IEnumerable<IMessage>

Returns

IEnumerable<IMessage>

ProcessConversationForAgent(IGroupChat, IEnumerable<IMessage>, IEnumerable<IMessage>)

[Obsolete]
public static IEnumerable<IMessage> ProcessConversationForAgent(this IGroupChat groupChat, IEnumerable<IMessage> initialMessages, IEnumerable<IMessage> messages)

Parameters

groupChat IGroupChat
initialMessages IEnumerable<IMessage>
messages IEnumerable<IMessage>

Returns

IEnumerable<IMessage>

SendAsync(IGroupChat, IEnumerable<IMessage>, int, CancellationToken)

Send messages to a IGroupChat and return new messages from the group chat.

public static IAsyncEnumerable<IMessage> SendAsync(this IGroupChat groupChat, IEnumerable<IMessage> chatHistory, int maxRound = 10, CancellationToken cancellationToken = default)

Parameters

groupChat IGroupChat
chatHistory IEnumerable<IMessage>
maxRound int
cancellationToken CancellationToken

Returns

IAsyncEnumerable<IMessage>

SendIntroduction(IAgent, string, IGroupChat)

Send an instruction message to the group chat.

public static void SendIntroduction(this IAgent agent, string message, IGroupChat groupChat)

Parameters

agent IAgent
message string
groupChat IGroupChat