mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Fix bugbash issues (#448)
* Fix bugbash issues * Update dotnet/samples/GettingStarted/Providers/AIAgent_With_OpenAIResponseClient.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
using Microsoft.Shared.Diagnostics;
|
||||
using OpenAI.Responses;
|
||||
|
||||
namespace Microsoft.Extensions.AI.Agents;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="ChatOptions"/>
|
||||
/// </summary>
|
||||
public static class ChatOptionsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Disables the storage of response output in the chat options.
|
||||
/// </summary>
|
||||
/// <param name="options">Instance of <see cref="ChatOptions"/></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public static ChatOptions WithResponseStoredOutputDisabled(this ChatOptions options)
|
||||
{
|
||||
Throw.IfNull(options);
|
||||
|
||||
// We can use the RawRepresentationFactory to provide Response service specific
|
||||
// options. Here we can indicate that we do not want the service to store the
|
||||
// conversation in a service managed thread.
|
||||
options.RawRepresentationFactory = (_) => new ResponseCreationOptions() { StoredOutputEnabled = false };
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user