Skip to content

Commit c5543e7

Browse files
authored
Create responses_overview.cs
Added overview sample code for main quickstart page
1 parent 65a46fb commit c5543e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SAMPLE: Developer QuickStart
2+
// GUIDANCE: https://platform.openai.com/docs/overview
3+
// HOWTO: Instructions to run this code: https://aka.ms/oai/net/start
4+
#:package OpenAI@2.2.*-*
5+
#:property PublishAot false
6+
7+
using OpenAI.Responses;
8+
9+
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
10+
OpenAIResponseClient client = new("gpt-4.1", key);
11+
OpenAIResponse response = client.CreateResponse("Write a one-sentence bedtime story about a unicorn.");
12+
Console.WriteLine(response.GetOutputText());

0 commit comments

Comments
 (0)