AI Agents
InferenceAgent<T>
InferenceAgent<T>
Base class for agents using Microsoft.Extensions.AI for chat completion.
type parameter
required
Message type (must implement IMessage)
AgentId
required
Agent identifier
IAgentRuntime
required
Runtime environment
string
required
Agent name
ILogger?
Optional logger
IChatClient
required
Chat client from Microsoft.Extensions.AI
Properties
IChatClient
Gets the chat client for inference
Methods
Task<ChatResponse>
IAsyncEnumerable<ChatResponseUpdate>
Stream chat completion chunks
I/O Agents
IProcessIO
IProcessIO
IHandleConsole
IHandleConsole
Interface for console interaction agents.
Agent Chat (Teams)
Termination Conditions
MaxMessageTermination
MaxMessageTermination
TextMessageTermination
TextMessageTermination
TextMentionTermination
TextMentionTermination
Terminate when text mentions specific content.
TimeoutTermination
TimeoutTermination
TokenUsageTermination
TokenUsageTermination
StopMessageTermination
StopMessageTermination
Terminate on stop message.
SourceMatchTermination
SourceMatchTermination
Terminate when message source matches.
HandoffTermination
HandoffTermination
Terminate on agent handoff.
FunctionCallTermination
FunctionCallTermination
Terminate on specific function call.
ExternalTermination
ExternalTermination
Terminate based on external signal.
Agent Host
Host
Host
Application host for running agent systems.
Example: Complete AI Agent
See Also
- Microsoft.AutoGen.Core - Core runtime and contracts
- Microsoft.AutoGen.Extensions - Extensions and integrations