Skip to content

Commit ac7b9a3

Browse files
Automated sync from private repo (2026-04-10) (#652)
* Added snippet markers to Model Router samples (#144) * feat: add Model Router chat completion sample with environment setup and requirements * feat: update README and sample files for Model Router with Foundry Responses SDK integration * feat: add chat completion and foundry responses markers in sample scripts * Update sync state to c47f5c67c4e6 --------- Co-authored-by: Sanjeev Jagtap <sajagtap@microsoft.com> Co-authored-by: foundry-samples-repo-sync[bot] <foundry-samples-repo-sync[bot]@users.noreply.github.com>
1 parent 669ed03 commit ac7b9a3

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

.github/.sync-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
154cef9a84b8bdd6966acebaced70f9a5a0b3d46
1+
c47f5c67c4e6e732996a4a0d200e2b6026c9cd15

samples/python/foundry-models/model-router/model-router-chat-completions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
api_key = os.environ["AZURE_OPENAI_API_KEY"]
3030
deployment = os.environ["MODEL_DEPLOYMENT_NAME"]
3131

32+
# <chat_completion>
3233
client = AzureOpenAI(
3334
azure_endpoint=endpoint,
3435
api_key=api_key,
@@ -45,6 +46,7 @@
4546
},
4647
],
4748
)
49+
# </chat_completion>
4850

4951
print("--- Chat Completions Response ---")
5052
print(f"Routed to model: {response.model}")

samples/python/foundry-models/model-router/model-router-foundry-responses.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
project_endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"]
3434
deployment = os.environ["MODEL_DEPLOYMENT_NAME"]
3535

36+
# <foundry_responses>
3637
with (
3738
DefaultAzureCredential() as credential,
3839
AIProjectClient(endpoint=project_endpoint, credential=credential) as project_client,
@@ -42,6 +43,7 @@
4243
model=deployment,
4344
input="In one sentence, name the most popular tourist destination in Seattle.",
4445
)
46+
# </foundry_responses>
4547

4648
print("--- Foundry Responses SDK Output ---")
4749
print(f"Routed to model: {response.model}")

0 commit comments

Comments
 (0)