Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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="<ignored>",
# input="How do I output all files in a directory using Python?",
# )
# print(response.to_json())