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
stringsystemMessage
stringllmConfig
ConversableAgentConfigisTermination
Func<IEnumerable<IMessage>, CancellationToken, Task<bool>>humanInputMode
HumanInputModefunctionMap
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
stringsystemMessage
stringinnerAgent
IAgentdefaultAutoReply
stringhumanInputMode
HumanInputModeisTermination
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
Name
public string Name { get; }
Property Value
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
GenerateReplyOptionscancellationToken
CancellationToken