using NUnit.Framework;
using OpenAI.Chat;
using System;
using System.Threading.Tasks;
namespace OpenAI.Examples;
public partial class ChatExamples
{
[Test]
public async Task Example01_SimpleChatAsync()
{
ChatClient client = new(model: "gpt-4o", Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
ChatCompletion completion = await client.CompleteChatAsync("Say 'this is a test.'");
Console.WriteLine($"{completion}");
}
}openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
examples/Chat/Example01_SimpleChatAsync.cs
19lines · modepreview