mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Clean / address some message warnings (#291)
* WIP * Structured Output sample * Update dotnet/samples/GettingStarted/Steps/Step06_ChatClientAgent_StructuredOutputs.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address xml and comment targeting the Structured Output context * Update with proposed fix for Persistent ChatClient * Address PR feedback * Address minor warnings * Address initialization * Address initialization * Address PR comments, update suggestions * Revert changes to NullableAttributese.cs --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
cbb05e210f
commit
9faa27b8eb
@@ -72,28 +72,11 @@ public sealed class TestConfiguration
|
||||
this._configRoot = configRoot;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the configuration root for the application.
|
||||
/// </summary>
|
||||
private static IConfigurationRoot? ConfigurationRoot => s_instance?._configRoot;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the configuration settings for the AzureAI integration.
|
||||
/// </summary>
|
||||
public static AzureAIConfig AzureAI => LoadSection<AzureAIConfig>();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a configuration section based on the specified key.
|
||||
/// </summary>
|
||||
/// <param name="caller">The key identifying the configuration section to retrieve. Cannot be null or empty.</param>
|
||||
/// <returns>The <see cref="IConfigurationSection"/> corresponding to the specified key.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the configuration root is not initialized or the specified key does not correspond to a valid section.</exception>
|
||||
private static IConfigurationSection GetSection(string caller)
|
||||
{
|
||||
return s_instance?._configRoot.GetSection(caller) ??
|
||||
throw new InvalidOperationException(caller);
|
||||
}
|
||||
|
||||
private static T LoadSection<T>([CallerMemberName] string? caller = null)
|
||||
{
|
||||
if (s_instance is null)
|
||||
|
||||
Reference in New Issue
Block a user