From 1952b3c06328365414f61556b1ed381ef473694e Mon Sep 17 00:00:00 2001 From: Alex Mohamed <110118144+Alex-Mohamed@users.noreply.github.com> Date: Wed, 31 Dec 2025 18:11:07 -0500 Subject: [PATCH 1/2] Added Response API comments to azure.py example Added comments detailing how portions of the azure.py example could be replicated using the current standard for text generation (the Responses API). --- examples/azure.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/examples/azure.py b/examples/azure.py index 6936c4cb0e..821231a063 100755 --- a/examples/azure.py +++ b/examples/azure.py @@ -22,6 +22,13 @@ ) print(completion.to_json()) +# The code above uses the Chat Completions API to generate text, but this can also be accomplished with the Responses API +# response = client.responses.create( +# model="deployment-name" +# input="How do I output all files in a directory using Python?", +# ) +# print(response.to_json()) + deployment_client = AzureOpenAI( api_version=api_version, @@ -41,3 +48,10 @@ ], ) print(completion.to_json()) + +# The code above uses the Chat Completions API to generate text, but this can also be accomplished with the Responses API +# response = deployment_client.responses.create( +# model="" +# input="How do I output all files in a directory using Python?", +# ) +# print(response.to_json()) From 3be04387b85454e8b446b8a34c0170f33e8ce968 Mon Sep 17 00:00:00 2001 From: Alex Mohamed <110118144+Alex-Mohamed@users.noreply.github.com> Date: Wed, 31 Dec 2025 18:35:47 -0500 Subject: [PATCH 2/2] Added commas to Response API code comments in azure.py example --- examples/azure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/azure.py b/examples/azure.py index 821231a063..dee3d422cb 100755 --- a/examples/azure.py +++ b/examples/azure.py @@ -24,7 +24,7 @@ # The code above uses the Chat Completions API to generate text, but this can also be accomplished with the Responses API # response = client.responses.create( -# model="deployment-name" +# model="deployment-name", # input="How do I output all files in a directory using Python?", # ) # print(response.to_json()) @@ -51,7 +51,7 @@ # The code above uses the Chat Completions API to generate text, but this can also be accomplished with the Responses API # response = deployment_client.responses.create( -# model="" +# model="", # input="How do I output all files in a directory using Python?", # ) # print(response.to_json())