A programming framework for agentic AI
rysweet-adopt .NET Microsoft.Extensions.AI abstractions (#3790)
Ryan Sweetbf407d99b4cb
diff --git a/dotnet/AutoGen.sln b/dotnet/AutoGen.slnindex 317fc82ff..b93ba5661 100644--- a/dotnet/AutoGen.sln+++ b/dotnet/AutoGen.sln@@ -15,10 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.SourceGenerator", "EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.SourceGenerator.Tests", "test\AutoGen.SourceGenerator.Tests\AutoGen.SourceGenerator.Tests.csproj", "{05A2FAD8-03B0-4B2F-82AF-2F6BF0F050E5}"EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.BasicSample", "samples\AutoGen.BasicSamples\AutoGen.BasicSample.csproj", "{7EBF916A-A7B1-4B74-AF10-D705B7A18F58}"-EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{FBFEAD1F-29EB-4D99-A672-0CD8473E10B9}"-EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.DotnetInteractive", "src\AutoGen.DotnetInteractive\AutoGen.DotnetInteractive.csproj", "{B61D8008-7FB7-4C0E-8044-3A74AA63A596}"EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.LMStudio", "src\AutoGen.LMStudio\AutoGen.LMStudio.csproj", "{F98BDA9B-8657-4BA8-9B03-BAEA454CAE60}"@@ -47,28 +43,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Ollama", "src\AutoGEndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Ollama.Tests", "test\AutoGen.Ollama.Tests\AutoGen.Ollama.Tests.csproj", "{03E31CAA-3728-48D3-B936-9F11CF6C18FE}"EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Ollama.Sample", "samples\AutoGen.Ollama.Sample\AutoGen.Ollama.Sample.csproj", "{93AA4D0D-6EE4-44D5-AD77-7F73A3934544}"-EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.SemanticKernel.Sample", "samples\AutoGen.SemanticKernel.Sample\AutoGen.SemanticKernel.Sample.csproj", "{52958A60-3FF7-4243-9058-34A6E4F55C31}"-EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Anthropic", "src\AutoGen.Anthropic\AutoGen.Anthropic.csproj", "{6A95E113-B824-4524-8F13-CD0C3E1C8804}"EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Anthropic.Tests", "test\AutoGen.Anthropic.Tests\AutoGen.Anthropic.Tests.csproj", "{815E937E-86D6-4476-9EC6-B7FBCBBB5DB6}"EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Anthropic.Samples", "samples\AutoGen.Anthropic.Samples\AutoGen.Anthropic.Samples.csproj", "{834B4E85-64E5-4382-8465-548F332E5298}"-EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Gemini", "src\AutoGen.Gemini\AutoGen.Gemini.csproj", "{EFE0DC86-80FC-4D52-95B7-07654BA1A769}"EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Gemini.Tests", "test\AutoGen.Gemini.Tests\AutoGen.Gemini.Tests.csproj", "{8EA16BAB-465A-4C07-ABC4-1070D40067E9}"EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Gemini.Sample", "samples\AutoGen.Gemini.Sample\AutoGen.Gemini.Sample.csproj", "{19679B75-CE3A-4DF0-A3F0-CA369D2760A4}"-EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.AotCompatibility.Tests", "test\AutoGen.AotCompatibility.Tests\AutoGen.AotCompatibility.Tests.csproj", "{6B82F26D-5040-4453-B21B-C8D1F913CE4C}"EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.OpenAI.Sample", "samples\AutoGen.OpenAI.Sample\AutoGen.OpenAI.Sample.csproj", "{0E635268-351C-4A6B-A28D-593D868C2CA4}"-EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.WebAPI.Sample", "samples\AutoGen.WebAPI.Sample\AutoGen.WebAPI.Sample.csproj", "{12079C18-A519-403F-BBFD-200A36A0C083}"-EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.AzureAIInference", "src\AutoGen.AzureAIInference\AutoGen.AzureAIInference.csproj", "{5C45981D-1319-4C25-935C-83D411CB28DF}"EndProjectProject("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.AzureAIInference.Tests", "test\AutoGen.AzureAIInference.Tests\AutoGen.AzureAIInference.Tests.csproj", "{5970868F-831E-418F-89A9-4EC599563E16}"@@ -81,28 +65,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.OpenAI.Tests", "tesEndProjectProject("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AgentChat", "AgentChat", "{4BB66E06-37D8-45A0-9B97-DE590AFBA340}"EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AgentChat", "AgentChat", "{C7A2D42D-9277-47AC-862B-D86DF9D6AD48}"-EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dev-team", "dev-team", "{616F30DF-1F41-4047-BAA4-64BA03BF5AEA}"-EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevTeam.AgentHost", "samples\dev-team\DevTeam.AgentHost\DevTeam.AgentHost.csproj", "{7228A701-C79D-4E15-BF45-48D11F721A84}"-EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevTeam.Agents", "samples\dev-team\DevTeam.Agents\DevTeam.Agents.csproj", "{EDECD35D-6EB1-4CA8-A175-A66588C3481E}"-EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevTeam.AppHost", "samples\dev-team\DevTeam.AppHost\DevTeam.AppHost.csproj", "{F2F13EAF-05C6-4E90-B2E4-3FA0290D7F6E}"-EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevTeam.Backend", "samples\dev-team\DevTeam.Backend\DevTeam.Backend.csproj", "{D826D5E4-31F4-4AB5-AC86-F7B4AD79314B}"-EndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevTeam.Shared", "samples\dev-team\DevTeam.Shared\DevTeam.Shared.csproj", "{D9F65DFD-368B-47DB-8BB5-0C74DED7F439}"-EndProjectProject("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{243E768F-EA7D-4AF1-B625-0398440BB1AB}"ProjectSection(SolutionItems) = preProject.editorconfig = .editorconfigspelling.dic = spelling.dicEndProjectSectionEndProject-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hello", "samples\Hello\Hello.csproj", "{6C9135E6-9D15-4D86-B3F4-9666DB87060A}"-EndProjectProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AutoGen.Agents", "src\Microsoft.AutoGen\Agents\Microsoft.AutoGen.Agents.csproj", "{FD87BD33-4616-460B-AC85-A412BA08BB78}"EndProjectProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AutoGen.Abstractions", "src\Microsoft.AutoGen\Abstractions\Microsoft.AutoGen.Abstractions.csproj", "{E0C991D9-0DB8-471C-ADC9-5FB16E2A0106}"@@ -115,6 +83,46 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AutoGen.Runtime",EndProjectProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AutoGen.ServiceDefaults", "src\Microsoft.AutoGen\ServiceDefaults\Microsoft.AutoGen.ServiceDefaults.csproj", "{D7E9D90B-5595-4E72-A90A-6DE20D9AB7AE}"EndProject+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AgentChat", "AgentChat", "{668726B9-77BC-45CF-B576-0F0773BF1615}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.Anthropic.Samples", "samples\AutoGen.Anthropic.Samples\AutoGen.Anthropic.Samples.csproj", "{84020C4A-933A-4693-9889-1B99304A7D76}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.BasicSample", "samples\AutoGen.BasicSamples\AutoGen.BasicSample.csproj", "{5777515F-4053-42F9-AF2B-95D8D0F5384A}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.Gemini.Sample", "samples\AutoGen.Gemini.Sample\AutoGen.Gemini.Sample.csproj", "{2E895A70-DF17-4C6C-BB84-F83B07C75AAD}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.Ollama.Sample", "samples\AutoGen.Ollama.Sample\AutoGen.Ollama.Sample.csproj", "{20DA47F2-F6C4-4503-B9D4-420994E28EF0}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.OpenAI.Sample", "samples\AutoGen.OpenAI.Sample\AutoGen.OpenAI.Sample.csproj", "{1F86E48B-8674-4C20-A3BE-9431049A5BEC}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.SemanticKernel.Sample", "samples\AutoGen.SemanticKernel.Sample\AutoGen.SemanticKernel.Sample.csproj", "{CB8824F5-9475-451F-87E8-F2AEF2490A12}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.WebAPI.Sample", "samples\AutoGen.WebAPI.Sample\AutoGen.WebAPI.Sample.csproj", "{4385AFCF-AB4A-49B2-BEBA-D33C950E1EE6}"+EndProject+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DevTeam", "DevTeam", "{05B9C173-6441-4DCA-9AC4-E897EF75F331}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTeam.AgentHost", "samples\dev-team\DevTeam.AgentHost\DevTeam.AgentHost.csproj", "{462A357B-7BB9-4927-A9FD-4FB7675898E9}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTeam.Agents", "samples\dev-team\DevTeam.Agents\DevTeam.Agents.csproj", "{83BBB833-A2F0-4A4D-BA1B-8229FC9BCD4F}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTeam.AppHost", "samples\dev-team\DevTeam.AppHost\DevTeam.AppHost.csproj", "{63280C12-3BE3-4C4E-805E-584CDC6BC1F5}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTeam.Backend", "samples\dev-team\DevTeam.Backend\DevTeam.Backend.csproj", "{EDA3EF83-FC7F-4BCF-945D-B893620EE4B1}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevTeam.Shared", "samples\dev-team\DevTeam.Shared\DevTeam.Shared.csproj", "{01F5D7C3-41EB-409C-9B77-A945C07FA7E8}"+EndProject+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hello", "Hello", "{7EB336C2-7C0A-4BC8-80C6-A3173AB8DC45}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Backend", "samples\Hello\Backend\Backend.csproj", "{C428C6E5-B0E5-4DA6-B0F7-43013D2ECE69}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hello.AppHost", "samples\Hello\Hello.AppHost\Hello.AppHost.csproj", "{09A373A0-8169-409F-8C37-3FBC1654B122}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloAIAgents", "samples\Hello\HelloAIAgents\HelloAIAgents.csproj", "{A20B9894-F352-4338-872A-F215A241D43D}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloAgent", "samples\Hello\HelloAgent\HelloAgent.csproj", "{8F7560CF-EEBB-4333-A69F-838CA40FD85D}"+EndProject+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIModelClientHostingExtensions", "src\Microsoft.AutoGen\Extensions\AIModelClientHostingExtensions\AIModelClientHostingExtensions.csproj", "{97550E87-48C6-4EBF-85E1-413ABAE9DBFD}"+EndProjectGlobalGlobalSection(SolutionConfigurationPlatforms) = preSolutionDebug|Any CPU = Debug|Any CPU@@ -137,10 +145,6 @@ Global{05A2FAD8-03B0-4B2F-82AF-2F6BF0F050E5}.Debug|Any CPU.Build.0 = Debug|Any CPU{05A2FAD8-03B0-4B2F-82AF-2F6BF0F050E5}.Release|Any CPU.ActiveCfg = Release|Any CPU{05A2FAD8-03B0-4B2F-82AF-2F6BF0F050E5}.Release|Any CPU.Build.0 = Release|Any CPU- {7EBF916A-A7B1-4B74-AF10-D705B7A18F58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {7EBF916A-A7B1-4B74-AF10-D705B7A18F58}.Debug|Any CPU.Build.0 = Debug|Any CPU- {7EBF916A-A7B1-4B74-AF10-D705B7A18F58}.Release|Any CPU.ActiveCfg = Release|Any CPU- {7EBF916A-A7B1-4B74-AF10-D705B7A18F58}.Release|Any CPU.Build.0 = Release|Any CPU{B61D8008-7FB7-4C0E-8044-3A74AA63A596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{B61D8008-7FB7-4C0E-8044-3A74AA63A596}.Debug|Any CPU.Build.0 = Debug|Any CPU{B61D8008-7FB7-4C0E-8044-3A74AA63A596}.Release|Any CPU.ActiveCfg = Release|Any CPU@@ -197,14 +201,6 @@ Global{03E31CAA-3728-48D3-B936-9F11CF6C18FE}.Debug|Any CPU.Build.0 = Debug|Any CPU{03E31CAA-3728-48D3-B936-9F11CF6C18FE}.Release|Any CPU.ActiveCfg = Release|Any CPU{03E31CAA-3728-48D3-B936-9F11CF6C18FE}.Release|Any CPU.Build.0 = Release|Any CPU- {93AA4D0D-6EE4-44D5-AD77-7F73A3934544}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {93AA4D0D-6EE4-44D5-AD77-7F73A3934544}.Debug|Any CPU.Build.0 = Debug|Any CPU- {93AA4D0D-6EE4-44D5-AD77-7F73A3934544}.Release|Any CPU.ActiveCfg = Release|Any CPU- {93AA4D0D-6EE4-44D5-AD77-7F73A3934544}.Release|Any CPU.Build.0 = Release|Any CPU- {52958A60-3FF7-4243-9058-34A6E4F55C31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {52958A60-3FF7-4243-9058-34A6E4F55C31}.Debug|Any CPU.Build.0 = Debug|Any CPU- {52958A60-3FF7-4243-9058-34A6E4F55C31}.Release|Any CPU.ActiveCfg = Release|Any CPU- {52958A60-3FF7-4243-9058-34A6E4F55C31}.Release|Any CPU.Build.0 = Release|Any CPU{6A95E113-B824-4524-8F13-CD0C3E1C8804}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{6A95E113-B824-4524-8F13-CD0C3E1C8804}.Debug|Any CPU.Build.0 = Debug|Any CPU{6A95E113-B824-4524-8F13-CD0C3E1C8804}.Release|Any CPU.ActiveCfg = Release|Any CPU@@ -213,10 +209,6 @@ Global{815E937E-86D6-4476-9EC6-B7FBCBBB5DB6}.Debug|Any CPU.Build.0 = Debug|Any CPU{815E937E-86D6-4476-9EC6-B7FBCBBB5DB6}.Release|Any CPU.ActiveCfg = Release|Any CPU{815E937E-86D6-4476-9EC6-B7FBCBBB5DB6}.Release|Any CPU.Build.0 = Release|Any CPU- {834B4E85-64E5-4382-8465-548F332E5298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {834B4E85-64E5-4382-8465-548F332E5298}.Debug|Any CPU.Build.0 = Debug|Any CPU- {834B4E85-64E5-4382-8465-548F332E5298}.Release|Any CPU.ActiveCfg = Release|Any CPU- {834B4E85-64E5-4382-8465-548F332E5298}.Release|Any CPU.Build.0 = Release|Any CPU{EFE0DC86-80FC-4D52-95B7-07654BA1A769}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{EFE0DC86-80FC-4D52-95B7-07654BA1A769}.Debug|Any CPU.Build.0 = Debug|Any CPU{EFE0DC86-80FC-4D52-95B7-07654BA1A769}.Release|Any CPU.ActiveCfg = Release|Any CPU@@ -225,22 +217,10 @@ Global{8EA16BAB-465A-4C07-ABC4-1070D40067E9}.Debug|Any CPU.Build.0 = Debug|Any CPU{8EA16BAB-465A-4C07-ABC4-1070D40067E9}.Release|Any CPU.ActiveCfg = Release|Any CPU{8EA16BAB-465A-4C07-ABC4-1070D40067E9}.Release|Any CPU.Build.0 = Release|Any CPU- {19679B75-CE3A-4DF0-A3F0-CA369D2760A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {19679B75-CE3A-4DF0-A3F0-CA369D2760A4}.Debug|Any CPU.Build.0 = Debug|Any CPU- {19679B75-CE3A-4DF0-A3F0-CA369D2760A4}.Release|Any CPU.ActiveCfg = Release|Any CPU- {19679B75-CE3A-4DF0-A3F0-CA369D2760A4}.Release|Any CPU.Build.0 = Release|Any CPU{6B82F26D-5040-4453-B21B-C8D1F913CE4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{6B82F26D-5040-4453-B21B-C8D1F913CE4C}.Debug|Any CPU.Build.0 = Debug|Any CPU{6B82F26D-5040-4453-B21B-C8D1F913CE4C}.Release|Any CPU.ActiveCfg = Release|Any CPU{6B82F26D-5040-4453-B21B-C8D1F913CE4C}.Release|Any CPU.Build.0 = Release|Any CPU- {0E635268-351C-4A6B-A28D-593D868C2CA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {0E635268-351C-4A6B-A28D-593D868C2CA4}.Debug|Any CPU.Build.0 = Debug|Any CPU- {0E635268-351C-4A6B-A28D-593D868C2CA4}.Release|Any CPU.ActiveCfg = Release|Any CPU- {0E635268-351C-4A6B-A28D-593D868C2CA4}.Release|Any CPU.Build.0 = Release|Any CPU- {12079C18-A519-403F-BBFD-200A36A0C083}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {12079C18-A519-403F-BBFD-200A36A0C083}.Debug|Any CPU.Build.0 = Debug|Any CPU- {12079C18-A519-403F-BBFD-200A36A0C083}.Release|Any CPU.ActiveCfg = Release|Any CPU- {12079C18-A519-403F-BBFD-200A36A0C083}.Release|Any CPU.Build.0 = Release|Any CPU{5C45981D-1319-4C25-935C-83D411CB28DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{5C45981D-1319-4C25-935C-83D411CB28DF}.Debug|Any CPU.Build.0 = Debug|Any CPU{5C45981D-1319-4C25-935C-83D411CB28DF}.Release|Any CPU.ActiveCfg = Release|Any CPU@@ -261,30 +241,6 @@ Global{42A8251C-E7B3-47BB-A82E-459952EBE132}.Debug|Any CPU.Build.0 = Debug|Any CPU{42A8251C-E7B3-47BB-A82E-459952EBE132}.Release|Any CPU.ActiveCfg = Release|Any CPU{42A8251C-E7B3-47BB-A82E-459952EBE132}.Release|Any CPU.Build.0 = Release|Any CPU- {7228A701-C79D-4E15-BF45-48D11F721A84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {7228A701-C79D-4E15-BF45-48D11F721A84}.Debug|Any CPU.Build.0 = Debug|Any CPU- {7228A701-C79D-4E15-BF45-48D11F721A84}.Release|Any CPU.ActiveCfg = Release|Any CPU- {7228A701-C79D-4E15-BF45-48D11F721A84}.Release|Any CPU.Build.0 = Release|Any CPU- {EDECD35D-6EB1-4CA8-A175-A66588C3481E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {EDECD35D-6EB1-4CA8-A175-A66588C3481E}.Debug|Any CPU.Build.0 = Debug|Any CPU- {EDECD35D-6EB1-4CA8-A175-A66588C3481E}.Release|Any CPU.ActiveCfg = Release|Any CPU- {EDECD35D-6EB1-4CA8-A175-A66588C3481E}.Release|Any CPU.Build.0 = Release|Any CPU- {F2F13EAF-05C6-4E90-B2E4-3FA0290D7F6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {F2F13EAF-05C6-4E90-B2E4-3FA0290D7F6E}.Debug|Any CPU.Build.0 = Debug|Any CPU- {F2F13EAF-05C6-4E90-B2E4-3FA0290D7F6E}.Release|Any CPU.ActiveCfg = Release|Any CPU- {F2F13EAF-05C6-4E90-B2E4-3FA0290D7F6E}.Release|Any CPU.Build.0 = Release|Any CPU- {D826D5E4-31F4-4AB5-AC86-F7B4AD79314B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {D826D5E4-31F4-4AB5-AC86-F7B4AD79314B}.Debug|Any CPU.Build.0 = Debug|Any CPU- {D826D5E4-31F4-4AB5-AC86-F7B4AD79314B}.Release|Any CPU.ActiveCfg = Release|Any CPU- {D826D5E4-31F4-4AB5-AC86-F7B4AD79314B}.Release|Any CPU.Build.0 = Release|Any CPU- {D9F65DFD-368B-47DB-8BB5-0C74DED7F439}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {D9F65DFD-368B-47DB-8BB5-0C74DED7F439}.Debug|Any CPU.Build.0 = Debug|Any CPU- {D9F65DFD-368B-47DB-8BB5-0C74DED7F439}.Release|Any CPU.ActiveCfg = Release|Any CPU- {D9F65DFD-368B-47DB-8BB5-0C74DED7F439}.Release|Any CPU.Build.0 = Release|Any CPU- {6C9135E6-9D15-4D86-B3F4-9666DB87060A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {6C9135E6-9D15-4D86-B3F4-9666DB87060A}.Debug|Any CPU.Build.0 = Debug|Any CPU- {6C9135E6-9D15-4D86-B3F4-9666DB87060A}.Release|Any CPU.ActiveCfg = Release|Any CPU- {6C9135E6-9D15-4D86-B3F4-9666DB87060A}.Release|Any CPU.Build.0 = Release|Any CPU{FD87BD33-4616-460B-AC85-A412BA08BB78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{FD87BD33-4616-460B-AC85-A412BA08BB78}.Debug|Any CPU.Build.0 = Debug|Any CPU{FD87BD33-4616-460B-AC85-A412BA08BB78}.Release|Any CPU.ActiveCfg = Release|Any CPU@@ -309,6 +265,74 @@ Global{D7E9D90B-5595-4E72-A90A-6DE20D9AB7AE}.Debug|Any CPU.Build.0 = Debug|Any CPU{D7E9D90B-5595-4E72-A90A-6DE20D9AB7AE}.Release|Any CPU.ActiveCfg = Release|Any CPU{D7E9D90B-5595-4E72-A90A-6DE20D9AB7AE}.Release|Any CPU.Build.0 = Release|Any CPU+ {84020C4A-933A-4693-9889-1B99304A7D76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {84020C4A-933A-4693-9889-1B99304A7D76}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {84020C4A-933A-4693-9889-1B99304A7D76}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {84020C4A-933A-4693-9889-1B99304A7D76}.Release|Any CPU.Build.0 = Release|Any CPU+ {5777515F-4053-42F9-AF2B-95D8D0F5384A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {5777515F-4053-42F9-AF2B-95D8D0F5384A}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {5777515F-4053-42F9-AF2B-95D8D0F5384A}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {5777515F-4053-42F9-AF2B-95D8D0F5384A}.Release|Any CPU.Build.0 = Release|Any CPU+ {2E895A70-DF17-4C6C-BB84-F83B07C75AAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {2E895A70-DF17-4C6C-BB84-F83B07C75AAD}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {2E895A70-DF17-4C6C-BB84-F83B07C75AAD}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {2E895A70-DF17-4C6C-BB84-F83B07C75AAD}.Release|Any CPU.Build.0 = Release|Any CPU+ {20DA47F2-F6C4-4503-B9D4-420994E28EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {20DA47F2-F6C4-4503-B9D4-420994E28EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {20DA47F2-F6C4-4503-B9D4-420994E28EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {20DA47F2-F6C4-4503-B9D4-420994E28EF0}.Release|Any CPU.Build.0 = Release|Any CPU+ {1F86E48B-8674-4C20-A3BE-9431049A5BEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {1F86E48B-8674-4C20-A3BE-9431049A5BEC}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {1F86E48B-8674-4C20-A3BE-9431049A5BEC}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {1F86E48B-8674-4C20-A3BE-9431049A5BEC}.Release|Any CPU.Build.0 = Release|Any CPU+ {CB8824F5-9475-451F-87E8-F2AEF2490A12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {CB8824F5-9475-451F-87E8-F2AEF2490A12}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {CB8824F5-9475-451F-87E8-F2AEF2490A12}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {CB8824F5-9475-451F-87E8-F2AEF2490A12}.Release|Any CPU.Build.0 = Release|Any CPU+ {4385AFCF-AB4A-49B2-BEBA-D33C950E1EE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {4385AFCF-AB4A-49B2-BEBA-D33C950E1EE6}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {4385AFCF-AB4A-49B2-BEBA-D33C950E1EE6}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {4385AFCF-AB4A-49B2-BEBA-D33C950E1EE6}.Release|Any CPU.Build.0 = Release|Any CPU+ {462A357B-7BB9-4927-A9FD-4FB7675898E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {462A357B-7BB9-4927-A9FD-4FB7675898E9}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {462A357B-7BB9-4927-A9FD-4FB7675898E9}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {462A357B-7BB9-4927-A9FD-4FB7675898E9}.Release|Any CPU.Build.0 = Release|Any CPU+ {83BBB833-A2F0-4A4D-BA1B-8229FC9BCD4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {83BBB833-A2F0-4A4D-BA1B-8229FC9BCD4F}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {83BBB833-A2F0-4A4D-BA1B-8229FC9BCD4F}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {83BBB833-A2F0-4A4D-BA1B-8229FC9BCD4F}.Release|Any CPU.Build.0 = Release|Any CPU+ {63280C12-3BE3-4C4E-805E-584CDC6BC1F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {63280C12-3BE3-4C4E-805E-584CDC6BC1F5}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {63280C12-3BE3-4C4E-805E-584CDC6BC1F5}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {63280C12-3BE3-4C4E-805E-584CDC6BC1F5}.Release|Any CPU.Build.0 = Release|Any CPU+ {EDA3EF83-FC7F-4BCF-945D-B893620EE4B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {EDA3EF83-FC7F-4BCF-945D-B893620EE4B1}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {EDA3EF83-FC7F-4BCF-945D-B893620EE4B1}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {EDA3EF83-FC7F-4BCF-945D-B893620EE4B1}.Release|Any CPU.Build.0 = Release|Any CPU+ {01F5D7C3-41EB-409C-9B77-A945C07FA7E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {01F5D7C3-41EB-409C-9B77-A945C07FA7E8}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {01F5D7C3-41EB-409C-9B77-A945C07FA7E8}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {01F5D7C3-41EB-409C-9B77-A945C07FA7E8}.Release|Any CPU.Build.0 = Release|Any CPU+ {C428C6E5-B0E5-4DA6-B0F7-43013D2ECE69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {C428C6E5-B0E5-4DA6-B0F7-43013D2ECE69}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {C428C6E5-B0E5-4DA6-B0F7-43013D2ECE69}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {C428C6E5-B0E5-4DA6-B0F7-43013D2ECE69}.Release|Any CPU.Build.0 = Release|Any CPU+ {09A373A0-8169-409F-8C37-3FBC1654B122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {09A373A0-8169-409F-8C37-3FBC1654B122}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {09A373A0-8169-409F-8C37-3FBC1654B122}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {09A373A0-8169-409F-8C37-3FBC1654B122}.Release|Any CPU.Build.0 = Release|Any CPU+ {A20B9894-F352-4338-872A-F215A241D43D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {A20B9894-F352-4338-872A-F215A241D43D}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {A20B9894-F352-4338-872A-F215A241D43D}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {A20B9894-F352-4338-872A-F215A241D43D}.Release|Any CPU.Build.0 = Release|Any CPU+ {8F7560CF-EEBB-4333-A69F-838CA40FD85D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {8F7560CF-EEBB-4333-A69F-838CA40FD85D}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {8F7560CF-EEBB-4333-A69F-838CA40FD85D}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {8F7560CF-EEBB-4333-A69F-838CA40FD85D}.Release|Any CPU.Build.0 = Release|Any CPU+ {97550E87-48C6-4EBF-85E1-413ABAE9DBFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {97550E87-48C6-4EBF-85E1-413ABAE9DBFD}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {97550E87-48C6-4EBF-85E1-413ABAE9DBFD}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {97550E87-48C6-4EBF-85E1-413ABAE9DBFD}.Release|Any CPU.Build.0 = Release|Any CPUEndGlobalSectionGlobalSection(SolutionProperties) = preSolutionHideSolutionNode = FALSE@@ -318,7 +342,6 @@ Global{FDD99AEC-4C57-4020-B23F-650612856102} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}{3FFD14E3-D6BC-4EA7-97A2-D21733060FD6} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{05A2FAD8-03B0-4B2F-82AF-2F6BF0F050E5} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}- {7EBF916A-A7B1-4B74-AF10-D705B7A18F58} = {C7A2D42D-9277-47AC-862B-D86DF9D6AD48}{B61D8008-7FB7-4C0E-8044-3A74AA63A596} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{F98BDA9B-8657-4BA8-9B03-BAEA454CAE60} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{45D6FC80-36F3-4967-9663-E20B63824621} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}@@ -333,37 +356,40 @@ Global{B61388CA-DC73-4B7F-A7B2-7B9A86C9229E} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}{9F9E6DED-3D92-4970-909A-70FC11F1A665} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{03E31CAA-3728-48D3-B936-9F11CF6C18FE} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}- {93AA4D0D-6EE4-44D5-AD77-7F73A3934544} = {C7A2D42D-9277-47AC-862B-D86DF9D6AD48}- {52958A60-3FF7-4243-9058-34A6E4F55C31} = {C7A2D42D-9277-47AC-862B-D86DF9D6AD48}{6A95E113-B824-4524-8F13-CD0C3E1C8804} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{815E937E-86D6-4476-9EC6-B7FBCBBB5DB6} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}- {834B4E85-64E5-4382-8465-548F332E5298} = {C7A2D42D-9277-47AC-862B-D86DF9D6AD48}{EFE0DC86-80FC-4D52-95B7-07654BA1A769} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{8EA16BAB-465A-4C07-ABC4-1070D40067E9} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}- {19679B75-CE3A-4DF0-A3F0-CA369D2760A4} = {C7A2D42D-9277-47AC-862B-D86DF9D6AD48}{6B82F26D-5040-4453-B21B-C8D1F913CE4C} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}- {0E635268-351C-4A6B-A28D-593D868C2CA4} = {C7A2D42D-9277-47AC-862B-D86DF9D6AD48}- {12079C18-A519-403F-BBFD-200A36A0C083} = {C7A2D42D-9277-47AC-862B-D86DF9D6AD48}{5C45981D-1319-4C25-935C-83D411CB28DF} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{5970868F-831E-418F-89A9-4EC599563E16} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}{143725E2-206C-4D37-93E4-9EDF699826B2} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}{3AF1CBEC-2877-41E9-92AE-3A391B2AA9E8} = {4BB66E06-37D8-45A0-9B97-DE590AFBA340}{42A8251C-E7B3-47BB-A82E-459952EBE132} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}{4BB66E06-37D8-45A0-9B97-DE590AFBA340} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}- {C7A2D42D-9277-47AC-862B-D86DF9D6AD48} = {FBFEAD1F-29EB-4D99-A672-0CD8473E10B9}- {616F30DF-1F41-4047-BAA4-64BA03BF5AEA} = {FBFEAD1F-29EB-4D99-A672-0CD8473E10B9}- {7228A701-C79D-4E15-BF45-48D11F721A84} = {616F30DF-1F41-4047-BAA4-64BA03BF5AEA}- {EDECD35D-6EB1-4CA8-A175-A66588C3481E} = {616F30DF-1F41-4047-BAA4-64BA03BF5AEA}- {F2F13EAF-05C6-4E90-B2E4-3FA0290D7F6E} = {616F30DF-1F41-4047-BAA4-64BA03BF5AEA}- {D826D5E4-31F4-4AB5-AC86-F7B4AD79314B} = {616F30DF-1F41-4047-BAA4-64BA03BF5AEA}- {D9F65DFD-368B-47DB-8BB5-0C74DED7F439} = {616F30DF-1F41-4047-BAA4-64BA03BF5AEA}- {6C9135E6-9D15-4D86-B3F4-9666DB87060A} = {FBFEAD1F-29EB-4D99-A672-0CD8473E10B9}{FD87BD33-4616-460B-AC85-A412BA08BB78} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}{E0C991D9-0DB8-471C-ADC9-5FB16E2A0106} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}{952827D4-8D4C-4327-AE4D-E8D25811EF35} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}{21C9EC49-E848-4EAE-932F-0862D44F7A80} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}{A905E29A-7110-497F-ADC5-2CE2A148FEA0} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}{D7E9D90B-5595-4E72-A90A-6DE20D9AB7AE} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}+ {84020C4A-933A-4693-9889-1B99304A7D76} = {668726B9-77BC-45CF-B576-0F0773BF1615}+ {5777515F-4053-42F9-AF2B-95D8D0F5384A} = {668726B9-77BC-45CF-B576-0F0773BF1615}+ {2E895A70-DF17-4C6C-BB84-F83B07C75AAD} = {668726B9-77BC-45CF-B576-0F0773BF1615}+ {20DA47F2-F6C4-4503-B9D4-420994E28EF0} = {668726B9-77BC-45CF-B576-0F0773BF1615}+ {1F86E48B-8674-4C20-A3BE-9431049A5BEC} = {668726B9-77BC-45CF-B576-0F0773BF1615}+ {CB8824F5-9475-451F-87E8-F2AEF2490A12} = {668726B9-77BC-45CF-B576-0F0773BF1615}+ {4385AFCF-AB4A-49B2-BEBA-D33C950E1EE6} = {668726B9-77BC-45CF-B576-0F0773BF1615}+ {462A357B-7BB9-4927-A9FD-4FB7675898E9} = {05B9C173-6441-4DCA-9AC4-E897EF75F331}+ {83BBB833-A2F0-4A4D-BA1B-8229FC9BCD4F} = {05B9C173-6441-4DCA-9AC4-E897EF75F331}+ {63280C12-3BE3-4C4E-805E-584CDC6BC1F5} = {05B9C173-6441-4DCA-9AC4-E897EF75F331}+ {EDA3EF83-FC7F-4BCF-945D-B893620EE4B1} = {05B9C173-6441-4DCA-9AC4-E897EF75F331}+ {01F5D7C3-41EB-409C-9B77-A945C07FA7E8} = {05B9C173-6441-4DCA-9AC4-E897EF75F331}+ {C428C6E5-B0E5-4DA6-B0F7-43013D2ECE69} = {7EB336C2-7C0A-4BC8-80C6-A3173AB8DC45}+ {09A373A0-8169-409F-8C37-3FBC1654B122} = {7EB336C2-7C0A-4BC8-80C6-A3173AB8DC45}+ {A20B9894-F352-4338-872A-F215A241D43D} = {7EB336C2-7C0A-4BC8-80C6-A3173AB8DC45}+ {8F7560CF-EEBB-4333-A69F-838CA40FD85D} = {7EB336C2-7C0A-4BC8-80C6-A3173AB8DC45}+ {97550E87-48C6-4EBF-85E1-413ABAE9DBFD} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}EndGlobalSectionGlobalSection(ExtensibilityGlobals) = postSolutionSolutionGuid = {93384647-528D-46C8-922C-8DB36A382F0B}diff --git a/dotnet/Directory.Build.props b/dotnet/Directory.Build.propsindex d61d6f4c7..bb78c84d1 100644--- a/dotnet/Directory.Build.props+++ b/dotnet/Directory.Build.props@@ -3,7 +3,7 @@<Import Project="./eng/MetaInfo.props" /><Import Project="./eng/Sign.props" /><PropertyGroup>- <PackageTargetFrameworks>netstandard2.0;net6.0;net8.0</PackageTargetFrameworks>+ <PackageTargetFrameworks>netstandard2.0;net8.0</PackageTargetFrameworks><TestTargetFrameworks>net8.0</TestTargetFrameworks><LangVersion>preview</LangVersion><Nullable>enable</Nullable>diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.propsindex 74949f880..dd9df7161 100644--- a/dotnet/Directory.Packages.props+++ b/dotnet/Directory.Packages.props@@ -3,8 +3,10 @@<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally><MicrosoftSemanticKernelVersion>1.22.0</MicrosoftSemanticKernelVersion><MicrosoftSemanticKernelExperimentalVersion>1.22.0-alpha</MicrosoftSemanticKernelExperimentalVersion>+ <MicrosoftExtensionsAIVersion>9.0.0-preview.9.24507.7</MicrosoftExtensionsAIVersion></PropertyGroup><ItemGroup>+ <PackageVersion Include="Aspire.Hosting" Version="9.0.0-rc.1.24511.1" /><PackageVersion Include="AspNetCore.Authentication.ApiKey" Version="8.0.1" /><PackageVersion Include="Aspire.Azure.AI.OpenAI" Version="8.0.1-preview.8.24267.1" /><PackageVersion Include="Aspire.Hosting.AppHost" Version="8.2.1" />@@ -39,7 +41,12 @@<PackageVersion Include="Microsoft.AspNetCore.App" Version="8.0.4" /><PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" /><PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />- <PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />+ <PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0-rc.2.24473.5" />+ <PackageVersion Include="Microsoft.Extensions.AI" Version="$(MicrosoftExtensionsAIVersion)" />+ <PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="$(MicrosoftExtensionsAIVersion)" />+ <PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="$(MicrosoftExtensionsAIVersion)" />+ <PackageVersion Include="Microsoft.Extensions.AI.Ollama" Version="$(MicrosoftExtensionsAIVersion)" />+ <PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="$(MicrosoftExtensionsAIVersion)" /><PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.6" /><PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" /><PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />@@ -104,6 +111,6 @@<PackageVersion Include="Moq" Version="4.20.72" /><PackageVersion Include="Microsoft.PowerShell.SDK" Version="7.4.5" /><PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.10" />- <PackageVersion Include="System.Text.Json" Version="8.0.5" />+ <PackageVersion Include="System.Text.Json" Version="9.0.0-rc.2.24473.5" /></ItemGroup></Project>\ No newline at end of filediff --git a/dotnet/samples/Hello/Hello.csproj b/dotnet/samples/Hello/Backend/Backend.csprojsimilarity index 56%rename from dotnet/samples/Hello/Hello.csprojrename to dotnet/samples/Hello/Backend/Backend.csprojindex bfd5d1a5c..60097b5d3 100644--- a/dotnet/samples/Hello/Hello.csproj+++ b/dotnet/samples/Hello/Backend/Backend.csproj@@ -1,19 +1,14 @@-<Project Sdk="Microsoft.NET.Sdk">-+<Project Sdk="Microsoft.NET.Sdk"><ItemGroup>- <ProjectReference Include="..\..\src\Microsoft.AutoGen\Agents\Microsoft.AutoGen.Agents.csproj" />- <ProjectReference Include="..\..\src\Microsoft.AutoGen\Runtime\Microsoft.AutoGen.Runtime.csproj" />+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Runtime\Microsoft.AutoGen.Runtime.csproj" /></ItemGroup>-<ItemGroup><PackageReference Include="Microsoft.Extensions.Hosting" /></ItemGroup>-<PropertyGroup><OutputType>Exe</OutputType><TargetFramework>net8.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>-</Project>diff --git a/dotnet/samples/Hello/Backend/Program.cs b/dotnet/samples/Hello/Backend/Program.csnew file mode 100644index 000000000..747e0d860--- /dev/null+++ b/dotnet/samples/Hello/Backend/Program.cs@@ -0,0 +1,5 @@+// Copyright (c) Microsoft. All rights reserved.+using Microsoft.Extensions.Hosting;++var app = await Microsoft.AutoGen.Runtime.Host.StartAsync(local: true);+await app.WaitForShutdownAsync();diff --git a/dotnet/samples/Hello/Backend/README.md b/dotnet/samples/Hello/Backend/README.mdnew file mode 100644index 000000000..45c7ddee1--- /dev/null+++ b/dotnet/samples/Hello/Backend/README.md@@ -0,0 +1,12 @@+# Backend Example++This example demonstrates how to create a simple backend service for the agent runtime using ASP.NET Core.++To Run it, simply run the following command in the terminal:++```bash+dotnet run+```++Or you can run it using Visual Studio Code by pressing `F5`.+diff --git a/dotnet/samples/Hello/Hello.AppHost/Hello.AppHost.csproj b/dotnet/samples/Hello/Hello.AppHost/Hello.AppHost.csprojnew file mode 100644index 000000000..3ecd30dee--- /dev/null+++ b/dotnet/samples/Hello/Hello.AppHost/Hello.AppHost.csproj@@ -0,0 +1,21 @@+<Project Sdk="Microsoft.NET.Sdk">++ <PropertyGroup>+ <OutputType>Exe</OutputType>+ <TargetFramework>net8.0</TargetFramework>+ <ImplicitUsings>enable</ImplicitUsings>+ <Nullable>enable</Nullable>+ <IsAspireHost>true</IsAspireHost>+ <UserSecretsId>ecb5cbe4-15d8-4120-8f18-d3ba4902915b</UserSecretsId>+ </PropertyGroup>++ <ItemGroup>+ <PackageReference Include="Aspire.Hosting.AppHost"/>+ <PackageReference Include="Aspire.Hosting"/>+ </ItemGroup>+ <ItemGroup>+ <ProjectReference Include="..\Backend\Backend.csproj" />+ <ProjectReference Include="..\HelloAgent\HelloAgent.csproj" />+ </ItemGroup>++</Project>diff --git a/dotnet/samples/Hello/Hello.AppHost/Program.cs b/dotnet/samples/Hello/Hello.AppHost/Program.csnew file mode 100644index 000000000..d7c37df8e--- /dev/null+++ b/dotnet/samples/Hello/Hello.AppHost/Program.cs@@ -0,0 +1,6 @@+// Copyright (c) Microsoft. All rights reserved.++var builder = DistributedApplication.CreateBuilder(args);+var backend = builder.AddProject<Projects.Backend>("backend");+builder.AddProject<Projects.HelloAgent>("client").WithReference(backend).WaitFor(backend);+builder.Build().Run();diff --git a/dotnet/samples/Hello/Hello.AppHost/appsettings.Development.json b/dotnet/samples/Hello/Hello.AppHost/appsettings.Development.jsonnew file mode 100644index 000000000..0c208ae91--- /dev/null+++ b/dotnet/samples/Hello/Hello.AppHost/appsettings.Development.json@@ -0,0 +1,8 @@+{+ "Logging": {+ "LogLevel": {+ "Default": "Information",+ "Microsoft.AspNetCore": "Warning"+ }+ }+}diff --git a/dotnet/samples/Hello/HelloAIAgents/HelloAIAgent.cs b/dotnet/samples/Hello/HelloAIAgents/HelloAIAgent.csnew file mode 100644index 000000000..935d1d50b--- /dev/null+++ b/dotnet/samples/Hello/HelloAIAgents/HelloAIAgent.cs@@ -0,0 +1,33 @@+using Microsoft.AutoGen.Abstractions;+using Microsoft.AutoGen.Agents;+using Microsoft.Extensions.AI;+using Microsoft.Extensions.DependencyInjection;++namespace Hello;+[TopicSubscription("HelloAgents")]+public class HelloAIAgent(+ IAgentContext context,+ [FromKeyedServices("EventTypes")] EventTypes typeRegistry,+ IChatClient client) : HelloAgent(+ context,+ typeRegistry),+ IHandle<NewMessageReceived>+{+ // This Handle supercedes the one in the base class+ public new async Task Handle(NewMessageReceived item)+ {+ var prompt = "Please write a limerick greeting someone with the name " + item.Message;+ var response = await client.CompleteAsync(prompt);+ var evt = new Output+ {+ Message = response.Message.Text+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(evt).ConfigureAwait(false);+ var goodbye = new ConversationClosed+ {+ UserId = this.AgentId.Key,+ UserMessage = "Goodbye"+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(goodbye).ConfigureAwait(false);+ }+}diff --git a/dotnet/samples/Hello/HelloAIAgents/HelloAIAgents.csproj b/dotnet/samples/Hello/HelloAIAgents/HelloAIAgents.csprojnew file mode 100644index 000000000..73f1891b3--- /dev/null+++ b/dotnet/samples/Hello/HelloAIAgents/HelloAIAgents.csproj@@ -0,0 +1,21 @@+<Project Sdk="Microsoft.NET.Sdk">++ <ItemGroup>+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Abstractions\Microsoft.AutoGen.Abstractions.csproj" />+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Agents\Microsoft.AutoGen.Agents.csproj" />+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Runtime\Microsoft.AutoGen.Runtime.csproj" />+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Extensions\AIModelClientHostingExtensions\AIModelClientHostingExtensions.csproj" />+ </ItemGroup>++ <ItemGroup>+ <PackageReference Include="Microsoft.Extensions.Hosting" />+ </ItemGroup>++ <PropertyGroup>+ <OutputType>Exe</OutputType>+ <TargetFramework>net8.0</TargetFramework>+ <ImplicitUsings>enable</ImplicitUsings>+ <Nullable>enable</Nullable>+ </PropertyGroup>++</Project>diff --git a/dotnet/samples/Hello/HelloAIAgents/Program.cs b/dotnet/samples/Hello/HelloAIAgents/Program.csnew file mode 100644index 000000000..d2239f22b--- /dev/null+++ b/dotnet/samples/Hello/HelloAIAgents/Program.cs@@ -0,0 +1,81 @@+using Hello;+using Microsoft.AspNetCore.Builder;+using Microsoft.AutoGen.Abstractions;+using Microsoft.AutoGen.Agents;+using Microsoft.Extensions.DependencyInjection;+using Microsoft.Extensions.Hosting;++// send a message to the agent+var builder = WebApplication.CreateBuilder();+// put these in your environment or appsettings.json+builder.Configuration["HelloAIAgents:ModelType"] = "azureopenai";+builder.Configuration["HelloAIAgents:LlmModelName"] = "gpt-3.5-turbo";+Environment.SetEnvironmentVariable("AZURE_OPENAI_CONNECTION_STRING", "Endpoint=https://TODO.openai.azure.com/;Key=TODO;Deployment=TODO");+if (Environment.GetEnvironmentVariable("AZURE_OPENAI_CONNECTION_STRING") == null)+{+ throw new InvalidOperationException("AZURE_OPENAI_CONNECTION_STRING not set, try something like AZURE_OPENAI_CONNECTION_STRING = \"Endpoint=https://TODO.openai.azure.com/;Key=TODO;Deployment=TODO\"");+}+builder.Configuration["ConectionStrings:HelloAIAgents"] = Environment.GetEnvironmentVariable("AZURE_OPENAI_CONNECTION_STRING");+builder.AddChatCompletionService("HelloAIAgents");+var agentTypes = new AgentTypes(new Dictionary<string, Type>+{+ { "HelloAIAgents", typeof(HelloAIAgent) }+});+var app = await AgentsApp.PublishMessageAsync("HelloAgents", new NewMessageReceived+{+ Message = "World"+}, builder, agentTypes, local: true);++await app.WaitForShutdownAsync();++namespace Hello+{+ [TopicSubscription("HelloAgents")]+ public class HelloAgent(+ IAgentContext context,+ [FromKeyedServices("EventTypes")] EventTypes typeRegistry) : ConsoleAgent(+ context,+ typeRegistry),+ ISayHello,+ IHandle<NewMessageReceived>,+ IHandle<ConversationClosed>+ {+ public async Task Handle(NewMessageReceived item)+ {+ var response = await SayHello(item.Message).ConfigureAwait(false);+ var evt = new Output+ {+ Message = response+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(evt).ConfigureAwait(false);+ var goodbye = new ConversationClosed+ {+ UserId = this.AgentId.Key,+ UserMessage = "Goodbye"+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(goodbye).ConfigureAwait(false);+ }+ public async Task Handle(ConversationClosed item)+ {+ var goodbye = $"********************* {item.UserId} said {item.UserMessage} ************************";+ var evt = new Output+ {+ Message = goodbye+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(evt).ConfigureAwait(false);+ //sleep30 seconds+ await Task.Delay(30000).ConfigureAwait(false);+ await AgentsApp.ShutdownAsync().ConfigureAwait(false);++ }+ public async Task<string> SayHello(string ask)+ {+ var response = $"\n\n\n\n***************Hello {ask}**********************\n\n\n\n";+ return response;+ }+ }+ public interface ISayHello+ {+ public Task<string> SayHello(string ask);+ }+}diff --git a/dotnet/samples/Hello/HelloAgent/HelloAgent.csproj b/dotnet/samples/Hello/HelloAgent/HelloAgent.csprojnew file mode 100644index 000000000..eb2ba96d6--- /dev/null+++ b/dotnet/samples/Hello/HelloAgent/HelloAgent.csproj@@ -0,0 +1,21 @@+<Project Sdk="Microsoft.NET.Sdk">++ <ItemGroup>+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Abstractions\Microsoft.AutoGen.Abstractions.csproj" />+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Agents\Microsoft.AutoGen.Agents.csproj" />+ <ProjectReference Include="..\..\..\src\Microsoft.AutoGen\Runtime\Microsoft.AutoGen.Runtime.csproj" />+ </ItemGroup>++ <ItemGroup>+ <PackageReference Include="Microsoft.Extensions.Hosting" />+ <PackageReference Include="Aspire.Hosting.AppHost" />+ </ItemGroup>++ <PropertyGroup>+ <OutputType>Exe</OutputType>+ <TargetFramework>net8.0</TargetFramework>+ <ImplicitUsings>enable</ImplicitUsings>+ <Nullable>enable</Nullable>+ </PropertyGroup>++</Project>diff --git a/dotnet/samples/Hello/Program.cs b/dotnet/samples/Hello/HelloAgent/Program.cssimilarity index 86%rename from dotnet/samples/Hello/Program.csrename to dotnet/samples/Hello/HelloAgent/Program.csindex 3335ff96c..d378a5b4f 100644--- a/dotnet/samples/Hello/Program.cs+++ b/dotnet/samples/Hello/HelloAgent/Program.cs@@ -1,15 +1,16 @@+// Copyright (c) Microsoft. All rights reserved.+using Microsoft.AutoGen.Abstractions;using Microsoft.AutoGen.Agents;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Hosting;// send a message to the agent-var app = await App.PublishMessageAsync("HelloAgents", new NewMessageReceived+var app = await AgentsApp.PublishMessageAsync("HelloAgents", new NewMessageReceived{Message = "World"-}, local: true);+}, local: false);-await App.RuntimeApp!.WaitForShutdownAsync();await app.WaitForShutdownAsync();namespace Hello@@ -47,7 +48,10 @@ namespace HelloMessage = goodbye}.ToCloudEvent(this.AgentId.Key);await PublishEvent(evt).ConfigureAwait(false);- await App.ShutdownAsync();+ //sleep+ await Task.Delay(10000).ConfigureAwait(false);+ await AgentsApp.ShutdownAsync().ConfigureAwait(false);+}public async Task<string> SayHello(string ask){diff --git a/dotnet/samples/Hello/HelloAgent/README.md b/dotnet/samples/Hello/HelloAgent/README.mdnew file mode 100644index 000000000..795eed072--- /dev/null+++ b/dotnet/samples/Hello/HelloAgent/README.md@@ -0,0 +1,121 @@+# AutoGen 0.4 .NET Hello World Sample++This [sample](Program.cs) demonstrates how to create a simple .NET console application that listens for an event and then orchestrates a series of actions in response.++## Prerequisites++To run this sample, you'll need: [.NET 8.0](https://dotnet.microsoft.com/en-us/) or later.+Also recommended is the [GitHub CLI](https://cli.github.com/).++## Instructions to run the sample++```bash+# Clone the repository+gh repo clone microsoft/autogen+cd dotnet/samples/Hello+dotnet run+```++## Key Concepts++This sample illustrates how to create your own agent that inherits from a base agent and listens for an event. It also shows how to use the SDK's App Runtime locally to start the agent and send messages.++Flow Diagram:++```mermaid+%%{init: {'theme':'forest'}}%%+graph LR;+ A[Main] --> |"PublishEvent(NewMessage('World'))"| B{"Handle(NewMessageReceived item)"}+ B --> |"PublishEvent(Output('***Hello, World***'))"| C[ConsoleAgent]+ C --> D{"WriteConsole()"}+ B --> |"PublishEvent(ConversationClosed('Goodbye'))"| E{"Handle(ConversationClosed item)"}+ B --> |"PublishEvent(Output('***Goodbye***'))"| C+ E --> F{"Shutdown()"}++```++### Writing Event Handlers++The heart of an autogen application are the event handlers. Agents select a ```TopicSubscription``` to listen for events on a specific topic. When an event is received, the agent's event handler is called with the event data.++Within that event handler you may optionally *emit* new events, which are then sent to the event bus for other agents to process. The EventTypes are declared gRPC ProtoBuf messages that are used to define the schema of the event. The default protos are available via the ```Microsoft.AutoGen.Abstractions;``` namespace and are defined in [autogen/protos](/autogen/protos). The EventTypes are registered in the agent's constructor using the ```IHandle``` interface.++```csharp+TopicSubscription("HelloAgents")]+public class HelloAgent(+ IAgentContext context,+ [FromKeyedServices("EventTypes")] EventTypes typeRegistry) : ConsoleAgent(+ context,+ typeRegistry),+ ISayHello,+ IHandle<NewMessageReceived>,+ IHandle<ConversationClosed>+{+ public async Task Handle(NewMessageReceived item)+ {+ var response = await SayHello(item.Message).ConfigureAwait(false);+ var evt = new Output+ {+ Message = response+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(evt).ConfigureAwait(false);+ var goodbye = new ConversationClosed+ {+ UserId = this.AgentId.Key,+ UserMessage = "Goodbye"+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(goodbye).ConfigureAwait(false);+ }+```++### Inheritance and Composition++This sample also illustrates inheritance in AutoGen. The `HelloAgent` class inherits from `ConsoleAgent`, which is a base class that provides a `WriteConsole` method.++### Starting the Application Runtime++AuotoGen provides a flexible runtime ```Microsoft.AutoGen.Agents.App``` that can be started in a variety of ways. The `Program.cs` file demonstrates how to start the runtime locally and send a message to the agent all in one go using the ```App.PublishMessageAsync``` method.++```csharp+// send a message to the agent+var app = await App.PublishMessageAsync("HelloAgents", new NewMessageReceived+{+ Message = "World"+}, local: true);++await App.RuntimeApp!.WaitForShutdownAsync();+await app.WaitForShutdownAsync();+```++### Sending Messages++The set of possible Messages is defined in gRPC ProtoBuf specs. These are then turned into C# classes by the gRPC tools. You can define your own Message types by creating a new .proto file in your project and including the gRPC tools in your ```.csproj``` file:++```proto+syntax = "proto3";+package devteam;+option csharp_namespace = "DevTeam.Shared";+message NewAsk {+ string org = 1;+ string repo = 2;+ string ask = 3;+ int64 issue_number = 4;+}+message ReadmeRequested {+ string org = 1;+ string repo = 2;+ int64 issue_number = 3;+ string ask = 4;+}+```+++```xml+ <ItemGroup>+ <PackageReference Include="Google.Protobuf" />+ <PackageReference Include="Grpc.Tools" PrivateAssets="All" />+ <Protobuf Include="..\Protos\messages.proto" Link="Protos\messages.proto" />+ </ItemGroup>+```++You can send messages using the [```Microsoft.AutoGen.Agents.AgentClient``` class](autogen/dotnet/src/Microsoft.AutoGen/Agents/AgentClient.cs). Messages are wrapped in [the CloudEvents specification](https://cloudevents.io) and sent to the event bus.diff --git a/dotnet/samples/Hello/README.md b/dotnet/samples/Hello/README.mdindex 795eed072..fc92a2fe5 100644--- a/dotnet/samples/Hello/README.md+++ b/dotnet/samples/Hello/README.md@@ -1,121 +1,10 @@-# AutoGen 0.4 .NET Hello World Sample+# Multiproject App Host for HelloAgent-This [sample](Program.cs) demonstrates how to create a simple .NET console application that listens for an event and then orchestrates a series of actions in response.+This is a [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview) App Host that starts up the HelloAgent project and the agents backend. Once the project starts up you will be able to view the telemetry and logs in the [Aspire Dashboard](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-dashboard) using the link provided in the console.-## Prerequisites--To run this sample, you'll need: [.NET 8.0](https://dotnet.microsoft.com/en-us/) or later.-Also recommended is the [GitHub CLI](https://cli.github.com/).--## Instructions to run the sample--```bash-# Clone the repository-gh repo clone microsoft/autogen-cd dotnet/samples/Hello+```shell+cd Hello.AppHostdotnet run```-## Key Concepts--This sample illustrates how to create your own agent that inherits from a base agent and listens for an event. It also shows how to use the SDK's App Runtime locally to start the agent and send messages.--Flow Diagram:--```mermaid-%%{init: {'theme':'forest'}}%%-graph LR;- A[Main] --> |"PublishEvent(NewMessage('World'))"| B{"Handle(NewMessageReceived item)"}- B --> |"PublishEvent(Output('***Hello, World***'))"| C[ConsoleAgent]- C --> D{"WriteConsole()"}- B --> |"PublishEvent(ConversationClosed('Goodbye'))"| E{"Handle(ConversationClosed item)"}- B --> |"PublishEvent(Output('***Goodbye***'))"| C- E --> F{"Shutdown()"}--```--### Writing Event Handlers--The heart of an autogen application are the event handlers. Agents select a ```TopicSubscription``` to listen for events on a specific topic. When an event is received, the agent's event handler is called with the event data.--Within that event handler you may optionally *emit* new events, which are then sent to the event bus for other agents to process. The EventTypes are declared gRPC ProtoBuf messages that are used to define the schema of the event. The default protos are available via the ```Microsoft.AutoGen.Abstractions;``` namespace and are defined in [autogen/protos](/autogen/protos). The EventTypes are registered in the agent's constructor using the ```IHandle``` interface.--```csharp-TopicSubscription("HelloAgents")]-public class HelloAgent(- IAgentContext context,- [FromKeyedServices("EventTypes")] EventTypes typeRegistry) : ConsoleAgent(- context,- typeRegistry),- ISayHello,- IHandle<NewMessageReceived>,- IHandle<ConversationClosed>-{- public async Task Handle(NewMessageReceived item)- {- var response = await SayHello(item.Message).ConfigureAwait(false);- var evt = new Output- {- Message = response- }.ToCloudEvent(this.AgentId.Key);- await PublishEvent(evt).ConfigureAwait(false);- var goodbye = new ConversationClosed- {- UserId = this.AgentId.Key,- UserMessage = "Goodbye"- }.ToCloudEvent(this.AgentId.Key);- await PublishEvent(goodbye).ConfigureAwait(false);- }-```--### Inheritance and Composition--This sample also illustrates inheritance in AutoGen. The `HelloAgent` class inherits from `ConsoleAgent`, which is a base class that provides a `WriteConsole` method.--### Starting the Application Runtime--AuotoGen provides a flexible runtime ```Microsoft.AutoGen.Agents.App``` that can be started in a variety of ways. The `Program.cs` file demonstrates how to start the runtime locally and send a message to the agent all in one go using the ```App.PublishMessageAsync``` method.--```csharp-// send a message to the agent-var app = await App.PublishMessageAsync("HelloAgents", new NewMessageReceived-{- Message = "World"-}, local: true);--await App.RuntimeApp!.WaitForShutdownAsync();-await app.WaitForShutdownAsync();-```--### Sending Messages--The set of possible Messages is defined in gRPC ProtoBuf specs. These are then turned into C# classes by the gRPC tools. You can define your own Message types by creating a new .proto file in your project and including the gRPC tools in your ```.csproj``` file:--```proto-syntax = "proto3";-package devteam;-option csharp_namespace = "DevTeam.Shared";-message NewAsk {- string org = 1;- string repo = 2;- string ask = 3;- int64 issue_number = 4;-}-message ReadmeRequested {- string org = 1;- string repo = 2;- int64 issue_number = 3;- string ask = 4;-}-```---```xml- <ItemGroup>- <PackageReference Include="Google.Protobuf" />- <PackageReference Include="Grpc.Tools" PrivateAssets="All" />- <Protobuf Include="..\Protos\messages.proto" Link="Protos\messages.proto" />- </ItemGroup>-```--You can send messages using the [```Microsoft.AutoGen.Agents.AgentClient``` class](autogen/dotnet/src/Microsoft.AutoGen/Agents/AgentClient.cs). Messages are wrapped in [the CloudEvents specification](https://cloudevents.io) and sent to the event bus.+For more info see the HelloAgent [README](../HelloAgent/README.md).diff --git a/dotnet/samples/dev-team/DevTeam.Agents/Developer/Developer.cs b/dotnet/samples/dev-team/DevTeam.Agents/Developer/Developer.csindex 47a389ad7..706325182 100644--- a/dotnet/samples/dev-team/DevTeam.Agents/Developer/Developer.cs+++ b/dotnet/samples/dev-team/DevTeam.Agents/Developer/Developer.cs@@ -8,7 +8,7 @@ namespace DevTeam.Agents;[TopicSubscription("devteam")]public class Dev(IAgentContext context, Kernel kernel, ISemanticTextMemory memory, [FromKeyedServices("EventTypes")] EventTypes typeRegistry, ILogger<Dev> logger)- : AiAgent<DeveloperState>(context, memory, kernel, typeRegistry), IDevelopApps,+ : SKAiAgent<DeveloperState>(context, memory, kernel, typeRegistry), IDevelopApps,IHandle<CodeGenerationRequested>,IHandle<CodeChainClosed>{diff --git a/dotnet/samples/dev-team/DevTeam.Agents/DeveloperLead/DeveloperLead.cs b/dotnet/samples/dev-team/DevTeam.Agents/DeveloperLead/DeveloperLead.csindex c3e5e2fea..a0bd80497 100644--- a/dotnet/samples/dev-team/DevTeam.Agents/DeveloperLead/DeveloperLead.cs+++ b/dotnet/samples/dev-team/DevTeam.Agents/DeveloperLead/DeveloperLead.cs@@ -9,7 +9,7 @@ namespace DevTeam.Agents;[TopicSubscription("devteam")]public class DeveloperLead(IAgentContext context, Kernel kernel, ISemanticTextMemory memory, [FromKeyedServices("EventTypes")] EventTypes typeRegistry, ILogger<DeveloperLead> logger)- : AiAgent<DeveloperLeadState>(context, memory, kernel, typeRegistry), ILeadDevelopers,+ : SKAiAgent<DeveloperLeadState>(context, memory, kernel, typeRegistry), ILeadDevelopers,IHandle<DevPlanRequested>,IHandle<DevPlanChainClosed>{diff --git a/dotnet/samples/dev-team/DevTeam.Agents/ProductManager/ProductManager.cs b/dotnet/samples/dev-team/DevTeam.Agents/ProductManager/ProductManager.csindex 36bb34c3a..a5bdca19d 100644--- a/dotnet/samples/dev-team/DevTeam.Agents/ProductManager/ProductManager.cs+++ b/dotnet/samples/dev-team/DevTeam.Agents/ProductManager/ProductManager.cs@@ -8,7 +8,7 @@ namespace DevTeam.Agents;[TopicSubscription("devteam")]public class ProductManager(IAgentContext context, Kernel kernel, ISemanticTextMemory memory, [FromKeyedServices("EventTypes")] EventTypes typeRegistry, ILogger<ProductManager> logger)- : AiAgent<ProductManagerState>(context, memory, kernel, typeRegistry), IManageProducts,+ : SKAiAgent<ProductManagerState>(context, memory, kernel, typeRegistry), IManageProducts,IHandle<ReadmeChainClosed>,IHandle<ReadmeRequested>{diff --git a/dotnet/samples/dev-team/DevTeam.Backend/Agents/AzureGenie.cs b/dotnet/samples/dev-team/DevTeam.Backend/Agents/AzureGenie.csindex 0c9aabe9b..61c618acd 100644--- a/dotnet/samples/dev-team/DevTeam.Backend/Agents/AzureGenie.cs+++ b/dotnet/samples/dev-team/DevTeam.Backend/Agents/AzureGenie.cs@@ -7,7 +7,7 @@ using Microsoft.SemanticKernel.Memory;namespace Microsoft.AI.DevTeam;public class AzureGenie(IAgentContext context, Kernel kernel, ISemanticTextMemory memory, [FromKeyedServices("EventTypes")] EventTypes typeRegistry, IManageAzure azureService)- : AiAgent<object>(context, memory, kernel, typeRegistry),+ : SKAiAgent<object>(context, memory, kernel, typeRegistry),IHandle<ReadmeCreated>,IHandle<CodeCreated>diff --git a/dotnet/samples/dev-team/DevTeam.Backend/Agents/Hubber.cs b/dotnet/samples/dev-team/DevTeam.Backend/Agents/Hubber.csindex e0107c2ea..f42eb4763 100644--- a/dotnet/samples/dev-team/DevTeam.Backend/Agents/Hubber.cs+++ b/dotnet/samples/dev-team/DevTeam.Backend/Agents/Hubber.cs@@ -10,7 +10,7 @@ using Microsoft.SemanticKernel.Memory;namespace Microsoft.AI.DevTeam;public class Hubber(IAgentContext context, Kernel kernel, ISemanticTextMemory memory, [FromKeyedServices("EventTypes")] EventTypes typeRegistry, IManageGithub ghService)- : AiAgent<object>(context, memory, kernel, typeRegistry),+ : SKAiAgent<object>(context, memory, kernel, typeRegistry),IHandle<NewAsk>,IHandle<ReadmeGenerated>,IHandle<DevPlanGenerated>,diff --git a/dotnet/src/AutoGen.WebAPI/AutoGen.WebAPI.csproj b/dotnet/src/AutoGen.WebAPI/AutoGen.WebAPI.csprojindex 5467f6638..fe549d969 100644--- a/dotnet/src/AutoGen.WebAPI/AutoGen.WebAPI.csproj+++ b/dotnet/src/AutoGen.WebAPI/AutoGen.WebAPI.csproj@@ -1,7 +1,7 @@<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup>- <TargetFrameworks>net6.0;net8.0</TargetFrameworks>+ <TargetFrameworks>net8.0</TargetFrameworks><GenerateDocumentationFile>true</GenerateDocumentationFile><NoWarn>$(NoWarn);CS1591;CS1573;CA1852</NoWarn></PropertyGroup>diff --git a/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs b/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.csindex 19352ea69..0f815e3d2 100644--- a/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs+++ b/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs@@ -4,7 +4,6 @@ namespace Microsoft.AutoGen.Agents;public static class AgentBaseExtensions{-public static Activity? ExtractActivity(this AgentBase agent, string activityName, IDictionary<string, string> metadata){Activity? activity = null;@@ -61,10 +60,9 @@ public static class AgentBaseExtensionsreturn activity;}-public static async Task InvokeWithActivityAsync<TState>(this AgentBase agent, Func<TState, Task> func, TState state, Activity? activity, string methodName){- if (activity is not null)+ if (activity is not null && activity.StartTimeUtc == default){activity.Start();diff --git a/dotnet/src/Microsoft.AutoGen/Agents/AgentWorkerRuntime.cs b/dotnet/src/Microsoft.AutoGen/Agents/AgentWorkerRuntime.csindex cefadf7b5..d0df48f71 100644--- a/dotnet/src/Microsoft.AutoGen/Agents/AgentWorkerRuntime.cs+++ b/dotnet/src/Microsoft.AutoGen/Agents/AgentWorkerRuntime.cs@@ -64,6 +64,11 @@ public sealed class AgentWorkerRuntime : IHostedService, IDisposable, IAgentWork{await foreach (var message in channel.ResponseStream.ReadAllAsync(_shutdownCts.Token)){+ // next if message is null+ if (message == null)+ {+ continue;+ }switch (message.MessageCase){case Message.MessageOneofCase.Request:diff --git a/dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/InferenceAgent.cs b/dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/InferenceAgent.csnew file mode 100644index 000000000..e1f932fa6--- /dev/null+++ b/dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/InferenceAgent.cs@@ -0,0 +1,30 @@+using Microsoft.Extensions.AI;+namespace Microsoft.AutoGen.Agents.Client;+public abstract class InferenceAgent<T> : AgentBase where T : class, new()+{+ protected IChatClient ChatClient { get; }+ public InferenceAgent(+ IAgentContext context,+ EventTypes typeRegistry, IChatClient client+ ) : base(context, typeRegistry)+ {+ ChatClient = client;+ }++ private Task<ChatCompletion> CompleteAsync(+ IList<ChatMessage> chatMessages,+ ChatOptions? options = null,+ CancellationToken cancellationToken = default)+ {+ return ChatClient.CompleteAsync(chatMessages, options, cancellationToken);+ }++ private IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(+ IList<ChatMessage> chatMessages,+ ChatOptions? options = null,+ CancellationToken cancellationToken = default)+ {+ return ChatClient.CompleteStreamingAsync(chatMessages, options, cancellationToken);+ }++}diff --git a/dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/AiAgent.cs b/dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/SKAiAgent.cssimilarity index 91%rename from dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/AiAgent.csrename to dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/SKAiAgent.csindex d5b4675e8..84bd2f821 100644--- a/dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/AiAgent.cs+++ b/dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/SKAiAgent.cs@@ -7,13 +7,13 @@ using Microsoft.SemanticKernel.Connectors.OpenAI;using Microsoft.SemanticKernel.Memory;namespace Microsoft.AutoGen.Agents;-public abstract class AiAgent<T> : AgentBase where T : class, new()+public abstract class SKAiAgent<T> : AgentBase where T : class, new(){protected AgentState<T> _state;protected Kernel _kernel;private readonly ISemanticTextMemory _memory;- public AiAgent(IAgentContext context, ISemanticTextMemory memory, Kernel kernel, EventTypes typeRegistry) : base(context, typeRegistry)+ public SKAiAgent(IAgentContext context, ISemanticTextMemory memory, Kernel kernel, EventTypes typeRegistry) : base(context, typeRegistry){_state = new();_memory = memory;@@ -63,7 +63,6 @@ public abstract class AiAgent<T> : AgentBase where T : class, new()}}-// TODO Remove history when we introduce memory bankspublic class AgentState<T> where T : class, new(){public List<ChatHistoryItem> History { get; set; } = [];diff --git a/dotnet/src/Microsoft.AutoGen/Agents/App.cs b/dotnet/src/Microsoft.AutoGen/Agents/App.csindex 4a246f5dd..00c487ede 100644--- a/dotnet/src/Microsoft.AutoGen/Agents/App.cs+++ b/dotnet/src/Microsoft.AutoGen/Agents/App.cs@@ -1,55 +1,70 @@+using System.Diagnostics.CodeAnalysis;using Google.Protobuf;using Microsoft.AspNetCore.Builder;+using Microsoft.AutoGen.Runtime;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Hosting;namespace Microsoft.AutoGen.Agents;-public static class App+public static class AgentsApp{// need a variable to store the runtime instance- public static WebApplication? RuntimeApp { get; set; }- public static WebApplication? ClientApp { get; set; }- public static async ValueTask<WebApplication> StartAsync(AgentTypes? agentTypes = null, bool local = false)+ public static WebApplication? Host { get; private set; }+ [MemberNotNull(nameof(Host))]+ public static async ValueTask<WebApplication> StartAsync(WebApplicationBuilder? builder = null, AgentTypes? agentTypes = null, bool local = false){- // start the server runtime- RuntimeApp ??= await Runtime.Host.StartAsync(local);- var clientBuilder = WebApplication.CreateBuilder();- clientBuilder.AddServiceDefaults();- var appBuilder = clientBuilder.AddAgentWorker();- agentTypes ??= AgentTypes.GetAgentTypesFromAssembly()- ?? throw new InvalidOperationException("No agent types found in the assembly");- foreach (var type in agentTypes.Types)+ builder ??= WebApplication.CreateBuilder();+ if (local)+ {+ // start the server runtime+ builder.AddLocalAgentService();+ }+ builder.AddAgentWorker()+ .AddAgents(agentTypes);+ builder.AddServiceDefaults();+ var app = builder.Build();+ if (local){- appBuilder.AddAgent(type.Key, type.Value);+ app.MapAgentService();}- ClientApp = clientBuilder.Build();- await ClientApp.StartAsync().ConfigureAwait(false);- return ClientApp;+ app.MapDefaultEndpoints();+ Host = app;+ await app.StartAsync().ConfigureAwait(false);+ return Host;}-public static async ValueTask<WebApplication> PublishMessageAsync(string topic,IMessage message,- AgentTypes? agentTypes = null,+ WebApplicationBuilder? builder = null,+ AgentTypes? agents = null,bool local = false){- if (ClientApp == null)+ if (Host == null){- ClientApp = await App.StartAsync(agentTypes, local);+ await StartAsync(builder, agents, local);}- var client = ClientApp.Services.GetRequiredService<AgentClient>() ?? throw new InvalidOperationException("Client not started");+ var client = Host.Services.GetRequiredService<AgentClient>() ?? throw new InvalidOperationException("Host not started");await client.PublishEventAsync(topic, message).ConfigureAwait(false);- return ClientApp;+ return Host;}-public static async ValueTask ShutdownAsync(){- if (ClientApp == null)+ if (Host == null)+ {+ throw new InvalidOperationException("Host not started");+ }+ await Host.StopAsync();+ }++ private static AgentApplicationBuilder AddAgents(this AgentApplicationBuilder builder, AgentTypes? agentTypes)+ {+ agentTypes ??= AgentTypes.GetAgentTypesFromAssembly()+ ?? throw new InvalidOperationException("No agent types found in the assembly");+ foreach (var type in agentTypes.Types){- throw new InvalidOperationException("Client not started");+ builder.AddAgent(type.Key, type.Value);}- await ClientApp.StopAsync();- await RuntimeApp!.StopAsync();+ return builder;}}diff --git a/dotnet/src/Microsoft.AutoGen/Agents/Microsoft.AutoGen.Agents.csproj b/dotnet/src/Microsoft.AutoGen/Agents/Microsoft.AutoGen.Agents.csprojindex 60b0bd4a9..5c921fc2b 100644--- a/dotnet/src/Microsoft.AutoGen/Agents/Microsoft.AutoGen.Agents.csproj+++ b/dotnet/src/Microsoft.AutoGen/Agents/Microsoft.AutoGen.Agents.csproj@@ -17,6 +17,7 @@</ItemGroup><ItemGroup>+ <PackageReference Include="Microsoft.Extensions.AI.Abstractions" /><PackageReference Include="Microsoft.Extensions.DependencyInjection" /><PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" /></ItemGroup>diff --git a/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/AIModelClientHostingExtensions.cs b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/AIModelClientHostingExtensions.csnew file mode 100644index 000000000..41e91ef1d--- /dev/null+++ b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/AIModelClientHostingExtensions.cs@@ -0,0 +1,33 @@+using Microsoft.Extensions.AI;++namespace Microsoft.Extensions.Hosting+{+ public static class AIModelClient+ {+ public static IHostApplicationBuilder AddChatCompletionService(this IHostApplicationBuilder builder, string serviceName)+ {+ var pipeline = (ChatClientBuilder pipeline) => pipeline+ .UseLogging()+ .UseFunctionInvocation()+ .UseOpenTelemetry(configure: c => c.EnableSensitiveData = true);++ if (builder.Configuration[$"{serviceName}:ModelType"] == "ollama")+ {+ builder.AddOllamaChatClient(serviceName, pipeline);+ }+ else if (builder.Configuration[$"{serviceName}:ModelType"] == "openai" || builder.Configuration[$"{serviceName}:ModelType"] == "azureopenai")+ {+ builder.AddOpenAIChatClient(serviceName, pipeline);+ }+ else if (builder.Configuration[$"{serviceName}:ModelType"] == "azureaiinference")+ {+ builder.AddAzureChatClient(serviceName, pipeline);+ }+ else+ {+ throw new InvalidOperationException("Did not find a valid model implementation for the given service name ${serviceName}, valid supported implemenation types are ollama, openai, azureopenai, azureaiinference");+ }+ return builder;+ }+ }+}diff --git a/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/AIModelClientHostingExtensions.csproj b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/AIModelClientHostingExtensions.csprojnew file mode 100644index 000000000..a94921946--- /dev/null+++ b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/AIModelClientHostingExtensions.csproj@@ -0,0 +1,18 @@+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup>+ <TargetFramework>net8.0</TargetFramework>+ <ImplicitUsings>enable</ImplicitUsings>+ <Nullable>enable</Nullable>+ </PropertyGroup>+ <ItemGroup>+ <PackageReference Include="Aspire.Azure.AI.OpenAI" />+ <PackageReference Include="Azure.AI.OpenAI" />+ <PackageReference Include="Azure.Identity" />+ <PackageReference Include="Microsoft.Extensions.AI" />+ <PackageReference Include="Microsoft.Extensions.AI.AzureAIInference" />+ <PackageReference Include="Microsoft.Extensions.AI.Ollama" />+ <PackageReference Include="Microsoft.Extensions.AI.OpenAI" />+ <PackageReference Include="Microsoft.Extensions.DependencyInjection" />+ <PackageReference Include="Microsoft.Extensions.Hosting" />+ </ItemGroup>+</Project>diff --git a/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/Options/OpenAIOptions.cs b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/Options/AIClientOptions.cssimilarity index 83%rename from dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/Options/OpenAIOptions.csrename to dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/Options/AIClientOptions.csindex 2db5cb14b..57d6e1a61 100644--- a/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/Options/OpenAIOptions.cs+++ b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/Options/AIClientOptions.cs@@ -1,9 +1,12 @@using System.ComponentModel.DataAnnotations;-namespace Microsoft.AutoGen.Extensions.SemanticKernel;+namespace Microsoft.Extensions.Hosting;-public class OpenAIOptions+public class AIClientOptions{+ // Model Classname+ [Required]+ public required string ModelType { get; set; }// Embeddings[Required]public required string EmbeddingsEndpoint { get; set; }diff --git a/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/ServiceCollectionChatCompletionExtensions.cs b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/ServiceCollectionChatCompletionExtensions.csnew file mode 100644index 000000000..9511d7e73--- /dev/null+++ b/dotnet/src/Microsoft.AutoGen/Extensions/AIModelClientHostingExtensions/ServiceCollectionChatCompletionExtensions.cs@@ -0,0 +1,117 @@+using System.ClientModel;+using System.Data.Common;+using Azure;+using Azure.AI.Inference;+using Azure.AI.OpenAI;+using Microsoft.Extensions.AI;+using Microsoft.Extensions.Configuration;+using Microsoft.Extensions.DependencyInjection;+using OpenAI;++namespace Microsoft.Extensions.Hosting;+public static class ServiceCollectionChatClientExtensions+{+ public static IServiceCollection AddOllamaChatClient(+ this IHostApplicationBuilder hostBuilder,+ string serviceName,+ Func<ChatClientBuilder, ChatClientBuilder>? builder = null,+ string? modelName = null)+ {+ if (modelName is null)+ {+ var configKey = $"{serviceName}:LlmModelName";+ modelName = hostBuilder.Configuration[configKey];+ if (string.IsNullOrEmpty(modelName))+ {+ throw new InvalidOperationException($"No {nameof(modelName)} was specified, and none could be found from configuration at '{configKey}'");+ }+ }+ return hostBuilder.Services.AddOllamaChatClient(+ modelName,+ new Uri($"http://{serviceName}"),+ builder);+ }+ public static IServiceCollection AddOllamaChatClient(+ this IServiceCollection services,+ string modelName,+ Uri? uri = null,+ Func<ChatClientBuilder, ChatClientBuilder>? builder = null)+ {+ uri ??= new Uri("http://localhost:11434");+ return services.AddChatClient(pipeline =>+ {+ builder?.Invoke(pipeline);+ var httpClient = pipeline.Services.GetService<HttpClient>() ?? new();+ return pipeline.Use(new OllamaChatClient(uri, modelName, httpClient));+ });+ }+ public static IServiceCollection AddOpenAIChatClient(+ this IHostApplicationBuilder hostBuilder,+ string serviceName,+ Func<ChatClientBuilder, ChatClientBuilder>? builder = null,+ string? modelOrDeploymentName = null)+ {+ // TODO: We would prefer to use Aspire.AI.OpenAI here,+ var connectionString = hostBuilder.Configuration.GetConnectionString(serviceName);+ if (string.IsNullOrWhiteSpace(connectionString))+ {+ throw new InvalidOperationException($"No connection string named '{serviceName}' was found. Ensure a corresponding Aspire service was registered.");+ }+ var connectionStringBuilder = new DbConnectionStringBuilder();+ connectionStringBuilder.ConnectionString = connectionString;+ var endpoint = (string?)connectionStringBuilder["endpoint"];+ var apiKey = (string)connectionStringBuilder["key"] ?? throw new InvalidOperationException($"The connection string named '{serviceName}' does not specify a value for 'Key', but this is required.");++ modelOrDeploymentName ??= (connectionStringBuilder["Deployment"] ?? connectionStringBuilder["Model"]) as string;+ if (string.IsNullOrWhiteSpace(modelOrDeploymentName))+ {+ throw new InvalidOperationException($"The connection string named '{serviceName}' does not specify a value for 'Deployment' or 'Model', and no value was passed for {nameof(modelOrDeploymentName)}.");+ }++ var endpointUri = string.IsNullOrEmpty(endpoint) ? null : new Uri(endpoint);+ return hostBuilder.Services.AddOpenAIChatClient(apiKey, modelOrDeploymentName, endpointUri, builder);+ }+ public static IServiceCollection AddOpenAIChatClient(+ this IServiceCollection services,+ string apiKey,+ string modelOrDeploymentName,+ Uri? endpoint = null,+ Func<ChatClientBuilder, ChatClientBuilder>? builder = null)+ {+ return services+ .AddSingleton(_ => endpoint is null+ ? new OpenAIClient(apiKey)+ : new AzureOpenAIClient(endpoint, new ApiKeyCredential(apiKey)))+ .AddChatClient(pipeline =>+ {+ builder?.Invoke(pipeline);+ var openAiClient = pipeline.Services.GetRequiredService<OpenAIClient>();+ return pipeline.Use(openAiClient.AsChatClient(modelOrDeploymentName));+ });+ }+ public static IServiceCollection AddAzureChatClient(+ this IHostApplicationBuilder hostBuilder,+ string serviceName,+ Func<ChatClientBuilder, ChatClientBuilder>? builder = null,+ string? modelOrDeploymentName = null)+ {+ if (modelOrDeploymentName is null)+ {+ var configKey = $"{serviceName}:LlmModelName";+ modelOrDeploymentName = hostBuilder.Configuration[configKey];+ if (string.IsNullOrEmpty(modelOrDeploymentName))+ {+ throw new InvalidOperationException($"No {nameof(modelOrDeploymentName)} was specified, and none could be found from configuration at '{configKey}'");+ }+ }+ var endpoint = $"{serviceName}:Endpoint" ?? throw new InvalidOperationException($"No endpoint was specified for the Azure Inference Chat Client");+ var endpointUri = string.IsNullOrEmpty(endpoint) ? null : new Uri(endpoint);+ return hostBuilder.Services.AddChatClient(pipeline =>+ {+ builder?.Invoke(pipeline);+ var token = Environment.GetEnvironmentVariable("GH_TOKEN") ?? throw new InvalidOperationException("No model access token was found in the environment variable GH_TOKEN");+ return pipeline.Use(new ChatCompletionsClient(+ endpointUri, new AzureKeyCredential(token)).AsChatClient(modelOrDeploymentName));+ });+ }+}diff --git a/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/Microsoft.AutoGen.Extensions.SemanticKernel.csproj b/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/Microsoft.AutoGen.Extensions.SemanticKernel.csprojindex 9f3f44230..a976c0077 100644--- a/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/Microsoft.AutoGen.Extensions.SemanticKernel.csproj+++ b/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/Microsoft.AutoGen.Extensions.SemanticKernel.csproj@@ -2,6 +2,7 @@<ItemGroup><ProjectReference Include="../../Agents/Microsoft.AutoGen.Agents.csproj" />+ <ProjectReference Include="..\AIModelClientHostingExtensions\AIModelClientHostingExtensions.csproj" /></ItemGroup><PropertyGroup>diff --git a/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/SemanticKernelHostingExtensions.cs b/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/SemanticKernelHostingExtensions.csindex f9e1db0de..0c50b6e89 100644--- a/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/SemanticKernelHostingExtensions.cs+++ b/dotnet/src/Microsoft.AutoGen/Extensions/SemanticKernel/SemanticKernelHostingExtensions.cs@@ -17,7 +17,7 @@ public static class SemanticKernelHostingExtensions{public static IHostApplicationBuilder ConfigureSemanticKernel(this IHostApplicationBuilder builder){- builder.Services.Configure<OpenAIOptions>(o =>+ builder.Services.Configure<AIClientOptions>(o =>{o.EmbeddingsEndpoint = o.ImageEndpoint = o.ChatEndpoint = builder.Configuration["OpenAI:Endpoint"] ?? throw new InvalidOperationException("Ensure that OpenAI:Endpoint is set in configuration");o.EmbeddingsApiKey = o.ImageApiKey = o.ChatApiKey = builder.Configuration["OpenAI:Key"]!;@@ -48,7 +48,7 @@ public static class SemanticKernelHostingExtensionsprivate static ISemanticTextMemory CreateMemory(IServiceProvider provider){var qdrantConfig = provider.GetRequiredService<IOptions<QdrantOptions>>().Value;- var openAiConfig = provider.GetRequiredService<IOptions<OpenAIOptions>>().Value;+ var openAiConfig = provider.GetRequiredService<IOptions<AIClientOptions>>().Value;var qdrantHttpClient = new HttpClient();if (!string.IsNullOrEmpty(qdrantConfig.ApiKey)){@@ -64,7 +64,7 @@ public static class SemanticKernelHostingExtensionsprivate static Kernel CreateKernel(IServiceProvider provider){- OpenAIOptions openAiConfig = provider.GetRequiredService<IOptions<OpenAIOptions>>().Value;+ AIClientOptions openAiConfig = provider.GetRequiredService<IOptions<AIClientOptions>>().Value;var builder = Kernel.CreateBuilder();// Chatdiff --git a/dotnet/src/Microsoft.AutoGen/Runtime/Host.cs b/dotnet/src/Microsoft.AutoGen/Runtime/Host.csindex b5faf367d..f6e9326da 100644--- a/dotnet/src/Microsoft.AutoGen/Runtime/Host.cs+++ b/dotnet/src/Microsoft.AutoGen/Runtime/Host.cs@@ -19,6 +19,7 @@ public static class Host}var app = builder.Build();app.MapAgentService();+ app.MapDefaultEndpoints();await app.StartAsync().ConfigureAwait(false);return app;}diff --git a/dotnet/src/Microsoft.AutoGen/Runtime/WorkerGatewayService.cs b/dotnet/src/Microsoft.AutoGen/Runtime/WorkerGatewayService.csindex 19560b836..b817bc049 100644--- a/dotnet/src/Microsoft.AutoGen/Runtime/WorkerGatewayService.cs+++ b/dotnet/src/Microsoft.AutoGen/Runtime/WorkerGatewayService.cs@@ -8,6 +8,17 @@ internal sealed class WorkerGatewayService(WorkerGateway agentWorker) : AgentRpc{public override async Task OpenChannel(IAsyncStreamReader<Message> requestStream, IServerStreamWriter<Message> responseStream, ServerCallContext context){- await agentWorker.ConnectToWorkerProcess(requestStream, responseStream, context);+ try+ {+ await agentWorker.ConnectToWorkerProcess(requestStream, responseStream, context).ConfigureAwait(true);+ }+ catch+ {+ if (context.CancellationToken.IsCancellationRequested)+ {+ return;+ }+ throw;+ }}}