Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/CodeGen/RetrieveConversationMessageTemplate.cs
T
Chris 77404d165c .NET Workflows - Code Generation for Declarative Workflow (#655)
* Notes

* Readme typo

* Update readme

* Checkpoint

* Namespace fix

* Fix ID and namespace

* Checkpoint

* Verified

* Comments

* Isolate "Kit"

* Address note: static

* Checkpoint

* Checkpoint "Executor<>"

* Prefix and internal executors

* Test passing

* Cleanup

* Rename "session" concept

* Revert workflow debug

* Fix template base / pragma

* Tune system scope

* Update dotnet/src/Microsoft.Agents.Workflows.Declarative/CodeGen/ResetVariableTemplate.tt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix empty template

* Add validation for codegen ut

* Fix test

* Codegen baselines

* Constant

* Prep

* Mark TODO

* Fix

* Namespace

* One more

* Update baselines

* Checkpoint

* Checkpoint

* Checkpoint

* fme

* Checkpoint

* Another step

* Fixed up

* Roslyn

* Fix

* More cleaning

* Async

* Fix

* Enum checkpoint

* Refine enum

* Checkpoint

* Sync templates

* Checkpoint

* Streamline

* Pre-merge analyzer updates

* Foreach

* Placeholders

* Checkpoint

* Clean-up

* Sample path resolution

* Checkpoint

* Checkpoint - Workflow Code Building

* Validation

* Test cleanup

* Update test basline

* Update test baseline

* Fix DefaultTemplate usage

* Validation checkpoint

* Fix break/continue edges

* Verify generated code builds

* Fix merge

* Fix build validation

* Update template handling of literal string values.

* Test for metadata case

* Update baselines

* Fix merge

* Checkpoint

* Checkpoint: Conditions

* Invoke Agent Checkpoint

* Namespace

* Address code-analysis issues

* Cross platform test support

* Invoke agent checkpoint

* Clean sample

* Checkpoint: Agent Invoke Input Messages

* Checkpoint - Passing

* Checkpoint

* Regenerate all template + port conversation fix

* Checkpoint: Tests good

* Fix test for unbuntu

* Fix build command

* Checkpoint - E2E

* Test fix

* Update integration tests

* Fix merge

* Update

* Checkpoint !!!

* Baby steps

* Checkpoint

* Checkpoint E2E !!!

* So close...

* Integrate test validation

* Fix merge

* Rebase tests

* Namespace

* Namespace

* Test cleanup

* Sample comment cleanup

* Checkpoint: List conversion

* Include these

* CheckPoint: ParseValue

* Namespace

* Fix sampel

* More namspace

* Comments

* Test updates

* Test fix

* Better build

* Shared code

* Sort solution

* Fix build

* Prune solution

* One more

* Conversion matrix

* Final table conversion

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-30 21:56:14 +00:00

2723 lines
99 KiB
C#

// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Microsoft.Agents.AI.Workflows.Declarative.CodeGen
{
using Microsoft.Agents.AI.Workflows.Declarative.Extensions;
using Microsoft.Agents.AI.Workflows.Declarative.ObjectModel;
using Microsoft.Bot.ObjectModel;
using Microsoft.Extensions.AI;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RetrieveConversationMessageTemplate.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
internal partial class RetrieveConversationMessageTemplate : ActionTemplate
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n");
this.Write("\n/// <summary>\n/// Retrieves a list of messages from an agent conversation.\n/// <" +
"/summary>\ninternal sealed class ");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RetrieveConversationMessageTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Name));
#line default
#line hidden
this.Write("Executor(FormulaSession session, WorkflowAgentProvider agentProvider) : ActionExe" +
"cutor(id: \"");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RetrieveConversationMessageTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Id));
#line default
#line hidden
this.Write("\", session)\n{\n // <inheritdoc />\n protected override async ValueTask<object" +
"?> ExecuteAsync(IWorkflowContext context, CancellationToken cancellationToken)\n " +
" {");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RetrieveConversationMessageTemplate.tt"
EvaluateStringExpression(this.Model.ConversationId, "conversationId");
EvaluateStringExpression(this.Model.MessageId, "messageId");
#line default
#line hidden
this.Write("\n ChatMessage message = await agentProvider.GetMessageAsync(conversationId" +
", messageId, cancellationToken).ConfigureAwait(false);");
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\RetrieveConversationMessageTemplate.tt"
AssignVariable(this.Model.Message, "message");
#line default
#line hidden
this.Write("\n return default;\n }\n}");
return this.GenerationEnvironment.ToString();
}
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
void AssignVariable(PropertyPath targetVariable, string valueVariable, bool tightFormat = false)
{
if (targetVariable is not null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write("\n await context.QueueStateUpdateAsync(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(VariableName(targetVariable)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write("\", value: ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(valueVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write(", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(VariableScope(targetVariable)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
if (!tightFormat)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\AssignVariableTemplate.tt"
}
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
void EvaluateBoolExpression(BoolExpression expression, string targetVariable, bool defaultValue = false)
{
if (expression is null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write("\n bool ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatBoolValue(defaultValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
}
else if (expression.IsLiteral)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write("\n bool ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatBoolValue(expression.LiteralValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
}
else if (expression.IsVariableReference && expression.VariableReference.SegmentCount == 2)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write("\n bool ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(" = await context.ReadStateAsync<bool>(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.VariableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write("\", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.NamespaceAlias));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
}
else if (expression.IsVariableReference)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write("\n bool ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<bool>>(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.VariableReference.ToString())));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write("\n bool ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<bool>(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.ExpressionText)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateBoolExpressionTemplate.tt"
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
void EvaluateEnumExpression<TWrapper, TValue>(
EnumExpression<TWrapper> expression,
string targetVariable,
IDictionary<TWrapper, string> resultMap,
string defaultValue = null,
bool qualifyResult = false,
bool isNullable = false)
where TWrapper : EnumWrapper
{
string resultType = $"{GetTypeAlias<TValue>()}{(isNullable ? "?" : "")}";
if (expression is null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatValue<TValue>(defaultValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
}
else if (expression.IsLiteral)
{
resultMap.TryGetValue(expression.LiteralValue, out string resultValue);
if (qualifyResult)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(".");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultValue));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatValue<TValue>(resultValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
}
}
else if (expression.IsVariableReference && expression.VariableReference.SegmentCount == 2)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" = await context.ReadStateAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(">(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.VariableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.NamespaceAlias));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
}
else if (expression.IsVariableReference)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.VariableReference.ToString())));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultType));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.ExpressionText)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateEnumExpressionTemplate.tt"
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
void EvaluateIntExpression(IntExpression expression, string targetVariable, bool isNullable = false)
{
string typeName = isNullable ? "int?" : "int";
if (expression is null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(isNullable ? "null" : "0"));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
}
else if (expression.IsLiteral)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.LiteralValue));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
}
else if (expression.IsVariableReference && expression.VariableReference.SegmentCount == 2)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" = await context.ReadStateAsync<int>(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.VariableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("\", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.NamespaceAlias));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
}
else if (expression.IsVariableReference)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.VariableReference.ToString())));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.ExpressionText)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateIntExpressionTemplate.tt"
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
void EvaluateListExpression<TElement>(ValueExpression expression, string targetVariable)
{
string typeName = GetTypeAlias<TElement>();
if (expression is null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("\n IList<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(" = null;");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
}
else if (expression.IsLiteral)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("\n IList<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatDataValue(expression.LiteralValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
}
else if (expression.IsVariableReference && expression.VariableReference.SegmentCount == 2)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("\n IList<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(" = await context.ReadListAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TElement>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.VariableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("\", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.NamespaceAlias));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
}
else if (expression.IsVariableReference)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("\n IList<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("> = await context.EvaluateListAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.VariableReference.ToString())));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write("\n IList<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(" = await context.EvaluateListAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.ExpressionText)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateListExpressionTemplate.tt"
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
void EvaluateRecordExpression<TValue>(ObjectExpression<RecordDataValue> expression, string targetVariable)
{
string resultTypeName = $"Dictionary<string, {GetTypeAlias<TValue>()}?>?";
if (expression is null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" = null;");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
}
else if (expression.IsLiteral)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" =\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatDataValue(expression.LiteralValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
}
else if (expression.IsVariableReference && expression.VariableReference.SegmentCount == 2)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" = await context.ReadStateAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(">(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.VariableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("\", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.NamespaceAlias));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
}
else if (expression.IsVariableReference)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" = await context.EvaluateExpressionAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.VariableReference.ToString())));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(" = await context.EvaluateExpressionAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultTypeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.ExpressionText)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateRecordExpressionTemplate.tt"
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
void EvaluateStringExpression(StringExpression expression, string targetVariable, bool isNullable = false)
{
string typeName = isNullable ? "string?" : "string";
if (expression is null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(isNullable ? "null" : "string.Empty"));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
}
else if (expression.IsLiteral)
{
if (expression.LiteralValue.Contains("\n"))
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" = \n \"\"\"\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.LiteralValue));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\n \"\"\";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.LiteralValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
}
}
else if (expression.IsVariableReference && expression.VariableReference.SegmentCount == 2)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" = await context.ReadStateAsync<string>(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.VariableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.NamespaceAlias));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
}
else if (expression.IsVariableReference)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<string>(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.VariableReference.ToString())));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(typeName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<string>(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.ExpressionText)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateStringExpressionTemplate.tt"
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
void EvaluateValueExpression(ValueExpression expression, string targetVariable) =>
EvaluateValueExpression<object>(expression, targetVariable);
void EvaluateValueExpression<TValue>(ValueExpression expression, string targetVariable)
{
if (expression is null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(" = null;");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
}
else if (expression.IsLiteral)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(" = ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatDataValue(expression.LiteralValue)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(";");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
}
else if (expression.IsVariableReference && expression.VariableReference.SegmentCount == 2)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(" = await context.ReadStateAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(">(key: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.VariableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("\", scopeName: \"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(expression.VariableReference.NamespaceAlias));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("\").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
}
else if (expression.IsVariableReference)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.VariableReference.ToString())));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write("? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetVariable));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(" = await context.EvaluateValueAsync<");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetTypeAlias<TValue>()));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(">(");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(FormatStringValue(expression.ExpressionText)));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
this.Write(").ConfigureAwait(false);");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\EvaluateValueExpressionTemplate.tt"
}
}
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
void EvaluateMessageTemplate(TemplateLine templateLine, string variableName)
{
if (templateLine is not null)
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write("\n string ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(variableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write(" =\n await context.FormatTemplateAsync(\n \"\"\"");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
FormatMessageTemplate(templateLine);
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write("\n \"\"\");");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
}
else
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write("\n string? ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(variableName));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write(" = null;");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
}
}
void FormatMessageTemplate(TemplateLine line)
{
foreach (string text in line.ToTemplateString().ByLine())
{
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write("\n ");
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(text));
#line default
#line hidden
#line 1 "C:\Users\crickman\source\repos\af5\dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\CodeGen\Snippets\FormatMessageTemplate.tt"
}
}
#line default
#line hidden
}
#line default
#line hidden
}