mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows * Removing local settings. * Removing remining old files from merge.
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
namespace Microsoft.Agents.AI.Workflows.Declarative.Interpreter;
|
|
|
|
/// <summary>
|
|
/// Message sent to initiate a transition to another <see cref="Executor"/>.
|
|
/// </summary>
|
|
public sealed record class ActionExecutorResult
|
|
{
|
|
/// <summary>
|
|
/// The identifier of the <see cref="Executor"/> that produced this message.
|
|
/// </summary>
|
|
public string ExecutorId { get; }
|
|
|
|
/// <summary>
|
|
/// The result of the action, if any provided.
|
|
/// </summary>
|
|
public object? Result { get; }
|
|
|
|
internal ActionExecutorResult(string executorId, object? result = null)
|
|
{
|
|
this.ExecutorId = executorId;
|
|
this.Result = result;
|
|
}
|
|
|
|
internal static ActionExecutorResult ThrowIfNot(object? message)
|
|
{
|
|
if (message is not ActionExecutorResult executorMessage)
|
|
{
|
|
throw new DeclarativeActionException($"Unexpected message type: {message?.GetType().Name ?? "(null)"} (Expected: {nameof(ActionExecutorResult)})");
|
|
}
|
|
|
|
return executorMessage;
|
|
}
|
|
}
|