.NET Workflows - Update State Serialization for JSON Checkpointing (#1388)

* Checkpoint

* Checkpoint

* Namespace

* All ready

* Namespace

* Clean

* Fix
This commit is contained in:
Chris
2025-10-10 20:10:17 +00:00
committed by GitHub
parent 29cb87b805
commit 5fa153642e
17 changed files with 433 additions and 82 deletions
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using Microsoft.PowerFx.Types;
namespace Microsoft.Agents.AI.Workflows.Declarative.Extensions;
internal static class ExpandoObjectExtensions
{
public static RecordType ToRecordType(this ExpandoObject value)
{
RecordType recordType = RecordType.Empty();
foreach (KeyValuePair<string, object?> property in value)
{
recordType.Add(property.Key, property.Value.GetFormulaType());
}
return recordType;
}
public static RecordValue ToRecord(this ExpandoObject value) =>
FormulaValue.NewRecordFromFields(
value.Select(
property => new NamedValue(property.Key, property.Value.ToFormula())));
}