Skip to content

Commit 03d9c53

Browse files
author
Ben Thomas
committed
Removing unused code.
1 parent 9a67abe commit 03d9c53

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

dotnet/src/Agents/Abstractions/Agent.cs

-45
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System;
33
using System.Collections.Generic;
44
using System.Diagnostics.CodeAnalysis;
5-
using System.Linq;
65
using System.Threading;
76
using System.Threading.Tasks;
87
using Microsoft.Extensions.Logging;
@@ -385,48 +384,4 @@ protected Task NotifyThreadOfNewMessage(AgentThread thread, ChatMessageContent m
385384
{
386385
return thread.OnNewMessageAsync(message, cancellationToken);
387386
}
388-
389-
/// <summary>
390-
/// Provides a merged instance of <see cref="KernelArguments"/> with precedence for override arguments.
391-
/// </summary>
392-
/// <param name="arguments">The override arguments.</param>
393-
/// <remarks>
394-
/// This merge preserves original <see cref="PromptExecutionSettings"/> and <see cref="KernelArguments"/> parameters.
395-
/// It allows for incremental addition or replacement of specific parameters while also preserving the ability
396-
/// to override the execution settings.
397-
/// </remarks>
398-
private KernelArguments MergeArguments(KernelArguments? arguments)
399-
{
400-
// Avoid merge when override arguments are not set.
401-
if (arguments == null)
402-
{
403-
return this.Arguments ?? [];
404-
}
405-
406-
// Avoid merge when the Agent arguments are not set.
407-
if (this.Arguments is null)
408-
{
409-
return arguments ?? [];
410-
}
411-
412-
// Both instances are not null, merge with precedence for override arguments.
413-
414-
// Merge execution settings with precedence for override arguments.
415-
Dictionary<string, PromptExecutionSettings>? settings =
416-
(arguments.ExecutionSettings ?? s_emptySettings)
417-
.Concat(this.Arguments.ExecutionSettings ?? s_emptySettings)
418-
.GroupBy(entry => entry.Key)
419-
.ToDictionary(entry => entry.Key, entry => entry.First().Value);
420-
421-
// Merge parameters with precedence for override arguments.
422-
Dictionary<string, object?>? parameters =
423-
arguments
424-
.Concat(this.Arguments)
425-
.GroupBy(entry => entry.Key)
426-
.ToDictionary(entry => entry.Key, entry => entry.First().Value);
427-
428-
return new KernelArguments(parameters, settings);
429-
}
430-
431-
private static readonly Dictionary<string, PromptExecutionSettings> s_emptySettings = [];
432387
}

0 commit comments

Comments
 (0)