Skip to content

.Net Agents - Magentic Agent Orchestration #12110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 135 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 130 commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
877dba1
Checkpoint
crickman Mar 27, 2025
5a63c9f
Merge branch 'main' into agent-orchestration
crickman Mar 27, 2025
6e04c10
Checkpoint
crickman Mar 27, 2025
1a6af45
Checkpoint
crickman Apr 13, 2025
1afef9a
Checkpoint
crickman Apr 13, 2025
c9b3a6f
Group Chat
crickman Apr 13, 2025
33c4e41
Group Chat
crickman Apr 13, 2025
d2c5db9
More
crickman Apr 13, 2025
e9b2dcd
Warnings
crickman Apr 13, 2025
0f41db1
Resolve merge from main
crickman Apr 14, 2025
27b7fcb
Typos
crickman Apr 14, 2025
4ff8429
Update term
crickman Apr 14, 2025
eca2c62
Rename orchestrations
crickman Apr 14, 2025
65abcf0
Replace `Trace` with `ILogger`
crickman Apr 16, 2025
7aba6bb
Log tuning
crickman Apr 16, 2025
3a5d2f4
Namespace clean-up
crickman Apr 16, 2025
274f951
Clean-up patterns
crickman Apr 16, 2025
872a761
Stable?
crickman Apr 18, 2025
f54b0f8
Typos
crickman Apr 18, 2025
fc06f0a
Typos
crickman Apr 18, 2025
5e95e69
Typos
crickman Apr 18, 2025
e5c0dd5
Headers
crickman Apr 18, 2025
a105a84
Headers
crickman Apr 18, 2025
76dfbcf
RegEx
crickman Apr 18, 2025
ad5d8c8
Headers
crickman Apr 18, 2025
a6137c3
Naming
crickman Apr 18, 2025
a3ca06c
Mark preview
crickman Apr 18, 2025
7a1d8ca
Headers
crickman Apr 18, 2025
c3931c7
Scope
crickman Apr 18, 2025
e7bdf3b
Clean-up
crickman Apr 20, 2025
eb405ad
Merge branch 'main' into agent-runtime
crickman Apr 20, 2025
a8ef1a3
Resolve merge from main
crickman Apr 20, 2025
9c3a999
Namespaces
crickman Apr 20, 2025
6afe1fa
Namespace ordering
crickman Apr 20, 2025
3e673ae
A couple more
crickman Apr 20, 2025
5c131ff
Remove namespace
crickman Apr 20, 2025
d3375ae
Comment cleanup
crickman Apr 20, 2025
66c7944
Naming
crickman Apr 20, 2025
e730ff1
Logging
crickman Apr 20, 2025
ad59e47
Merge branch 'main' into agent-orchestration
crickman Apr 20, 2025
ffb4bf6
Clean dependencies
crickman Apr 20, 2025
711cacf
Checkpoint
crickman Apr 21, 2025
1b7e488
Clean-up
crickman Apr 21, 2025
78d15f4
Whitespace
crickman Apr 21, 2025
5a47a9d
Clean-it
crickman Apr 21, 2025
ce35f0d
Once more
crickman Apr 21, 2025
c92c5ca
Package version sync
crickman Apr 21, 2025
79afea5
Clean
crickman Apr 21, 2025
689ab47
Resolve merge from main
crickman Apr 21, 2025
fcd39db
Header comment
crickman Apr 21, 2025
bdad5f0
Typos
crickman Apr 21, 2025
913bd21
Typos
crickman Apr 21, 2025
ccf9548
Typos
crickman Apr 21, 2025
264558b
Typo config
crickman Apr 22, 2025
3381f72
Merge branch 'main' into agent-orchestration
crickman Apr 22, 2025
559c189
Merge branch 'main' into agent-orchestration
crickman Apr 22, 2025
0dc5630
Comments and logging
crickman Apr 22, 2025
56231d4
Merge branch 'main' into agent-orchestration
crickman Apr 23, 2025
a3de83d
Unit-tests and clean-up
crickman Apr 24, 2025
d93823e
Namespace
crickman Apr 24, 2025
efbf59b
Merge branch 'main' into agent-orchestration
crickman Apr 24, 2025
e0f3b74
Sync cleanup
crickman Apr 24, 2025
ebfab0b
Scope topic
crickman Apr 24, 2025
42ffb79
Add test reference
crickman Apr 24, 2025
34549f5
Fix test base
crickman Apr 24, 2025
a4dcbe4
Merge branch 'main' into agent-orchestration
crickman Apr 24, 2025
53787cf
Test update - description
crickman Apr 24, 2025
538045f
Handoff Orchestration
crickman Apr 25, 2025
0db496f
Resolve merge from main
crickman Apr 25, 2025
1dc6fcb
Fix final note
crickman Apr 25, 2025
c58e9bb
Merge branch 'main' into agent-orchestration
crickman Apr 25, 2025
1f6dcdc
Skip test
crickman Apr 25, 2025
37ae252
Merge branch 'main' into agent-orchestration
crickman Apr 29, 2025
3397091
Merge branch 'main' into agent-orchestration
crickman May 5, 2025
eeb8660
Merge branch 'main' into agent-orchestration
crickman May 7, 2025
bb315c6
Fix merge
crickman May 7, 2025
8a84c0a
Merge branch 'main' into agent-orchestration
crickman May 7, 2025
6675050
Checkpoint
crickman May 8, 2025
eaa4b45
Handoff Checkpoint
crickman May 9, 2025
d88e895
Merge branch 'main' into agent-orchestration
crickman May 9, 2025
a51b2cf
Typo
crickman May 9, 2025
e2c3b6a
Whitespace
crickman May 9, 2025
d501df8
Namespace
crickman May 9, 2025
2ee2f32
Orchestration name & namespace
crickman May 9, 2025
72d50ba
Cleanup
crickman May 9, 2025
76a211c
Update test
crickman May 9, 2025
843be9c
Complete
crickman May 9, 2025
fae03ff
Formatting
crickman May 9, 2025
5a1c367
Merge branch 'main' into agent-orchestration
crickman May 9, 2025
ffcf05c
Readme
crickman May 9, 2025
8d7975e
Straggler
crickman May 9, 2025
f711984
Test input
crickman May 9, 2025
958d334
Handoff update
crickman May 9, 2025
968ee0f
Handoff cleanup
crickman May 9, 2025
946982e
Merge branch 'main' into agent-orchestration
crickman May 9, 2025
2e763cb
Namespace
crickman May 9, 2025
301ec29
Final refactoring
crickman May 9, 2025
7752cc8
Merge branch 'main' into agent-orchestration
crickman May 12, 2025
eeb42a3
Fix test
crickman May 12, 2025
7c939bd
Rollback
crickman May 12, 2025
b29f169
Merge branch 'main' into agent-orchestration
crickman May 12, 2025
364446b
Handoff unit-tests
crickman May 13, 2025
a63e253
Update dotnet/samples/GettingStartedWithAgents/Orchestration/Step01a_…
crickman May 13, 2025
6a992c6
Update dotnet/samples/GettingStartedWithAgents/Orchestration/Step03a_…
crickman May 13, 2025
5845fed
Merge branch 'main' into agent-orchestration
crickman May 13, 2025
ff0f6f6
Comments
crickman May 13, 2025
4f076ea
Merge branch 'agent-orchestration' of https://github.com/microsoft/se…
crickman May 13, 2025
01e7337
Rename sample
crickman May 13, 2025
8eeaa1e
Update handoff sample
crickman May 13, 2025
eea5585
Merge branch 'main' into agent-orchestration
crickman May 13, 2025
b1fa1c8
Remove cruft
crickman May 13, 2025
c2ba05e
Content fix
crickman May 13, 2025
c72d708
Suppression
crickman May 13, 2025
71226ca
Revert timeout
crickman May 13, 2025
13245dc
Merge branch 'main' into agent-orchestration
crickman May 14, 2025
cb08e41
netstandard2.0
crickman May 14, 2025
9989c7f
Project clean-up
crickman May 14, 2025
1ee2a76
Create project
crickman May 14, 2025
fbeea49
Merge branch 'agent-orchestration' into magentic-agents
crickman May 14, 2025
5246cd3
Complete
crickman May 16, 2025
a74216d
Resolve merge
crickman May 16, 2025
90af0bb
Revert
crickman May 16, 2025
18660c0
Namespace
crickman May 16, 2025
a52f651
Formatting
crickman May 16, 2025
5882529
Namespace
crickman May 16, 2025
26fbd14
Namespace
crickman May 16, 2025
8eb7829
Fix logging strings
crickman May 16, 2025
626c1b0
Merge branch 'main' into magentic-agents
crickman May 16, 2025
90ac624
Resolve merge
crickman May 16, 2025
f15f356
Fix supressions
crickman May 16, 2025
372390f
Final touches
crickman May 16, 2025
e501554
Update dotnet/src/Agents/Magentic/MagenticManager.cs
crickman May 16, 2025
52fa20c
Actor clean-up
crickman May 16, 2025
6adb358
Merge branch 'main' into magentic-agents
crickman May 16, 2025
2f1334a
Merge branch 'main' into magentic-agents
crickman May 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dotnet/SK-dotnet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VectorData.UnitTests", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Agents.Orchestration", "src\Agents\Orchestration\Agents.Orchestration.csproj", "{D1A02387-FA60-22F8-C2ED-4676568B6CC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Agents.Magentic", "src\Agents\Magentic\Agents.Magentic.csproj", "{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1519,6 +1521,12 @@ Global
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Publish|Any CPU.Build.0 = Publish|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1A02387-FA60-22F8-C2ED-4676568B6CC3}.Release|Any CPU.Build.0 = Release|Any CPU
{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7}.Publish|Any CPU.Build.0 = Publish|Any CPU
{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1725,6 +1733,7 @@ Global
{DA6B4ED4-ED0B-D25C-889C-9F940E714891} = {A70ED5A7-F8E1-4A57-9455-3C05989542DA}
{AAC7B5E8-CC4E-49D0-AF6A-2B4F7B43BD84} = {5A7028A7-4DDF-4E4F-84A9-37CE8F8D7E89}
{D1A02387-FA60-22F8-C2ED-4676568B6CC3} = {6823CD5E-2ABE-41EB-B865-F86EC13F0CF9}
{38059FCB-2CD7-C0DE-AE71-DA4D0245ECC7} = {6823CD5E-2ABE-41EB-B865-F86EC13F0CF9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FBDC56A3-86AD-4323-AA0F-201E59123B83}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<ProjectReference Include="..\..\src\Agents\OpenAI\Agents.OpenAI.csproj" />
<ProjectReference Include="..\..\src\Agents\Bedrock\Agents.Bedrock.csproj" />
<ProjectReference Include="..\..\src\Agents\Orchestration\Agents.Orchestration.csproj" />
<ProjectReference Include="..\..\src\Agents\Magentic\Agents.Magentic.csproj" />
<ProjectReference Include="..\..\src\Agents\Runtime\InProcess\Runtime.InProcess.csproj" />
<ProjectReference Include="..\..\src\Agents\Yaml\Agents.Yaml.csproj" />
<ProjectReference Include="..\..\src\Connectors\Connectors.AzureOpenAI\Connectors.AzureOpenAI.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Copyright (c) Microsoft. All rights reserved.

using Azure.Identity;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Agents;
using Microsoft.SemanticKernel.Agents.AzureAI;
using Microsoft.SemanticKernel.Agents.Magentic;
using Microsoft.SemanticKernel.Agents.Orchestration;
using Microsoft.SemanticKernel.Agents.Runtime.InProcess;
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.OpenAI;
using AAIP = Azure.AI.Projects;

namespace GettingStarted.Orchestration;

/// <summary>
/// Demonstrates how to use the <see cref="MagenticOrchestration"/> with two agents:
/// - A Research agent that can perform web searches
/// - A Coder agent that can run code using the code interpreter
/// </summary>
public class Step05_Magentic(ITestOutputHelper output) : BaseOrchestrationTest(output)
{
private const string ManagerModel = "o3-mini";
private const string ResearcherModel = "gpt-4o-search-preview";

/// <summary>
/// Require OpenAI services in order to use "gpt-4o-search-preview" model
/// </summary>
protected override bool ForceOpenAI => true;

[Fact]
public async Task MagenticTaskAsync()
{
// Define the agents
Kernel researchKernel = CreateKernelWithOpenAIChatCompletion(ResearcherModel);
ChatCompletionAgent researchAgent =
this.CreateAgent(
name: "ResearchAgent",
description: "Able to retrieve information and data from the Internet. Ask it to provide information or data without additional computation or quantitative analysis.",
instructions: "Retrieve information and data from the Internet without additional computation or quantitative analysis.",
kernel: researchKernel);

AAIP.AIProjectClient projectClient = AzureAIAgent.CreateAzureAIClient(TestConfiguration.AzureAI.ConnectionString, new AzureCliCredential());
AAIP.AgentsClient agentsClient = projectClient.GetAgentsClient();
AAIP.Agent definition =
await agentsClient.CreateAgentAsync(
TestConfiguration.AzureAI.ChatModelId,
name: "CoderAgent",
description: "Write and executes code to process and analyze data.",
instructions: "Use code to process and analyze data.",
tools: [new Azure.AI.Projects.CodeInterpreterToolDefinition()]);
AzureAIAgent coderAgent = new(definition, agentsClient);

// Define the orchestration
OrchestrationMonitor monitor = new();
Kernel managerKernel = this.CreateKernelWithChatCompletion(ManagerModel);
StandardMagenticManager manager =
new(managerKernel.GetRequiredService<IChatCompletionService>(), new OpenAIPromptExecutionSettings())
{
MaximumInvocationCount = 5,
};
MagenticOrchestration orchestration =
new(manager, researchAgent, coderAgent)
{
ResponseCallback = monitor.ResponseCallback,
LoggerFactory = this.LoggerFactory,
};

// Start the runtime
InProcessRuntime runtime = new();
await runtime.StartAsync();

string input =
"""
I am preparing a report on the energy efficiency of different machine learning model architectures.
Compare the estimated training and inference energy consumption of ResNet-50, BERT-base, and GPT-2 on standard datasets
(e.g., ImageNet for ResNet, GLUE for BERT, WebText for GPT-2).
Then, estimate the CO2 emissions associated with each, assuming training on an Azure Standard_NC6s_v3 VM for 24 hours.
Provide tables for clarity, and recommend the most energy-efficient model per task type
(image classification, text classification, and text generation).
""";
Console.WriteLine($"\n# INPUT:\n{input}\n");
OrchestrationResult<string> result = await orchestration.InvokeAsync(input, runtime);
//string text = await result.GetValueAsync(TimeSpan.FromSeconds(ResultTimeoutInSeconds * 6));
string text = await result.GetValueAsync();
Console.WriteLine($"\n# RESULT: {text}");

await runtime.RunUntilIdleAsync();

Console.WriteLine("\n\nORCHESTRATION HISTORY");
foreach (ChatMessageContent message in monitor.History)
{
this.WriteAgentChatMessage(message);
}
}

private Kernel CreateKernelWithOpenAIChatCompletion(string model)
{
IKernelBuilder builder = Kernel.CreateBuilder();

builder.AddOpenAIChatCompletion(
model,
TestConfiguration.OpenAI.ApiKey);

return builder.Build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private static List<ToolConnection> GetToolConnections(this AgentToolDefinition

var toolConnections = agentToolDefinition.GetRequiredOption<List<object>>("tool_connections");

return toolConnections.Select(connectionId => new ToolConnection(connectionId.ToString())).ToList();
return [.. toolConnections.Select(connectionId => new ToolConnection(connectionId.ToString()))];
}

private static T GetRequiredOption<T>(this AgentToolDefinition agentToolDefinition, string key)
Expand Down
36 changes: 36 additions & 0 deletions dotnet/src/Agents/Magentic/Agents.Magentic.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- THIS PROPERTY GROUP MUST COME FIRST -->
<AssemblyName>Microsoft.SemanticKernel.Agents.Magentic</AssemblyName>
<RootNamespace>Microsoft.SemanticKernel.Agents.Magentic</RootNamespace>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);IDE1006;SKEXP0110;SKEXP0001</NoWarn>
<EnablePackageValidation>false</EnablePackageValidation>
<VersionSuffix>preview</VersionSuffix>
</PropertyGroup>

<Import Project="$(RepoRoot)/dotnet/nuget/nuget-package.props" />

<PropertyGroup>
<!-- NuGet Package Settings -->
<Title>Semantic Kernel Agents - Magentic Agents</Title>
<Description>Defines Magentic agents and orchestration.</Description>
</PropertyGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)/dotnet/src/InternalUtilities/src/Diagnostics/*" Link="%(RecursiveDir)Utilities/%(Filename)%(Extension)" />
<Compile Include="$(RepoRoot)/dotnet/src/InternalUtilities/src/System/*" Link="%(RecursiveDir)Utilities/%(Filename)%(Extension)" />
<Compile Include="$(RepoRoot)/dotnet/src/InternalUtilities/agents/Extensions/AgentExtensions.cs" Link="%(RecursiveDir)Utilities/%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Orchestration\Agents.Orchestration.csproj" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="SemanticKernel.Agents.UnitTests" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Reflection;

namespace Microsoft.SemanticKernel.Agents.Magentic.Internal;

/// <summary>
/// Extension methods for <see cref="PromptExecutionSettings"/> to support response format operations.
/// </summary>
public static class PromptExecutionSettingsExtensions
{
private const string ResponseFormatPropertyName = "ResponseFormat";

/// <summary>
/// Determines whether the <paramref name="settings"/> object supports a "ResponseFormat" property of type <see cref="object"/>.
/// </summary>
/// <param name="settings">The <see cref="PromptExecutionSettings"/> instance to check.</param>
/// <returns><c>true</c> if the "ResponseFormat" property exists and is of type <see cref="object"/>; otherwise, <c>false</c>.</returns>
public static bool SupportsResponseFormat(this PromptExecutionSettings settings)
{
Type settingsType = settings.GetType();
PropertyInfo? property = settingsType.GetProperty(ResponseFormatPropertyName);
return property != null && property.PropertyType == typeof(object);
}

/// <summary>
/// Sets the "ResponseFormat" property of the <paramref name="settings"/> object to the specified response type.
/// </summary>
/// <typeparam name="TResponse">The type to set as the response format.</typeparam>
/// <param name="settings">The <see cref="PromptExecutionSettings"/> instance to update.</param>
public static void SetResponseFormat<TResponse>(this PromptExecutionSettings settings)
{
Type settingsType = settings.GetType();
PropertyInfo? property = settingsType.GetProperty(ResponseFormatPropertyName);
property?.SetValue(settings, typeof(TResponse));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel.Agents.Orchestration;
using Microsoft.SemanticKernel.Agents.Runtime;

namespace Microsoft.SemanticKernel.Agents.Magentic;

/// <summary>
/// Extensions for logging <see cref="MagenticOrchestration{TInput, TOutput}"/>.
/// </summary>
/// <remarks>
/// This extension uses the <see cref="LoggerMessageAttribute"/> to
/// generate logging code at compile time to achieve optimized code.
/// </remarks>
[ExcludeFromCodeCoverage]
internal static partial class MagenticOrchestrationLogMessages
{
/// <summary>
/// Logs pattern actor registration.
/// </summary>
[LoggerMessage(
EventId = 0,
Level = LogLevel.Information,
Message = "REGISTER ACTOR {Orchestration} {label}: {AgentType}")]
public static partial void LogRegisterActor(
this ILogger logger,
string orchestration,
AgentType agentType,
string label);

/// <summary>
/// Logs agent actor registration.
/// </summary>
[LoggerMessage(
EventId = 0,
Level = LogLevel.Information,
Message = "REGISTER ACTOR {Orchestration} {label} #{Count}: {AgentType}")]
public static partial void LogRegisterActor(
this ILogger logger,
string orchestration,
AgentType agentType,
string label,
int count);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Trace,
Message = "MAGENTIC AGENT invoked [{AgentId}]")]
public static partial void LogMagenticAgentInvoke(
this ILogger logger,
AgentId agentId);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Trace,
Message = "MAGENTIC AGENT result [{AgentId}]: {Message}")]
public static partial void LogMagenticAgentResult(
this ILogger logger,
AgentId agentId,
string? message);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Debug,
Message = "MAGENTIC MANAGER initialized [{AgentId}]")]
public static partial void LogMagenticManagerInit(
this ILogger logger,
AgentId agentId);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Debug,
Message = "MAGENTIC MANAGER invoked [{AgentId}]")]
public static partial void LogMagenticManagerInvoke(
this ILogger logger,
AgentId agentId);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Debug,
Message = "MAGENTIC MANAGER terminate? [{AgentId}]: {Result} ({Reason})")]
public static partial void LogMagenticManagerTerminate(
this ILogger logger,
AgentId agentId,
bool result,
string reason);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Debug,
Message = "MAGENTIC MANAGER select: {NextAgent} [{AgentId}]")]
public static partial void LogMagenticManagerSelect(
this ILogger logger,
AgentId agentId,
AgentType nextAgent);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Debug,
Message = "MAGENTIC MANAGER result [{AgentId}]: '{Result}' ({Reason})")]
public static partial void LogMagenticManagerResult(
this ILogger logger,
AgentId agentId,
string result,
string reason);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Debug,
Message = "MAGENTIC MANAGER user-input? [{AgentId}]: {Result} ({Reason})")]
public static partial void LogMagenticManagerInput(
this ILogger logger,
AgentId agentId,
bool result,
string reason);

[LoggerMessage(
EventId = 0,
Level = LogLevel.Trace,
Message = "MAGENTIC AGENT user-input [{AgentId}]: {Message}")]
public static partial void LogMagenticManagerUserInput(
this ILogger logger,
AgentId agentId,
string? message);

/// <summary>
/// Logs <see cref="OrchestrationResult{TValue}"/> timeout while awaiting the orchestration.
/// </summary>
[LoggerMessage(
EventId = 0,
Level = LogLevel.Error,
Message = "MAGENTIC FAILURE: {Topic}")]
public static partial void LogMagenticManagerStatusFailure(this ILogger logger, TopicId topic, Exception exception);

/// <summary>
/// Logs <see cref="OrchestrationResult{TValue}"/> timeout while awaiting the orchestration.
/// </summary>
[LoggerMessage(
EventId = 0,
Level = LogLevel.Error,
Message = "MAGENTIC MANAGER FAILURE: {Topic}")]
public static partial void LogMagenticManagerTaskFailed(this ILogger logger, TopicId topic);

/// <summary>
/// Logs <see cref="OrchestrationResult{TValue}"/> timeout while awaiting the orchestration.
/// </summary>
[LoggerMessage(
EventId = 0,
Level = LogLevel.Error,
Message = "MAGENTIC MANAGER RESET: #{ResetCount} - {Topic}")]
public static partial void LogMagenticManagerTaskReset(
this ILogger logger,
TopicId topic,
int resetCount);
}
Loading
Loading