From 9414a15bb9c5ab224ff391c6d774d4c154cc9159 Mon Sep 17 00:00:00 2001 From: Justin Yoo Date: Thu, 11 Sep 2025 16:39:01 +0900 Subject: [PATCH 1/3] Update file-based apps to be aligned with .NET 10 RC1 - Updated #:property directive - Added OPENAI001 warning suppression --- docs/guides/global.json | 2 +- docs/guides/text/chat/chat_instructions.cs | 6 +++--- docs/guides/text/chat/chat_roles.cs | 8 +++++--- docs/guides/text/chat/chat_simpleprompt.cs | 6 +++--- docs/guides/text/responses/responses_fileinput.cs | 6 ++++-- docs/guides/text/responses/responses_instructions.cs | 8 +++++--- docs/guides/text/responses/responses_prompttemplate.cs | 6 ++++-- docs/guides/text/responses/responses_roles.cs | 8 +++++--- docs/guides/text/responses/responses_simpleprompt.cs | 8 +++++--- 9 files changed, 35 insertions(+), 23 deletions(-) diff --git a/docs/guides/global.json b/docs/guides/global.json index c0facce53..20dc84cd1 100644 --- a/docs/guides/global.json +++ b/docs/guides/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "10.*-preview" + "allowPrerelease": true } } \ No newline at end of file diff --git a/docs/guides/text/chat/chat_instructions.cs b/docs/guides/text/chat/chat_instructions.cs index b9ed0f18c..afe0177fa 100644 --- a/docs/guides/text/chat/chat_instructions.cs +++ b/docs/guides/text/chat/chat_instructions.cs @@ -1,9 +1,9 @@ // SAMPLE: Generate text with messages using different roles -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false -using OpenAI.Chat; +using OpenAI.Chat; string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; ChatClient client = new("gpt-4.1", key); diff --git a/docs/guides/text/chat/chat_roles.cs b/docs/guides/text/chat/chat_roles.cs index 2353dc5bf..360b9915e 100644 --- a/docs/guides/text/chat/chat_roles.cs +++ b/docs/guides/text/chat/chat_roles.cs @@ -1,9 +1,11 @@ // SAMPLE: Generate text with messages using different roles -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +#pragma warning disable OPENAI001 + #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false -using OpenAI.Chat; +using OpenAI.Chat; string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; ChatClient client = new("gpt-4.1", key); diff --git a/docs/guides/text/chat/chat_simpleprompt.cs b/docs/guides/text/chat/chat_simpleprompt.cs index 11378d4c6..eedeb0be6 100644 --- a/docs/guides/text/chat/chat_simpleprompt.cs +++ b/docs/guides/text/chat/chat_simpleprompt.cs @@ -1,9 +1,9 @@ // SAMPLE: Generate text from a simple prompt -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false -using OpenAI.Chat; +using OpenAI.Chat; string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; ChatClient client = new("gpt-4.1", key); diff --git a/docs/guides/text/responses/responses_fileinput.cs b/docs/guides/text/responses/responses_fileinput.cs index 16930bef5..be9a7e49a 100644 --- a/docs/guides/text/responses/responses_fileinput.cs +++ b/docs/guides/text/responses/responses_fileinput.cs @@ -1,7 +1,9 @@ // SAMPLE: Prompt template with file input variable -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +#pragma warning disable OPENAI001 + #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false using OpenAI.Responses; using OpenAI.Files; diff --git a/docs/guides/text/responses/responses_instructions.cs b/docs/guides/text/responses/responses_instructions.cs index e60e5e086..e2edd941c 100644 --- a/docs/guides/text/responses/responses_instructions.cs +++ b/docs/guides/text/responses/responses_instructions.cs @@ -1,9 +1,11 @@ // SAMPLE: Generate text with instructions -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +#pragma warning disable OPENAI001 + #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false -using OpenAI.Responses; +using OpenAI.Responses; string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; OpenAIResponseClient client = new("gpt-4.1", key); diff --git a/docs/guides/text/responses/responses_prompttemplate.cs b/docs/guides/text/responses/responses_prompttemplate.cs index 755a7542f..3061f4098 100644 --- a/docs/guides/text/responses/responses_prompttemplate.cs +++ b/docs/guides/text/responses/responses_prompttemplate.cs @@ -1,7 +1,9 @@ // SAMPLE: Generate text with a prompt template -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +#pragma warning disable OPENAI001 + #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false using OpenAI.Responses; using System.ClientModel; diff --git a/docs/guides/text/responses/responses_roles.cs b/docs/guides/text/responses/responses_roles.cs index 9100d6550..ec433b699 100644 --- a/docs/guides/text/responses/responses_roles.cs +++ b/docs/guides/text/responses/responses_roles.cs @@ -1,9 +1,11 @@ // SAMPLE: Generate text with messages using different roles -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +#pragma warning disable OPENAI001 + #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false -using OpenAI.Responses; +using OpenAI.Responses; string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; OpenAIResponseClient client = new("gpt-4.1", key); diff --git a/docs/guides/text/responses/responses_simpleprompt.cs b/docs/guides/text/responses/responses_simpleprompt.cs index 20abdcba4..b353c4986 100644 --- a/docs/guides/text/responses/responses_simpleprompt.cs +++ b/docs/guides/text/responses/responses_simpleprompt.cs @@ -1,9 +1,11 @@ // SAMPLE: Generate text from a simple prompt -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +#pragma warning disable OPENAI001 + #:package OpenAI@2.2.*-* -#:property PublishAot false +#:property PublishAot=false -using OpenAI.Responses; +using OpenAI.Responses; string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; OpenAIResponseClient client = new("gpt-4.1", key); From 520a226d7b89603a3f972e8a3f2ca14322e024a8 Mon Sep 17 00:00:00 2001 From: Justin Yoo Date: Thu, 11 Sep 2025 16:51:09 +0900 Subject: [PATCH 2/3] Update OpenAI SDK version from 2.2.*-* to 2.* --- docs/guides/text/chat/chat_instructions.cs | 2 +- docs/guides/text/chat/chat_roles.cs | 2 +- docs/guides/text/chat/chat_simpleprompt.cs | 2 +- docs/guides/text/chat/chat_tools.cs | 8 ++++---- docs/guides/text/responses/responses_fileinput.cs | 2 +- docs/guides/text/responses/responses_instructions.cs | 2 +- docs/guides/text/responses/responses_prompttemplate.cs | 2 +- docs/guides/text/responses/responses_roles.cs | 2 +- docs/guides/text/responses/responses_simpleprompt.cs | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/guides/text/chat/chat_instructions.cs b/docs/guides/text/chat/chat_instructions.cs index afe0177fa..4223b2165 100644 --- a/docs/guides/text/chat/chat_instructions.cs +++ b/docs/guides/text/chat/chat_instructions.cs @@ -1,6 +1,6 @@ // SAMPLE: Generate text with messages using different roles // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Chat; diff --git a/docs/guides/text/chat/chat_roles.cs b/docs/guides/text/chat/chat_roles.cs index 360b9915e..5925e5480 100644 --- a/docs/guides/text/chat/chat_roles.cs +++ b/docs/guides/text/chat/chat_roles.cs @@ -2,7 +2,7 @@ // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #pragma warning disable OPENAI001 -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Chat; diff --git a/docs/guides/text/chat/chat_simpleprompt.cs b/docs/guides/text/chat/chat_simpleprompt.cs index eedeb0be6..f7e80838e 100644 --- a/docs/guides/text/chat/chat_simpleprompt.cs +++ b/docs/guides/text/chat/chat_simpleprompt.cs @@ -1,6 +1,6 @@ // SAMPLE: Generate text from a simple prompt // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Chat; diff --git a/docs/guides/text/chat/chat_tools.cs b/docs/guides/text/chat/chat_tools.cs index b49b282e1..89237f56d 100644 --- a/docs/guides/text/chat/chat_tools.cs +++ b/docs/guides/text/chat/chat_tools.cs @@ -1,9 +1,9 @@ // SAMPLE: Generate text from a simple prompt -// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start -#:package OpenAI@2.2.*-* +// GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start +#:package OpenAI@2.* #:property PublishAot=false -using OpenAI.Chat; +using OpenAI.Chat; string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; ChatClient client = new("gpt-4.1", key); @@ -15,7 +15,7 @@ functionParameters: BinaryData.FromObjectAsJson(new { type = "object", - properties = new + properties = new { utc = new { diff --git a/docs/guides/text/responses/responses_fileinput.cs b/docs/guides/text/responses/responses_fileinput.cs index be9a7e49a..f20a93da1 100644 --- a/docs/guides/text/responses/responses_fileinput.cs +++ b/docs/guides/text/responses/responses_fileinput.cs @@ -2,7 +2,7 @@ // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #pragma warning disable OPENAI001 -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Responses; diff --git a/docs/guides/text/responses/responses_instructions.cs b/docs/guides/text/responses/responses_instructions.cs index e2edd941c..b5dedf5a6 100644 --- a/docs/guides/text/responses/responses_instructions.cs +++ b/docs/guides/text/responses/responses_instructions.cs @@ -2,7 +2,7 @@ // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #pragma warning disable OPENAI001 -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Responses; diff --git a/docs/guides/text/responses/responses_prompttemplate.cs b/docs/guides/text/responses/responses_prompttemplate.cs index 3061f4098..e8180f718 100644 --- a/docs/guides/text/responses/responses_prompttemplate.cs +++ b/docs/guides/text/responses/responses_prompttemplate.cs @@ -2,7 +2,7 @@ // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #pragma warning disable OPENAI001 -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Responses; diff --git a/docs/guides/text/responses/responses_roles.cs b/docs/guides/text/responses/responses_roles.cs index ec433b699..b379c0e1c 100644 --- a/docs/guides/text/responses/responses_roles.cs +++ b/docs/guides/text/responses/responses_roles.cs @@ -2,7 +2,7 @@ // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #pragma warning disable OPENAI001 -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Responses; diff --git a/docs/guides/text/responses/responses_simpleprompt.cs b/docs/guides/text/responses/responses_simpleprompt.cs index b353c4986..6aa45f2d9 100644 --- a/docs/guides/text/responses/responses_simpleprompt.cs +++ b/docs/guides/text/responses/responses_simpleprompt.cs @@ -2,7 +2,7 @@ // GUIDANCE: Instructions to run this code: https://aka.ms/oai/net/start #pragma warning disable OPENAI001 -#:package OpenAI@2.2.*-* +#:package OpenAI@2.* #:property PublishAot=false using OpenAI.Responses; From b3a1669c52339badef381200015187780e8c2e07 Mon Sep 17 00:00:00 2001 From: Justin Yoo Date: Fri, 12 Sep 2025 01:23:51 +0900 Subject: [PATCH 3/3] Pin to .NET 10 RC version --- docs/guides/global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/global.json b/docs/guides/global.json index 20dc84cd1..6d1a5f4a6 100644 --- a/docs/guides/global.json +++ b/docs/guides/global.json @@ -1,5 +1,5 @@ { "sdk": { - "allowPrerelease": true + "version": "10.*-rc*" } } \ No newline at end of file