We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5543e7 commit 50e4660Copy full SHA for 50e4660
docs/quickstart/responses/responses_generatetext.cs
@@ -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