mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: NET Workflows - Skip conversation initialization when identifier is provided (#1087)
* Fix * Code-gen case * Tests * Autosend logic * Build fix * Namespace * Validation enhancement
This commit is contained in:
+4
-4
@@ -1,7 +1,7 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 18.0.0.0
|
||||
// Runtime Version: 17.0.0.0
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -19,7 +19,7 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
|
||||
/// <summary>
|
||||
/// Class to produce the template output
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
|
||||
internal partial class CreateConversationTemplate : ActionTemplate
|
||||
{
|
||||
/// <summary>
|
||||
@@ -59,8 +59,8 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
|
||||
string conversationId = await agentProvider.CreateConversationAsync(cancellationToken).ConfigureAwait(false);");
|
||||
|
||||
AssignVariable(this.ConversationId, "conversationId");
|
||||
|
||||
this.Write("\n return default;\n }\n}\n");
|
||||
this.Write("\n await context.AddEventAsync(new ConversationUpdateEvent(conversationId))" +
|
||||
".ConfigureAwait(false);\n\n return default;\n }\n}\n");
|
||||
return this.GenerationEnvironment.ToString();
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -10,8 +10,9 @@ internal sealed class <#= this.Name #>Executor(FormulaSession session, WorkflowA
|
||||
protected override async ValueTask<object?> ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
string conversationId = await agentProvider.CreateConversationAsync(cancellationToken).ConfigureAwait(false);<#
|
||||
AssignVariable(this.ConversationId, "conversationId");
|
||||
#>
|
||||
AssignVariable(this.ConversationId, "conversationId");#>
|
||||
await context.AddEventAsync(new ConversationUpdateEvent(conversationId)).ConfigureAwait(false);
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user