autogen/dotnet
Jacob Alber 41e7e85c40
fix: Improve PublishMessageAsync resilience (#5923)
During the recent fix to SendMessageAsync's recurrence, we added code to ensure blocking on Publish. This adds additional resilience to the Publish delivery, ensuring that every subscribed agent receives the message, regardless of errors in the middle.
2025-03-13 16:53:21 -04:00
..
.config pack agenthost as tool (#5647) 2025-02-24 14:23:45 -08:00
.tools .NET update global.json to use 9.0.100 (#5517) 2025-02-13 00:02:37 +00:00
eng feat: Release pre-requisites for Microsoft.AutoGen.Core NuGet (#5270) 2025-01-30 17:08:39 -05:00
nuget feat: Release pre-requisites for Microsoft.AutoGen.Core NuGet (#5270) 2025-01-30 17:08:39 -05:00
resource/images [.Net] Add Goolge gemini (#2868) 2024-06-10 17:31:45 +00:00
samples Dotnet: Add modelServiceId support to SemanticKernelAgent (#5422) 2025-02-25 20:39:45 +00:00
src fix: Improve PublishMessageAsync resilience (#5923) 2025-03-13 16:53:21 -04:00
test fix: Improve PublishMessageAsync resilience (#5923) 2025-03-13 16:53:21 -04:00
website fix: Various fixes and cleanups to dotnet autogen core (#5242) 2025-01-28 17:13:36 -05:00
.editorconfig Rysweet 5207 net runtime interface to match python add registration to interface and inmemoryruntime (#5215) 2025-01-27 09:44:39 -05:00
.gitattributes Merge project-oagents into agnext 2024-06-19 15:34:04 -07:00
.gitignore add appsettings.Development.json to gitignore (#4303) 2024-11-21 19:31:13 -05:00
AutoGen.sln Improve e2e integration tests and isolate tests from other things; includes patch to Serializer (#5497) 2025-02-13 16:43:57 -08:00
AutoGen.v3.ncrunchsolution ensure that cancellation token is passed in InvokeWithActivityAsync (#4329) 2024-11-25 00:32:56 +00:00
Directory.Build.props feat: Release pre-requisites for Microsoft.AutoGen.Core NuGet (#5270) 2025-01-30 17:08:39 -05:00
Directory.Build.targets Add .editorconfig & use centralized package management 2024-06-19 16:53:37 -07:00
Directory.Packages.props feat: Release pre-requisites for Microsoft.AutoGen.Core NuGet (#5270) 2025-01-30 17:08:39 -05:00
NuGet.config [.Net] Fix #2660 and add tests for AutoGen.DotnetInteractive (#2676) 2024-05-14 03:40:26 +00:00
PACKAGING.md .NET add document on packaging && disable uploading artifacts folder to pipeline by default (#4299) 2024-11-21 09:53:23 -08:00
README.md fix: Various fixes and cleanups to dotnet autogen core (#5242) 2025-01-28 17:13:36 -05:00
global.json .NET update global.json to use 9.0.100 (#5517) 2025-02-13 00:02:37 +00:00
spelling.dic Initial cross-language protocol for agents (#139) 2024-06-28 08:03:42 -07:00

README.md

AutoGen for .NET

Thre are two sets of packages here: AutoGen.* the older packages derived from AutoGen 0.2 for .NET - these will gradually be deprecated and ported into the new packages Microsoft.AutoGen.* the new packages for .NET that use the event-driven model - These APIs are not yet stable and are subject to change.

To get started with the new packages, please see the samples and in particular the Hello sample.

You can install both new and old packages from the following feeds:

dotnet-ci NuGet version

[!NOTE] Nightly build is available at:

Firstly, following the installation guide to install AutoGen packages.

Then you can start with the following code snippet to create a conversable agent and chat with it.

using AutoGen;
using AutoGen.OpenAI;

var openAIKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new Exception("Please set OPENAI_API_KEY environment variable.");
var gpt35Config = new OpenAIConfig(openAIKey, "gpt-3.5-turbo");

var assistantAgent = new AssistantAgent(
    name: "assistant",
    systemMessage: "You are an assistant that help user to do some tasks.",
    llmConfig: new ConversableAgentConfig
    {
        Temperature = 0,
        ConfigList = [gpt35Config],
    })
    .RegisterPrintMessage(); // register a hook to print message nicely to console

// set human input mode to ALWAYS so that user always provide input
var userProxyAgent = new UserProxyAgent(
    name: "user",
    humanInputMode: ConversableAgent.HumanInputMode.ALWAYS)
    .RegisterPrintMessage();

// start the conversation
await userProxyAgent.InitiateChatAsync(
    receiver: assistantAgent,
    message: "Hey assistant, please do me a favor.",
    maxRound: 10);

Samples

You can find more examples under the sample project.

Functionality

  • ConversableAgent

  • Agent communication

    • Two-agent chat
    • Group chat
  • Enhanced LLM Inferences

  • Exclusive for dotnet

    • Source generator for type-safe function definition generation