Add linePragmas="false" to t4 templates (#1041)

This commit is contained in:
Stephen Toub
2025-10-01 04:43:29 -04:00
committed by GitHub
Unverified
parent 2680edff65
commit 5c0bea12e3
46 changed files with 69 additions and 31147 deletions
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
// Runtime Version: 18.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -15,12 +15,9 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\DefaultTemplate.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")]
internal partial class DefaultTemplate : ActionTemplate, IModeledAction
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
@@ -29,38 +26,15 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
this.Write("\n");
this.Write("\n");
this.Write("\nDelegateExecutor ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\DefaultTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.InstanceVariable));
#line default
#line hidden
this.Write(" = new(id: \"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\DefaultTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Id));
#line default
#line hidden
this.Write("\", ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\DefaultTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.RootVariable));
#line default
#line hidden
this.Write(".Session");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\DefaultTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Action is not null ? $", {this.Action}" : ""));
#line default
#line hidden
this.Write(");\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate, IModeledAction" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate, IModeledAction" visibility="internal" linePragmas="false" #>
<#@ import namespace="Microsoft.Agents.AI.Workflows.Declarative.Interpreter" #>
<#@ assembly name="System.Core" #>
DelegateExecutor <#= this.InstanceVariable #> = new(id: "<#= this.Id #>", <#= this.RootVariable #>.Session<#= this.Action is not null ? $", {this.Action}" : "" #>);
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
// Runtime Version: 18.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -14,12 +14,9 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")]
internal partial class EdgeTemplate : CodeTemplate
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
@@ -27,71 +24,28 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
{
this.Write("\n");
this.Write("\n");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
if (this.Condition is not null)
{
#line default
#line hidden
this.Write("\n builder.AddEdge(");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.SourceId));
#line default
#line hidden
this.Write(", ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.TargetId));
#line default
#line hidden
this.Write(", (object? result) => ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Condition));
#line default
#line hidden
this.Write(");");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
}
else
{
#line default
#line hidden
this.Write("\n builder.AddEdge(");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.SourceId));
#line default
#line hidden
this.Write(", ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.TargetId));
#line default
#line hidden
this.Write(");");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EdgeTemplate.tt"
}
#line default
#line hidden
this.Write("\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="CodeTemplate" visibility="internal" #>
<#@ template language="C#" inherits="CodeTemplate" visibility="internal" linePragmas="false" #>
<#@ assembly name="System.Core" #>
<# if (this.Condition is not null)
{#>
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
// Runtime Version: 18.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -15,12 +15,9 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EmptyTemplate.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")]
internal partial class EmptyTemplate : CodeTemplate, IModeledAction
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
@@ -29,38 +26,15 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
this.Write("\n");
this.Write("\n");
this.Write("\nDelegateExecutor ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EmptyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.InstanceVariable));
#line default
#line hidden
this.Write(" = new(id: \"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EmptyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Id));
#line default
#line hidden
this.Write("\", ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EmptyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.RootVariable));
#line default
#line hidden
this.Write(".Session");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\EmptyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Action is not null ? $", {this.Action}" : ""));
#line default
#line hidden
this.Write(");\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="CodeTemplate, IModeledAction" visibility="internal" #>
<#@ template language="C#" inherits="CodeTemplate, IModeledAction" visibility="internal" linePragmas="false" #>
<#@ import namespace="Microsoft.Agents.AI.Workflows.Declarative.Interpreter" #>
<#@ assembly name="System.Core" #>
DelegateExecutor <#= this.InstanceVariable #> = new(id: "<#= this.Id #>", <#= this.RootVariable #>.Session<#= this.Action is not null ? $", {this.Action}" : "" #>);
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
// Runtime Version: 18.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -14,12 +14,9 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\InstanceTemplate.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")]
internal partial class InstanceTemplate : CodeTemplate
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
@@ -27,38 +24,15 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
{
this.Write("\n");
this.Write("\n");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\InstanceTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.ExecutorType));
#line default
#line hidden
this.Write("Executor ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\InstanceTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.InstanceVariable));
#line default
#line hidden
this.Write(" = new(");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\InstanceTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.RootVariable));
#line default
#line hidden
this.Write(".Session");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\InstanceTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.HasProvider ? ", options.AgentProvider" : ""));
#line default
#line hidden
this.Write(");");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
@@ -1,3 +1,3 @@
<#@ template language="C#" inherits="CodeTemplate" visibility="internal" #>
<#@ template language="C#" inherits="CodeTemplate" visibility="internal" linePragmas="false" #>
<#@ assembly name="System.Core" #>
<#= this.ExecutorType #>Executor <#= this.InstanceVariable #> = new(<#= this.RootVariable #>.Session<#= this.HasProvider ? ", options.AgentProvider" : "" #>);
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
// Runtime Version: 18.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -15,12 +15,9 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")]
internal partial class ProviderTemplate : CodeTemplate
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
@@ -50,30 +47,15 @@ using Microsoft.Agents.AI.Workflows.Declarative;
using Microsoft.Agents.AI.Workflows.Declarative.Kit;
using Microsoft.Extensions.AI;
");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
if (this.Namespace is not null)
{
#line default
#line hidden
this.Write("\nnamespace ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Namespace));
#line default
#line hidden
this.Write(";\n");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
}
#line default
#line hidden
this.Write(@"
/// <summary>
/// This class provides a factory method to create a <see cref=""Workflow"" /> instance.
@@ -85,36 +67,16 @@ if (this.Namespace is not null)
/// https://learn.microsoft.com/power-platform/power-fx/formula-reference-copilot-studio
/// </remarks>
public static class ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Prefix ?? string.Empty));
#line default
#line hidden
this.Write("WorkflowProvider\n{");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
foreach (string executor in ByLine(this.Executors, formatGroup: true))
{
#line default
#line hidden
this.Write("\n ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(executor));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
}
#line default
#line hidden
this.Write(@"
public static Workflow CreateWorkflow<TInput>(
DeclarativeWorkflowOptions options,
@@ -124,80 +86,32 @@ foreach (string executor in ByLine(this.Executors, formatGroup: true))
// Create root executor to initialize the workflow.
inputTransform ??= (message) => DeclarativeWorkflowBuilder.DefaultTransform(message);
");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.RootExecutorType));
#line default
#line hidden
this.Write("Executor<TInput> ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.RootInstance));
#line default
#line hidden
this.Write(" = new(options, inputTransform);");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
// Create executor instances
foreach (string instance in ByLine(this.Instances))
{
#line default
#line hidden
this.Write("\n ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(instance));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
}
#line default
#line hidden
this.Write("\n\n // Define the workflow builder\n WorkflowBuilder builder = new(");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.RootInstance));
#line default
#line hidden
this.Write(");\n\n // Connect executors");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
foreach (string edge in ByLine(this.Edges))
{
#line default
#line hidden
this.Write("\n ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(edge));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\ProviderTemplate.tt"
}
#line default
#line hidden
this.Write("\n\n // Build the workflow\n return builder.Build();\n }\n}\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="CodeTemplate" visibility="internal" #>
<#@ template language="C#" inherits="CodeTemplate" visibility="internal" linePragmas="false" #>
<#@ import namespace="Microsoft.Agents.AI.Workflows.Declarative.Extensions" #>
<#@ assembly name="System.Core" #>
// ------------------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>f
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
// Runtime Version: 18.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -17,12 +17,9 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")]
internal partial class RootTemplate : CodeTemplate, IModeledAction
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
@@ -34,112 +31,49 @@ namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
this.Write("\n");
this.Write("\n/// <summary>\n/// The root executor for a declarative workflow.\n/// </summary>\ni" +
"nternal sealed class ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.TypeName));
#line default
#line hidden
this.Write("Executor<TInput>(\n DeclarativeWorkflowOptions options,\n Func<TInput, ChatMe" +
"ssage> inputTransform) :\n RootExecutor<TInput>(\"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Id));
#line default
#line hidden
this.Write("\", options, inputTransform)\n where TInput : notnull\n{\n protected override a" +
"sync ValueTask ExecuteAsync(TInput message, IWorkflowContext context, Cancellati" +
"onToken cancellationToken)\n {");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
if (this.TypeInfo.EnvironmentVariables.Count > 0)
{
#line default
#line hidden
this.Write("\n // Set environment variables\n await this.InitializeEnvironmentAsy" +
"nc(\n context,");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
int index = this.TypeInfo.EnvironmentVariables.Count - 1;
foreach (string variableName in this.TypeInfo.EnvironmentVariables)
{
#line default
#line hidden
this.Write("\n \"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(variableName));
#line default
#line hidden
this.Write("\"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(index > 0 ? "," : ""));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
--index;
}
#line default
#line hidden
this.Write(").ConfigureAwait(false);\n");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
}
if (this.TypeInfo.UserVariables.Count > 0)
{
#line default
#line hidden
this.Write("\n // Initialize variables");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
foreach (VariableInformationDiagnostic variableInfo in this.TypeInfo.UserVariables)
{
#line default
#line hidden
this.Write("\n await context.QueueStateUpdateAsync(\"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(variableInfo.Path.VariableName));
#line default
#line hidden
this.Write("\", UnassignedValue.Instance, \"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(variableInfo.Path.NamespaceAlias));
#line default
#line hidden
this.Write("\").ConfigureAwait(false);");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RootTemplate.tt"
}
}
#line default
#line hidden
this.Write("\n }\n}\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="CodeTemplate, IModeledAction" visibility="internal" #>
<#@ template language="C#" inherits="CodeTemplate, IModeledAction" visibility="internal" linePragmas="false" #>
<#@ import namespace="Microsoft.Agents.AI.Workflows.Declarative.Extensions" #>
<#@ import namespace="Microsoft.Agents.AI.Workflows.Declarative.Interpreter" #>
<#@ import namespace="Microsoft.Bot.ObjectModel" #>
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" #>
<#@ template language="C#" inherits="ActionTemplate" visibility="internal" linePragmas="false" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ include file="Snippets/Index.tt" once="true" #>