mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
2c75f13337
* Add Streaming API * Removing InstructionsRole * Updating thread notification strategy * Fix net472 failing * Small fixes * Adding Samples for OpenAI * WIP samples * default runsettings for unit tests * Adding first samples with OpenAIModelChatClientAgents * Removing OpenAI dependency on the sample utility * Release -> Debug update for GettingStarted project * Fix GettingStarted.csproj failing to build in Release * Update dotnet/src/Shared/Samples/BaseSample.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address PR feedback * Fix Step 1 samples * Simplify code * Address PR feedback --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
16 lines
438 B
C#
16 lines
438 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using Microsoft.Extensions.AI;
|
|
using Microsoft.Shared.Samples;
|
|
using OpenAI;
|
|
|
|
namespace GettingStarted;
|
|
|
|
public class AgentSample(ITestOutputHelper output) : BaseSample(output)
|
|
{
|
|
protected IChatClient GetOpenAIChatClient()
|
|
=> new OpenAIClient(TestConfiguration.OpenAI.ApiKey)
|
|
.GetChatClient(TestConfiguration.OpenAI.ChatModelId)
|
|
.AsIChatClient();
|
|
}
|