Skip to content

Commit fa0cee7

Browse files
committed
Rename WorkflowOutputEvent.SourceId to ExecutorId for Python consistency
- Rename SourceId property to ExecutorId in WorkflowOutputEvent - Add [Obsolete] SourceId property for backward compatibility - Update all test usages to use ExecutorId Resolves part of #2938
1 parent 407fb30 commit fa0cee7

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowOutputEvent.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,21 @@ namespace Microsoft.Agents.AI.Workflows;
1010
/// </summary>
1111
public sealed class WorkflowOutputEvent : WorkflowEvent
1212
{
13-
internal WorkflowOutputEvent(object data, string sourceId) : base(data)
13+
internal WorkflowOutputEvent(object data, string executorId) : base(data)
1414
{
15-
this.SourceId = sourceId;
15+
this.ExecutorId = executorId;
1616
}
1717

1818
/// <summary>
1919
/// The unique identifier of the executor that yielded this output.
2020
/// </summary>
21-
public string SourceId { get; }
21+
public string ExecutorId { get; }
22+
23+
/// <summary>
24+
/// The unique identifier of the executor that yielded this output.
25+
/// </summary>
26+
[Obsolete("Use ExecutorId instead.")]
27+
public string SourceId => this.ExecutorId;
2228

2329
/// <summary>
2430
/// Determines whether the underlying data is of the specified type or a derived type.

dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/04_Simple_Workflow_ExternalRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static async ValueTask<string> RunAsync(TextWriter writer, Func<string, i
4545
switch (evt)
4646
{
4747
case WorkflowOutputEvent outputEvent:
48-
switch (outputEvent.SourceId)
48+
switch (outputEvent.ExecutorId)
4949
{
5050
case JudgeId:
5151
if (outputEvent.Is(out NumberSignal newSignal))

dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/05_Simple_Workflow_Checkpointing.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ await environment.StreamAsync(workflow, NumberSignal.Init, checkpointManager)
7979
switch (evt)
8080
{
8181
case WorkflowOutputEvent outputEvent:
82-
switch (outputEvent.SourceId)
82+
switch (outputEvent.ExecutorId)
8383
{
8484
case Step4EntryPoint.JudgeId:
8585
if (outputEvent.Is(out NumberSignal newSignal))

dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/13_Subworkflow_Checkpointing.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static async ValueTask<CheckpointInfo> RunAsync(TextWriter writer, string
6464
{
6565
foreach (ChatMessage message in messages)
6666
{
67-
writer.WriteLine($"{output.SourceId}: {message.Text}");
67+
writer.WriteLine($"{output.ExecutorId}: {message.Text}");
6868
}
6969
}
7070
else

0 commit comments

Comments
 (0)