Skip to content

Commit 419d117

Browse files
committed
Add developer quickstart sample
1 parent 81c4795 commit 419d117

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "10.*-rc*"
4+
}
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// SAMPLE: Generate text from a simple prompt
2+
// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start
3+
#pragma warning disable OPENAI001
4+
5+
#:package OpenAI@2.*
6+
#:property PublishAot=false
7+
8+
using OpenAI.Responses;
9+
10+
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
11+
OpenAIResponseClient client = new(model: "gpt-5", apiKey: key);
12+
OpenAIResponse response = client.CreateResponse("Write a short bedtime story about a unicorn.");
13+
14+
Console.WriteLine(response.GetOutputText());

0 commit comments

Comments
 (0)