mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fixed (#2204)
This commit is contained in:
+6
@@ -40,6 +40,12 @@ internal static class PortableValueExtensions
|
||||
private static TableValue ToTable(this PortableValue[] values)
|
||||
{
|
||||
FormulaValue[] formulaValues = values.Select(value => value.ToFormula()).ToArray();
|
||||
|
||||
if (formulaValues.Length == 0)
|
||||
{
|
||||
return FormulaValue.NewTable(RecordType.Empty());
|
||||
}
|
||||
|
||||
if (formulaValues[0] is RecordValue recordValue)
|
||||
{
|
||||
return FormulaValue.NewTable(ParseRecordType(recordValue), formulaValues.OfType<RecordValue>());
|
||||
|
||||
+7
@@ -53,6 +53,13 @@ public sealed class PortableValueExtensionsTests
|
||||
[Fact]
|
||||
public void ChatMessageType() => TestValidType(new ChatMessage(ChatRole.User, "input"), RecordType.Empty());
|
||||
|
||||
[Fact]
|
||||
public void ListEmptyType()
|
||||
{
|
||||
TableValue convertedValue = (TableValue)TestValidType(Array.Empty<int>(), TableType.Empty());
|
||||
Assert.Equal(0, convertedValue.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ListSimpleType()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user