Skip to content

Commit e706f07

Browse files
rogerbarretocrickmanCopilotCopilotdmytrostruk
authored
.NET: Add Microsoft.Agents.AI.AzureAI (Azure.AI.Project 1.2) Support (#1662)
* WIP * Fixed build errors (#1638) Comment and nullable type alignment * .NET: Azure.AI.Agents Package Split + Initial Extensions (#1657) * Move packages * Update nuget.config * Address Xmldoc * Remove format from branches checks * Address Xmldocs * Add more details to the implementation * Moving Agent logic to ChatClient * Adding Name and Id overrides to AzureAIAgent * Updating extensions * Add GetAiAgent extensions * Adding support for version as name can conflict 409 using the Agents API with same name * Addressing more updates to the extensions * More improvements * Remove debugging code from sample * Address copilot feedback * Apply suggestions from co-pilot code review * Update Directory.Packages.props Fix package version rollback: Azure.AI.Agents.Persistent (beta-6 => beta-7) * .NET: Add comprehensive unit tests for Microsoft.Agents.AI.AzureAIAgents extension methods (#1786) * Initial plan * Add comprehensive unit test project for Microsoft.Agents.AI.AzureAIAgents Co-authored-by: rogerbarreto <[email protected]> * Add README documenting test project and package dependency requirements Co-authored-by: rogerbarreto <[email protected]> * Fix documentation URL to use learn.microsoft.com Co-authored-by: rogerbarreto <[email protected]> * Bump back AAAP 1.2.0-beta.7 * Address AI generated UT's * Remove UT Readme * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: rogerbarreto <[email protected]> Co-authored-by: Copilot <[email protected]> * .NET: Change model to be required just for prompt agent definition specific extensions (#1812) * Remove unneeded model from extensions * Add noop justification * Update Package Nameing: V1 -> AzureAI.Persistent / V2 -> AzureAI (#1829) * .NET: Update Extensions for Strict Agent Definitions + Improvements (#1892) * Update Package Nameing: V1 -> AzureAI.Persistent / V2 -> AzureAI * Update agents and extensions to comply with strict agent definitions * More static updates * Address UT, and ResponseTool support * Improving reusability extensions * Addressing ResponseTools Unit Tests and extension setup * Adapted workaround on breaking AAA with OpenAI 2.6.0 * Small updates * Remove strictness when retrieving agents, improved XmlDocs * Improve sample comments * Update dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/AgentsClientExtensionsTests.cs Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Address PR comments * Address UT failing * Address Copilot feedback * Address Copilot feedback * Address comment typo * Address PR feedback * Address typo * Add missing Extensions with ChatClientAgentOptions * Address comments --------- Co-authored-by: Copilot <[email protected]> * Version update (#1901) * Updated package version (#1906) * .NET: Allow Declarative AIAgents Extensions (#1931) * Improve reusability of extension code and additional option to losen the strictiness of in-proc tools * Add missing UT scenarios * Add missing UT test scenarios * Normalize changes * Updated (#1948) * .NET: AgentDefinition extensions method simplification (#1967) * Update extensions methods that accepts AgentDefinition type to not be restrictive * Update Unit Tests * Revert yarn/package-lock * Revert yarn/package-lock * Address copilot feedback * Fix bad merge * .NET Workflows - WIP Declarative action update (#1761) * WIP * Fixed build errors (#1638) Comment and nullable type alignment * Sync to SDK update * Checkpoint * Checkpoint: Tests passing * Checkpoint: EndWorkflow * Add trace * .NET: Azure.AI.Agents Package Split + Initial Extensions (#1657) * Move packages * Update nuget.config * Address Xmldoc * Remove format from branches checks * Address Xmldocs * Add more details to the implementation * Moving Agent logic to ChatClient * Adding Name and Id overrides to AzureAIAgent * Updating extensions * Add GetAiAgent extensions * Adding support for version as name can conflict 409 using the Agents API with same name * Addressing more updates to the extensions * More improvements * Remove debugging code from sample * Address copilot feedback * Apply suggestions from co-pilot code review * Checkpoint * Update Directory.Packages.props Fix package version rollback: Azure.AI.Agents.Persistent (beta-6 => beta-7) * Add project reference * .NET: Add comprehensive unit tests for Microsoft.Agents.AI.AzureAIAgents extension methods (#1786) * Initial plan * Add comprehensive unit test project for Microsoft.Agents.AI.AzureAIAgents Co-authored-by: rogerbarreto <[email protected]> * Add README documenting test project and package dependency requirements Co-authored-by: rogerbarreto <[email protected]> * Fix documentation URL to use learn.microsoft.com Co-authored-by: rogerbarreto <[email protected]> * Bump back AAAP 1.2.0-beta.7 * Address AI generated UT's * Remove UT Readme * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: rogerbarreto <[email protected]> Co-authored-by: Copilot <[email protected]> * .NET: Change model to be required just for prompt agent definition specific extensions (#1812) * Remove unneeded model from extensions * Add noop justification * Update Package Nameing: V1 -> AzureAI.Persistent / V2 -> AzureAI (#1829) * Checkpoint for merge * No build errors * .NET: Update Extensions for Strict Agent Definitions + Improvements (#1892) * Update Package Nameing: V1 -> AzureAI.Persistent / V2 -> AzureAI * Update agents and extensions to comply with strict agent definitions * More static updates * Address UT, and ResponseTool support * Improving reusability extensions * Addressing ResponseTools Unit Tests and extension setup * Adapted workaround on breaking AAA with OpenAI 2.6.0 * Small updates * Remove strictness when retrieving agents, improved XmlDocs * Improve sample comments * Update dotnet/tests/Microsoft.Agents.AI.AzureAI.UnitTests/AgentsClientExtensionsTests.cs Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Address PR comments * Address UT failing * Address Copilot feedback * Address Copilot feedback * Address comment typo * Address PR feedback * Address typo * Add missing Extensions with ChatClientAgentOptions * Address comments --------- Co-authored-by: Copilot <[email protected]> * Updated package version (#1897) * Version update (#1901) * Checkpoint * Updated package version (#1906) * Checkpoint * Checkpoint * Checkpoint * Align with azure ai agent * Update dotnet/samples/GettingStarted/Workflows/Declarative/StudentTeacher/Program.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/samples/GettingStarted/Workflows/Declarative/MCPToolApproval/Program.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/samples/GettingStarted/Workflows/Declarative/DeepResearch/Program.cs Co-authored-by: Copilot <[email protected]> * Refactored external input * Update dotnet/samples/GettingStarted/Workflows/Declarative/MCPToolApproval/Program.cs Co-authored-by: Copilot <[email protected]> * Agent tools patch * Demos validated * Checkpoint * Hygiene * Checkpoint - Samples * Update dotnet/samples/GettingStarted/Workflows/Declarative/StudentTeacher/Program.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/samples/GettingStarted/Workflows/Declarative/StudentTeacher/Program.cs Co-authored-by: Copilot <[email protected]> * Checkpoint * Checkpoint - Deep Research * Update baseline * Update * Typo * Checkpoint * Typos * Sample cleanup * Update dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/AzureAgentProvider.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/src/Microsoft.Agents.AI.AzureAI/AgentsClientExtensions.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/samples/GettingStarted/Workflows/Declarative/FunctionTools/Program.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/samples/GettingStarted/Workflows/Declarative/StudentTeacher/Program.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/samples/GettingStarted/Workflows/Declarative/ToolApproval/Program.cs Co-authored-by: Copilot <[email protected]> * Update dotnet/samples/GettingStarted/Workflows/Declarative/DeepResearch/Program.cs Co-authored-by: Copilot <[email protected]> * Typo * Typo * Fix input loop * Sample - Function Calling / External Input * Typo * Finessed * Checkpoint * Fix feed * Checkpoint - so close * Ding dong! * "there" *** * Fixup comments * Fix sample * Code analysis * Header * Typo (variableName) * Remove dead code * Skip test (agent api ratchet) * Comment * Update dotnet/samples/GettingStarted/Workflows/Declarative/StudentTeacher/Program.cs Co-authored-by: Copilot <[email protected]> * Typo --------- Co-authored-by: Roger Barreto <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Dmytro Struk <[email protected]> * .NET: Latest updates Pre/Post V2 Bugbash Findings (#2040) * Improve V2 logic before/after bugbash prep * Apply suggestions from code review Co-authored-by: Stephen Toub <[email protected]> Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Stephen Toub <[email protected]> Co-authored-by: Copilot <[email protected]> * .NET: Update Foundry Agents to latest 2.0.0 alpha.20251107.3 (#2050) * Update extensions for new CreateVersionOptions structure * Update unit tests * Addresss capitalized * Update AgentsClientExtensionsTests.cs Fix invalid cast format failure * .NET: Feature foundry agent + user agent (#2058) * Update unit tests * Add user-agent protocol calls * Update unit tests * Update unit tests with http handler confirmation * UT fix * Fix xmldoc * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * Address copilot feedback --------- Co-authored-by: Copilot <[email protected]> * .NET: Update Extensions to be less restrictive for GetAIAgents (#2091) * Update behavior / restrictiveness when retrieving agents * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * Address format * Address copilot feedback --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Chris <[email protected]> * .NET Workflows - Support "structured inputs" feature for declarative workflows (#2053) * Bump version for release * .NET Workflows - Separate Foundry/AzureAI Provider into its own package (#2078) * Remove unused using directive in AzureAgentProvider Removed unused using directive for Extensions. * .NET: Updates to Foundry Agents Package (#2125) * Remove the conversation creation always * Update unit tests + address IL + refactor * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * Internalize unused methods --------- Co-authored-by: Copilot <[email protected]> * Fix declarative workflows integration testcase * .NET: Feature foundry agent/agent reference extension (Python Parity with Name + Version option) (#2147) * Add agent reference extensions * Add UT covering AgentReference and ModelId * .NET: Add GettingStarted Samples for Agents V2. (#2159) * Add gettingstarted samples for Foundry Agents * Address structured outputs * Net 10 -> Net 9 Temporary * Net 10 -> Net 9 Temporary * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * Address missing docs + old * Drop var for samples * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> * Address copilot feedback --------- Co-authored-by: Copilot <[email protected]> * .NET: Foundry Agents V2 - Add CodeInterpreter Sample (#2180) * Adding Code Interpreter sample and AgentName naming validation * Add agent name check UT * Improve sample code * Apply suggestion * Apply suggestion * Fixed (#2190) * .NET Workflows - Add "CustomerSupport" sample (#2102) * .NET Workflows - Add sample for hosted declarative workflow (#2199) * fwiw * Less blank lines * Fixed (#2204) * Update version (#2206) * .NET: Feature foundry agent/update breaking v2.0 to v1.2 (#2212) * Migration WIP Checkpoint 1 * Build + UT + Workflow passing * Address latest commits after break * Revert rename in unrelated files * Address PR comments * Class renames * Allow dotnet-format workflow on feature branches Revert unintentional edit * .NET: Add Conformance Integration Tests for AzureAI Package (#2237) * Conformance tests added and passing * Correct namespace * Update Azure.AI.Project to latest public nuget version * .NET: Added Computer use tool sample (#2235) * Initial computer use sample implementation. * Added background thread to allow polling for long running requests. * Removed unrequired try-catch block and added missing thread for agent call. * Removed irrelevant chatOptions and updated code based on feedback. * Updated image assets and fixed response issue. * Updated based on PR comments. * Update to Azure.AI.Project --------- Co-authored-by: Roger Barreto <[email protected]> * Package descriptions --------- Co-authored-by: Chris <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Dmytro Struk <[email protected]> Co-authored-by: Chris Rickman <[email protected]> Co-authored-by: Stephen Toub <[email protected]> Co-authored-by: Mark Wallace <[email protected]> Co-authored-by: Peter Ibekwe <[email protected]>
1 parent 580a0c4 commit e706f07

File tree

249 files changed

+13495
-3879
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+13495
-3879
lines changed

dotnet/Directory.Packages.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<PackageVersion Include="Aspire.Microsoft.Azure.Cosmos" Version="$(AspireAppHostSdkVersion)" />
1818
<PackageVersion Include="CommunityToolkit.Aspire.OllamaSharp" Version="13.0.0-beta.435" />
1919
<!-- Azure.* -->
20+
<PackageVersion Include="Azure.AI.Projects" Version="1.2.0-beta.1" />
21+
<PackageVersion Include="Azure.AI.Projects.OpenAI" Version="1.0.0-beta.1" />
2022
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.2.0-beta.7" />
2123
<PackageVersion Include="Azure.AI.OpenAI" Version="2.5.0-beta.1" />
2224
<PackageVersion Include="Azure.Identity" Version="1.17.0" />
@@ -93,10 +95,10 @@
9395
<!-- Identity -->
9496
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.78.0" />
9597
<!-- Workflows -->
96-
<PackageVersion Include="Microsoft.Bot.ObjectModel" Version="1.2025.1003.2" />
97-
<PackageVersion Include="Microsoft.Bot.ObjectModel.Json" Version="1.2025.1003.2" />
98-
<PackageVersion Include="Microsoft.Bot.ObjectModel.PowerFx" Version="1.2025.1003.2" />
99-
<PackageVersion Include="Microsoft.PowerFx.Interpreter" Version="1.4.0" />
98+
<PackageVersion Include="Microsoft.Bot.ObjectModel" Version="1.2025.1106.1" />
99+
<PackageVersion Include="Microsoft.Bot.ObjectModel.Json" Version="1.2025.1106.1" />
100+
<PackageVersion Include="Microsoft.Bot.ObjectModel.PowerFx" Version="1.2025.1106.1" />
101+
<PackageVersion Include="Microsoft.PowerFx.Interpreter" Version="1.5.0-build.20251008-1002" />
100102
<!-- Durable Task -->
101103
<PackageVersion Include="Microsoft.DurableTask.Client" Version="1.16.2" />
102104
<PackageVersion Include="Microsoft.DurableTask.Client.AzureManaged" Version="1.16.2-preview.1" />
@@ -118,8 +120,6 @@
118120
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.11" />
119121
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
120122
<PackageVersion Include="Moq" Version="[4.18.4]" />
121-
<PackageVersion Include="Microsoft.SemanticKernel.Agents.Abstractions" Version="1.67.0" />
122-
<PackageVersion Include="Microsoft.SemanticKernel.Agents.Yaml" Version="1.67.0-beta" />
123123
<PackageVersion Include="xunit" Version="2.9.3" />
124124
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
125125
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.3" />
@@ -165,4 +165,4 @@
165165
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
166166
</PackageReference>
167167
</ItemGroup>
168-
</Project>
168+
</Project>

dotnet/agent-framework-dotnet.slnx

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
<Folder Name="/Samples/GettingStarted/AgentProviders/">
4545
<File Path="samples/GettingStarted/AgentProviders/README.md" />
4646
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_A2A/Agent_With_A2A.csproj" />
47-
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureFoundryAgent/Agent_With_AzureFoundryAgent.csproj" />
47+
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureAIAgentsPersistent/Agent_With_AzureAIAgentsPersistent.csproj" />
48+
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureAIProject/Agent_With_AzureAIProject.csproj" />
4849
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureFoundryModel/Agent_With_AzureFoundryModel.csproj" />
4950
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIChatCompletion/Agent_With_AzureOpenAIChatCompletion.csproj" />
5051
<Project Path="samples/GettingStarted/AgentProviders/Agent_With_AzureOpenAIResponses/Agent_With_AzureOpenAIResponses.csproj" />
@@ -91,6 +92,7 @@
9192
<Project Path="samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Agent_OpenAI_Step01_Running.csproj" />
9293
<Project Path="samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Agent_OpenAI_Step02_Reasoning.csproj" />
9394
</Folder>
95+
<Folder Name="/Samples/Purview/" />
9496
<Folder Name="/Samples/Purview/AgentWithPurview/">
9597
<Project Path="samples/Purview/AgentWithPurview/AgentWithPurview.csproj" />
9698
</Folder>
@@ -100,6 +102,25 @@
100102
<Project Path="samples/GettingStarted/AgentWithRAG/AgentWithRAG_Step02_CustomVectorStoreRAG/AgentWithRAG_Step02_CustomVectorStoreRAG.csproj" />
101103
<Project Path="samples/GettingStarted/AgentWithRAG/AgentWithRAG_Step03_CustomRAGDataSource/AgentWithRAG_Step03_CustomRAGDataSource.csproj" />
102104
</Folder>
105+
<Folder Name="/Samples/GettingStarted/FoundryAgents/">
106+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step01.1_Basics/FoundryAgents_Step01.1_Basics.csproj" />
107+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step01.2_Running/FoundryAgents_Step01.2_Running.csproj" />
108+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/FoundryAgents_Step02_MultiturnConversation.csproj" />
109+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step03.1_UsingFunctionTools/FoundryAgents_Step03.1_UsingFunctionTools.csproj" />
110+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step03.2_UsingFunctionTools_FromOpenAPI/FoundryAgents_Step03.2_UsingFunctionTools_FromOpenAPI.csproj" />
111+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/FoundryAgents_Step04_UsingFunctionToolsWithApprovals.csproj" />
112+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step05_StructuredOutput/FoundryAgents_Step05_StructuredOutput.csproj" />
113+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step06_PersistedConversations/FoundryAgents_Step06_PersistedConversations.csproj" />
114+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step07_Observability/FoundryAgents_Step07_Observability.csproj" />
115+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step08_DependencyInjection/FoundryAgents_Step08_DependencyInjection.csproj" />
116+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/FoundryAgents_Step09_UsingMcpClientAsTools.csproj" />
117+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step10_UsingImages/FoundryAgents_Step10_UsingImages.csproj" />
118+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/FoundryAgents_Step11_AsFunctionTool.csproj" />
119+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step12_Middleware/FoundryAgents_Step12_Middleware.csproj" />
120+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step13_Plugins/FoundryAgents_Step13_Plugins.csproj" />
121+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/FoundryAgents_Step14_CodeInterpreter.csproj" />
122+
<Project Path="samples/GettingStarted/FoundryAgents/FoundryAgents_Step15_ComputerUse/FoundryAgents_Step15_ComputerUse.csproj" />
123+
</Folder>
103124
<Folder Name="/Samples/GettingStarted/ModelContextProtocol/">
104125
<File Path="samples/GettingStarted/ModelContextProtocol/README.md" />
105126
<Project Path="samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server/Agent_MCP_Server.csproj" />
@@ -124,13 +145,22 @@
124145
</Folder>
125146
<Folder Name="/Samples/GettingStarted/Workflows/Declarative/">
126147
<File Path="samples/GettingStarted/Workflows/Declarative/README.md" />
148+
<Project Path="samples/GettingStarted/Workflows/Declarative/ConfirmInput/ConfirmInput.csproj" />
149+
<Project Path="samples/GettingStarted/Workflows/Declarative/CustomerSupport/CustomerSupport.csproj" />
150+
<Project Path="samples/GettingStarted/Workflows/Declarative/DeepResearch/DeepResearch.csproj" />
127151
<Project Path="samples/GettingStarted/Workflows/Declarative/ExecuteCode/ExecuteCode.csproj" />
128152
<Project Path="samples/GettingStarted/Workflows/Declarative/ExecuteWorkflow/ExecuteWorkflow.csproj" />
153+
<Project Path="samples/GettingStarted/Workflows/Declarative/FunctionTools/FunctionTools.csproj" />
129154
<Project Path="samples/GettingStarted/Workflows/Declarative/GenerateCode/GenerateCode.csproj" />
155+
<Project Path="samples/GettingStarted/Workflows/Declarative/HostedWorkflow/HostedWorkflow.csproj" />
156+
<Project Path="samples/GettingStarted/Workflows/Declarative/InputArguments/InputArguments.csproj" />
157+
<Project Path="samples/GettingStarted/Workflows/Declarative/Marketing/Marketing.csproj" />
158+
<Project Path="samples/GettingStarted/Workflows/Declarative/StudentTeacher/StudentTeacher.csproj" />
159+
<Project Path="samples/GettingStarted/Workflows/Declarative/ToolApproval/ToolApproval.csproj" />
130160
</Folder>
131161
<Folder Name="/Samples/GettingStarted/Workflows/Declarative/Examples/">
162+
<File Path="../workflow-samples/ConfirmInput.yaml" />
132163
<File Path="../workflow-samples/DeepResearch.yaml" />
133-
<File Path="../workflow-samples/HumanInLoop.yaml" />
134164
<File Path="../workflow-samples/Marketing.yaml" />
135165
<File Path="../workflow-samples/MathChat.yaml" />
136166
<File Path="../workflow-samples/README.md" />
@@ -175,8 +205,8 @@
175205
</Folder>
176206
<Folder Name="/Samples/HostedAgents/">
177207
<Project Path="samples/HostedAgents/AgentsInWorkflows/AgentsInWorkflows.csproj" />
178-
<Project Path="samples/HostedAgents/AgentWithTextSearchRag/AgentWithTextSearchRag.csproj" />
179208
<Project Path="samples/HostedAgents/AgentWithHostedMCP/AgentWithHostedMCP.csproj" />
209+
<Project Path="samples/HostedAgents/AgentWithTextSearchRag/AgentWithTextSearchRag.csproj" />
180210
</Folder>
181211
<Folder Name="/Solution Items/">
182212
<File Path=".editorconfig" />
@@ -302,6 +332,7 @@
302332
<Project Path="src/Microsoft.Agents.AI.Abstractions/Microsoft.Agents.AI.Abstractions.csproj" />
303333
<Project Path="src/Microsoft.Agents.AI.AGUI/Microsoft.Agents.AI.AGUI.csproj" />
304334
<Project Path="src/Microsoft.Agents.AI.AzureAI.Persistent/Microsoft.Agents.AI.AzureAI.Persistent.csproj" />
335+
<Project Path="src/Microsoft.Agents.AI.AzureAI/Microsoft.Agents.AI.AzureAI.csproj" />
305336
<Project Path="src/Microsoft.Agents.AI.CopilotStudio/Microsoft.Agents.AI.CopilotStudio.csproj" />
306337
<Project Path="src/Microsoft.Agents.AI.DevUI/Microsoft.Agents.AI.DevUI.csproj" />
307338
<Project Path="src/Microsoft.Agents.AI.DurableTask/Microsoft.Agents.AI.DurableTask.csproj" />
@@ -314,13 +345,15 @@
314345
<Project Path="src/Microsoft.Agents.AI.Mem0/Microsoft.Agents.AI.Mem0.csproj" />
315346
<Project Path="src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj" />
316347
<Project Path="src/Microsoft.Agents.AI.Purview/Microsoft.Agents.AI.Purview.csproj" />
348+
<Project Path="src/Microsoft.Agents.AI.Workflows.Declarative.AzureAI/Microsoft.Agents.AI.Workflows.Declarative.AzureAI.csproj" />
317349
<Project Path="src/Microsoft.Agents.AI.Workflows.Declarative/Microsoft.Agents.AI.Workflows.Declarative.csproj" />
318350
<Project Path="src/Microsoft.Agents.AI.Workflows/Microsoft.Agents.AI.Workflows.csproj" />
319351
<Project Path="src/Microsoft.Agents.AI/Microsoft.Agents.AI.csproj" />
320352
</Folder>
321353
<Folder Name="/Tests/" />
322354
<Folder Name="/Tests/IntegrationTests/">
323355
<Project Path="tests/AgentConformance.IntegrationTests/AgentConformance.IntegrationTests.csproj" />
356+
<Project Path="tests/AzureAI.IntegrationTests/AzureAI.IntegrationTests.csproj" />
324357
<Project Path="tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistent.IntegrationTests.csproj" />
325358
<Project Path="tests/CopilotStudio.IntegrationTests/CopilotStudio.IntegrationTests.csproj" />
326359
<Project Path="tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Microsoft.Agents.AI.DurableTask.IntegrationTests.csproj" />
@@ -337,6 +370,7 @@
337370
<Project Path="tests/Microsoft.Agents.AI.Abstractions.UnitTests/Microsoft.Agents.AI.Abstractions.UnitTests.csproj" />
338371
<Project Path="tests/Microsoft.Agents.AI.AGUI.UnitTests/Microsoft.Agents.AI.AGUI.UnitTests.csproj" />
339372
<Project Path="tests/Microsoft.Agents.AI.AzureAI.Persistent.UnitTests/Microsoft.Agents.AI.AzureAI.Persistent.UnitTests.csproj" />
373+
<Project Path="tests/Microsoft.Agents.AI.AzureAI.UnitTests/Microsoft.Agents.AI.AzureAI.UnitTests.csproj" />
340374
<Project Path="tests/Microsoft.Agents.AI.DurableTask.UnitTests/Microsoft.Agents.AI.DurableTask.UnitTests.csproj" />
341375
<Project Path="tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/Microsoft.Agents.AI.Hosting.A2A.UnitTests.csproj" />
342376
<Project Path="tests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.UnitTests/Microsoft.Agents.AI.Hosting.AGUI.AspNetCore.UnitTests.csproj" />

dotnet/eng/MSBuild/Shared.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@
1111
<ItemGroup Condition="'$(InjectSharedBuildTestCode)' == 'true'">
1212
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\CodeTests\*.cs" LinkBase="Shared\CodeTests" />
1313
</ItemGroup>
14+
<ItemGroup Condition="'$(InjectSharedWorkflowsExecution)' == 'true'">
15+
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\Workflows\Execution\*.cs" LinkBase="Shared\Workflows" />
16+
</ItemGroup>
17+
<ItemGroup Condition="'$(InjectSharedWorkflowsSettings)' == 'true'">
18+
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\Workflows\Settings\*.cs" LinkBase="Shared\Workflows" />
19+
</ItemGroup>
20+
<ItemGroup Condition="'$(InjectSharedFoundryAgents)' == 'true'">
21+
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\Foundry\Agents\*.cs" LinkBase="Shared\Foundry" />
22+
</ItemGroup>
1423
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
7+
<Nullable>enable</Nullable>
8+
<ImplicitUsings>enable</ImplicitUsings>
9+
<NoWarn>$(NoWarn);IDE0059</NoWarn>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Azure.AI.Projects" />
14+
<PackageReference Include="Azure.Identity" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\..\..\..\src\Microsoft.Agents.AI.AzureAI\Microsoft.Agents.AI.AzureAI.csproj" />
19+
</ItemGroup>
20+
21+
</Project>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
3+
// This sample shows how to create and use a AI agents with Azure Foundry Agents as the backend.
4+
5+
using Azure.AI.Projects;
6+
using Azure.AI.Projects.OpenAI;
7+
using Azure.Identity;
8+
using Microsoft.Agents.AI;
9+
10+
var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set.");
11+
var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
12+
13+
const string JokerInstructions = "You are good at telling jokes.";
14+
const string JokerName = "JokerAgent";
15+
16+
// Get a client to create/retrieve/delete server side agents with Azure Foundry Agents.
17+
var aiProjectClient = new AIProjectClient(new Uri(endpoint), new AzureCliCredential());
18+
19+
// Define the agent you want to create. (Prompt Agent in this case)
20+
var agentVersionCreationOptions = new AgentVersionCreationOptions(new PromptAgentDefinition(model: deploymentName) { Instructions = JokerInstructions });
21+
// Azure.AI.Agents SDK creates and manages agent by name and versions.
22+
// You can create a server side agent version with the Azure.AI.Agents SDK client below.
23+
var agentVersion = aiProjectClient.Agents.CreateAgentVersion(agentName: JokerName, options: agentVersionCreationOptions);
24+
25+
// Note:
26+
// agentVersion.Id = "<agentName>:<versionNumber>",
27+
// agentVersion.Version = <versionNumber>,
28+
// agentVersion.Name = <agentName>
29+
30+
// You can retrieve an AIAgent for a already created server side agent version.
31+
AIAgent jokerAgentV1 = aiProjectClient.GetAIAgent(agentVersion);
32+
33+
// You can also create another AIAgent version (V2) by providing the same name with a different definition.
34+
AIAgent jokerAgentV2 = aiProjectClient.CreateAIAgent(name: JokerName, model: deploymentName, instructions: JokerInstructions + "V2");
35+
36+
// You can also get the AIAgent latest version just providing its name.
37+
AIAgent jokerAgentLatest = aiProjectClient.GetAIAgent(name: JokerName);
38+
var latestVersion = jokerAgentLatest.GetService<AgentVersion>()!;
39+
40+
// The AIAgent version can be accessed via the GetService method.
41+
Console.WriteLine($"Latest agent version id: {latestVersion.Id}");
42+
43+
// Once you have the AIAgent, you can invoke it like any other AIAgent.
44+
AgentThread thread = jokerAgentLatest.GetNewThread();
45+
Console.WriteLine(await jokerAgentLatest.RunAsync("Tell me a joke about a pirate.", thread));
46+
47+
// This will use the same thread to continue the conversation.
48+
Console.WriteLine(await jokerAgentLatest.RunAsync("Now tell me a joke about a cat and a dog using last joke as the anchor.", thread));
49+
50+
// Cleanup by agent name removes both agent versions created (jokerAgentV1 + jokerAgentV2).
51+
aiProjectClient.Agents.DeleteAgent(jokerAgentV1.Name);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Prerequisites
2+
3+
Before you begin, ensure you have the following prerequisites:
4+
5+
- .NET 8.0 SDK or later
6+
- Azure Foundry service endpoint and deployment configured
7+
- Azure CLI installed and authenticated (for Azure credential authentication)
8+
9+
**Note**: This demo uses Azure CLI credentials for authentication. Make sure you're logged in with `az login` and have access to the Azure Foundry resource. For more information, see the [Azure CLI documentation](https://learn.microsoft.com/cli/azure/authenticate-azure-cli-interactively).
10+
11+
Set the following environment variables:
12+
13+
```powershell
14+
$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint
15+
$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini
16+
```

dotnet/samples/GettingStarted/AgentProviders/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ See the README.md for each sample for the prerequisites for that sample.
1515
|Sample|Description|
1616
|---|---|
1717
|[Creating an AIAgent with A2A](./Agent_With_A2A/)|This sample demonstrates how to create AIAgent for an existing A2A agent.|
18-
|[Creating an AIAgent with AzureFoundry Agent](./Agent_With_AzureFoundryAgent/)|This sample demonstrates how to create an Azure Foundry agent and expose it as an AIAgent|
18+
|[Creating an AIAgent with Foundry Agents using Azure.AI.Agents.Persistent](./Agent_With_AzureAIAgentsPersistent/)|This sample demonstrates how to create a Foundry Persistent agent and expose it as an AIAgent using the Azure.AI.Agents.Persistent SDK|
19+
|[Creating an AIAgent with Foundry Agents using Azure.AI.Project](./Agent_With_AzureAIProject/)|This sample demonstrates how to create an Foundry Project agent and expose it as an AIAgent using the Azure.AI.Project SDK|
1920
|[Creating an AIAgent with AzureFoundry Model](./Agent_With_AzureFoundryModel/)|This sample demonstrates how to use any model deployed to Azure Foundry to create an AIAgent|
2021
|[Creating an AIAgent with Azure OpenAI ChatCompletion](./Agent_With_AzureOpenAIChatCompletion/)|This sample demonstrates how to create an AIAgent using Azure OpenAI ChatCompletion as the underlying inference service|
2122
|[Creating an AIAgent with Azure OpenAI Responses](./Agent_With_AzureOpenAIResponses/)|This sample demonstrates how to create an AIAgent using Azure OpenAI Responses as the underlying inference service|

0 commit comments

Comments
 (0)