Skip to content

Update_Model_Api_Key #41983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ evaluation_response: Evaluation = project_client.evaluations.create(
evaluation,
headers={
"model-endpoint": model_endpoint,
"api-key": model_api_key,
"model-api-key": model_api_key,
},
)
print(evaluation_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
evaluation,
headers={
"model-endpoint": model_endpoint,
"api-key": model_api_key,
"model-api-key": model_api_key,
},
)
print(evaluation_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
evaluation,
headers={
"model-endpoint": model_endpoint,
"api-key": model_api_key,
"model-api-key": model_api_key,
},
)
print(evaluation_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def main() -> None:
evaluation,
headers={
"model-endpoint": model_endpoint,
"api-key": model_api_key,
"model-api-key": model_api_key,
},
)
print(evaluation_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
red_team=red_team,
headers={
"model-endpoint": model_endpoint,
"api-key": model_api_key,
"model-api-key": model_api_key,
},
)
print(f"Red Team scan created with scan name: {red_team_response.name}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def sample_red_team_async() -> None:
red_team=red_team,
headers={
"model-endpoint": model_endpoint,
"api-key": model_api_key,
"model-api-key": model_api_key,
Copy link
Preview

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the header key string 'model-api-key' into a shared constant (e.g. MODEL_API_KEY_HEADER) to avoid duplication across samples and minimize the risk of typos.

Suggested change
"model-api-key": model_api_key,
MODEL_API_KEY_HEADER: model_api_key,

Copilot uses AI. Check for mistakes.

},
)
print(f"Red Team scan created with scan name: {red_team_response.name}")
Expand Down