Table of Contents

Class ConversableAgent

Namespace
AutoGen
Assembly
AutoGen.dll
public class ConversableAgent : IAgent, IAgentMetaInformation
Inheritance
ConversableAgent
Implements
Derived
Inherited Members

Constructors

ConversableAgent(string, string, ConversableAgentConfig?, Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>?, HumanInputMode, IDictionary<string, Func<string, Task<string>>>?, string?)

public ConversableAgent(string name, string systemMessage = "You are a helpful AI assistant", ConversableAgentConfig? llmConfig = null, Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>? isTermination = null, HumanInputMode humanInputMode = HumanInputMode.AUTO, IDictionary<string, Func<string, Task<string>>>? functionMap = null, string? defaultReply = null)

Parameters

name string
systemMessage string
llmConfig ConversableAgentConfig
isTermination Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>
humanInputMode HumanInputMode
functionMap IDictionary<string, Func<string, Task<string>>>
defaultReply string

ConversableAgent(string, string, IAgent?, string?, HumanInputMode, Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>?, IDictionary<string, Func<string, Task<string>>>?)

public ConversableAgent(string name, string systemMessage = "You are a helpful AI assistant", IAgent? innerAgent = null, string? defaultAutoReply = null, HumanInputMode humanInputMode = HumanInputMode.NEVER, Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>? isTermination = null, IDictionary<string, Func<string, Task<string>>>? functionMap = null)

Parameters

name string
systemMessage string
innerAgent IAgent
defaultAutoReply string
humanInputMode HumanInputMode
isTermination Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>
functionMap IDictionary<string, Func<string, Task<string>>>

Properties

IsTermination

public Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>? IsTermination { get; }

Property Value

Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>

Name

public string Name { get; }

Property Value

string

Methods

GenerateReplyAsync(IEnumerable<IMessage>, GenerateReplyOptions?, CancellationToken)

Generate reply

public Task<IMessage> GenerateReplyAsync(IEnumerable<IMessage> messages, GenerateReplyOptions? overrideOptions = null, CancellationToken cancellationToken = default)

Parameters

messages IEnumerable<IMessage>

conversation history

overrideOptions GenerateReplyOptions
cancellationToken CancellationToken

Returns

Task<IMessage>