mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-29 06:07:11 +02:00
chore: update sidecar nuget packages
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -9,10 +9,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="GitHub.Copilot.SDK" Version="0.2.0" />
|
<PackageReference Include="GitHub.Copilot.SDK" Version="0.2.1" />
|
||||||
<PackageReference Include="Microsoft.Agents.AI" Version="1.0.0-rc4" />
|
<PackageReference Include="Microsoft.Agents.AI" Version="1.0.0" />
|
||||||
<PackageReference Include="Microsoft.Agents.AI.GitHub.Copilot" Version="1.0.0-preview.260311.1" />
|
<PackageReference Include="Microsoft.Agents.AI.GitHub.Copilot" Version="1.0.0-preview.260402.1" />
|
||||||
<PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0-rc4" />
|
<PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -226,19 +226,19 @@ internal sealed class CopilotAgentBundle : IAsyncDisposable
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static HandoffsWorkflowBuilder CreateHandoffWorkflowBuilder(
|
internal static HandoffWorkflowBuilder CreateHandoffWorkflowBuilder(
|
||||||
AIAgent entryAgent,
|
AIAgent entryAgent,
|
||||||
HandoffModeSettingsDto? settings = null)
|
HandoffModeSettingsDto? settings = null)
|
||||||
{
|
{
|
||||||
HandoffModeSettingsDto effectiveSettings = settings ?? new HandoffModeSettingsDto();
|
HandoffModeSettingsDto effectiveSettings = settings ?? new HandoffModeSettingsDto();
|
||||||
HandoffsWorkflowBuilder builder = AgentWorkflowBuilder.CreateHandoffBuilderWith(entryAgent)
|
HandoffWorkflowBuilder builder = AgentWorkflowBuilder.CreateHandoffBuilderWith(entryAgent)
|
||||||
.WithToolCallFilteringBehavior(MapHandoffToolCallFiltering(effectiveSettings.ToolCallFiltering))
|
.WithToolCallFilteringBehavior(MapHandoffToolCallFiltering(effectiveSettings.ToolCallFiltering))
|
||||||
.WithHandoffInstructions(NormalizeOptionalString(effectiveSettings.HandoffInstructions)
|
.WithHandoffInstructions(NormalizeOptionalString(effectiveSettings.HandoffInstructions)
|
||||||
?? HandoffWorkflowGuidance.CreateWorkflowInstructions());
|
?? HandoffWorkflowGuidance.CreateWorkflowInstructions());
|
||||||
|
|
||||||
if (effectiveSettings.ReturnToPrevious)
|
if (effectiveSettings.ReturnToPrevious)
|
||||||
{
|
{
|
||||||
TryEnableReturnToPrevious(builder);
|
builder = builder.EnableReturnToPrevious();
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
@@ -256,7 +256,7 @@ internal sealed class CopilotAgentBundle : IAsyncDisposable
|
|||||||
WorkflowNodeDto triageNode = ResolveTriageAgentNode(workflowDefinition, agentNodes);
|
WorkflowNodeDto triageNode = ResolveTriageAgentNode(workflowDefinition, agentNodes);
|
||||||
AIAgent triageAgent = ResolveAgentForNode(triageNode, agentsById);
|
AIAgent triageAgent = ResolveAgentForNode(triageNode, agentsById);
|
||||||
HandoffModeSettingsDto? settings = workflowDefinition.Settings.ModeSettings?.Handoff;
|
HandoffModeSettingsDto? settings = workflowDefinition.Settings.ModeSettings?.Handoff;
|
||||||
HandoffsWorkflowBuilder builder = CreateHandoffWorkflowBuilder(triageAgent, settings);
|
HandoffWorkflowBuilder builder = CreateHandoffWorkflowBuilder(triageAgent, settings);
|
||||||
|
|
||||||
List<WorkflowNodeDto> specialistNodes = agentNodes
|
List<WorkflowNodeDto> specialistNodes = agentNodes
|
||||||
.Where(node => !string.Equals(node.Id, triageNode.Id, StringComparison.Ordinal))
|
.Where(node => !string.Equals(node.Id, triageNode.Id, StringComparison.Ordinal))
|
||||||
@@ -448,13 +448,6 @@ internal sealed class CopilotAgentBundle : IAsyncDisposable
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void TryEnableReturnToPrevious(HandoffsWorkflowBuilder builder)
|
|
||||||
{
|
|
||||||
builder.GetType()
|
|
||||||
.GetMethod("EnableReturnToPrevious", Type.EmptyTypes)?
|
|
||||||
.Invoke(builder, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int ResolveGroupChatMaxRounds(WorkflowDefinitionDto workflowDefinition)
|
private static int ResolveGroupChatMaxRounds(WorkflowDefinitionDto workflowDefinition)
|
||||||
{
|
{
|
||||||
int? configuredMaxRounds = workflowDefinition.Settings.ModeSettings?.GroupChat?.MaxRounds;
|
int? configuredMaxRounds = workflowDefinition.Settings.ModeSettings?.GroupChat?.MaxRounds;
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ internal static class WorkflowRequestInfoInterpreter
|
|||||||
{
|
{
|
||||||
if (requestData.Is<McpServerToolCallContent>(out McpServerToolCallContent? mcpToolCall))
|
if (requestData.Is<McpServerToolCallContent>(out McpServerToolCallContent? mcpToolCall))
|
||||||
{
|
{
|
||||||
toolName = NormalizeOptionalString(mcpToolCall.ToolName)
|
toolName = NormalizeOptionalString(mcpToolCall.Name)
|
||||||
?? NormalizeOptionalString(mcpToolCall.ServerName)
|
?? NormalizeOptionalString(mcpToolCall.ServerName)
|
||||||
?? string.Empty;
|
?? string.Empty;
|
||||||
toolCallId = NormalizeOptionalString(mcpToolCall.CallId);
|
toolCallId = NormalizeOptionalString(mcpToolCall.CallId);
|
||||||
|
|||||||
@@ -8,10 +8,16 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="coverlet.collector" Version="6.0.2" />
|
<PackageReference Include="coverlet.collector" Version="8.0.1">
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PackageReference Include="xunit" Version="2.9.2" />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
|
||||||
|
<PackageReference Include="xunit" Version="2.9.3" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -163,12 +163,12 @@ public sealed class CopilotAgentBundleTests
|
|||||||
{
|
{
|
||||||
ChatClientAgent entryAgent = CreateChatClientAgent("agent-1", "Primary");
|
ChatClientAgent entryAgent = CreateChatClientAgent("agent-1", "Primary");
|
||||||
|
|
||||||
HandoffsWorkflowBuilder builder = CopilotAgentBundle.CreateHandoffWorkflowBuilder(entryAgent);
|
HandoffWorkflowBuilder builder = CopilotAgentBundle.CreateHandoffWorkflowBuilder(entryAgent);
|
||||||
|
|
||||||
FieldInfo field = typeof(HandoffsWorkflowBuilder).GetField(
|
FieldInfo field = GetInstanceField(
|
||||||
|
typeof(HandoffWorkflowBuilder),
|
||||||
"_toolCallFilteringBehavior",
|
"_toolCallFilteringBehavior",
|
||||||
BindingFlags.Instance | BindingFlags.NonPublic)
|
"Expected HandoffWorkflowBuilder to expose a filtering field.");
|
||||||
?? throw new InvalidOperationException("Expected HandoffsWorkflowBuilder to expose a filtering field.");
|
|
||||||
|
|
||||||
HandoffToolCallFilteringBehavior behavior = Assert.IsType<HandoffToolCallFilteringBehavior>(field.GetValue(builder));
|
HandoffToolCallFilteringBehavior behavior = Assert.IsType<HandoffToolCallFilteringBehavior>(field.GetValue(builder));
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ public sealed class CopilotAgentBundleTests
|
|||||||
{
|
{
|
||||||
ChatClientAgent entryAgent = CreateChatClientAgent("agent-1", "Primary");
|
ChatClientAgent entryAgent = CreateChatClientAgent("agent-1", "Primary");
|
||||||
|
|
||||||
HandoffsWorkflowBuilder builder = CopilotAgentBundle.CreateHandoffWorkflowBuilder(
|
HandoffWorkflowBuilder builder = CopilotAgentBundle.CreateHandoffWorkflowBuilder(
|
||||||
entryAgent,
|
entryAgent,
|
||||||
new HandoffModeSettingsDto
|
new HandoffModeSettingsDto
|
||||||
{
|
{
|
||||||
@@ -190,12 +190,17 @@ public sealed class CopilotAgentBundleTests
|
|||||||
HandoffInstructions = "Use custom delegation guidance.",
|
HandoffInstructions = "Use custom delegation guidance.",
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldInfo filteringField = typeof(HandoffsWorkflowBuilder).GetField(
|
FieldInfo filteringField = GetInstanceField(
|
||||||
|
typeof(HandoffWorkflowBuilder),
|
||||||
"_toolCallFilteringBehavior",
|
"_toolCallFilteringBehavior",
|
||||||
BindingFlags.Instance | BindingFlags.NonPublic)
|
"Expected HandoffWorkflowBuilder to expose a filtering field.");
|
||||||
?? throw new InvalidOperationException("Expected HandoffsWorkflowBuilder to expose a filtering field.");
|
FieldInfo returnToPreviousField = GetInstanceField(
|
||||||
|
typeof(HandoffWorkflowBuilder),
|
||||||
|
"_returnToPrevious",
|
||||||
|
"Expected HandoffWorkflowBuilder to expose a return-to-previous field.");
|
||||||
|
|
||||||
Assert.Equal(HandoffToolCallFilteringBehavior.All, filteringField.GetValue(builder));
|
Assert.Equal(HandoffToolCallFilteringBehavior.All, filteringField.GetValue(builder));
|
||||||
|
Assert.Equal(true, returnToPreviousField.GetValue(builder));
|
||||||
Assert.Equal("Use custom delegation guidance.", builder.HandoffInstructions);
|
Assert.Equal("Use custom delegation guidance.", builder.HandoffInstructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -631,6 +636,20 @@ public sealed class CopilotAgentBundleTests
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static FieldInfo GetInstanceField(Type type, string name, string errorMessage)
|
||||||
|
{
|
||||||
|
for (Type? current = type; current is not null; current = current.BaseType)
|
||||||
|
{
|
||||||
|
FieldInfo? field = current.GetField(name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
|
||||||
|
if (field is not null)
|
||||||
|
{
|
||||||
|
return field;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new InvalidOperationException(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
private static AIFunctionDeclaration CreateHandoffDeclaration()
|
private static AIFunctionDeclaration CreateHandoffDeclaration()
|
||||||
{
|
{
|
||||||
return AIFunctionFactory.CreateDeclaration(
|
return AIFunctionFactory.CreateDeclaration(
|
||||||
|
|||||||
@@ -317,8 +317,7 @@ public sealed class WorkflowRequestInfoInterpreterTests
|
|||||||
Type type = Type.GetType(
|
Type type = Type.GetType(
|
||||||
"Microsoft.Extensions.AI.CodeInterpreterToolCallContent, Microsoft.Extensions.AI.Abstractions",
|
"Microsoft.Extensions.AI.CodeInterpreterToolCallContent, Microsoft.Extensions.AI.Abstractions",
|
||||||
throwOnError: true)!;
|
throwOnError: true)!;
|
||||||
object instance = Activator.CreateInstance(type)!;
|
object instance = Activator.CreateInstance(type, callId)!;
|
||||||
type.GetProperty("CallId")!.SetValue(instance, callId);
|
|
||||||
if (inputs.Length > 0)
|
if (inputs.Length > 0)
|
||||||
{
|
{
|
||||||
Type aiContentType = Type.GetType(
|
Type aiContentType = Type.GetType(
|
||||||
@@ -363,7 +362,7 @@ public sealed class WorkflowRequestInfoInterpreterTests
|
|||||||
Type type = Type.GetType(
|
Type type = Type.GetType(
|
||||||
"Microsoft.Extensions.AI.ImageGenerationToolCallContent, Microsoft.Extensions.AI.Abstractions",
|
"Microsoft.Extensions.AI.ImageGenerationToolCallContent, Microsoft.Extensions.AI.Abstractions",
|
||||||
throwOnError: true)!;
|
throwOnError: true)!;
|
||||||
return Activator.CreateInstance(type)!;
|
return Activator.CreateInstance(type, "image-call-1")!;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static object CreateHandoffTarget(string id, string name)
|
private static object CreateHandoffTarget(string id, string name)
|
||||||
|
|||||||
Reference in New Issue
Block a user