Skip to content

Commit 86d9bd5

Browse files
nagkumar91Nagkumar ArkalgudNagkumar ArkalgudCopilot
authored
Change headers for redteam agent scan session id (#41964)
* Prepare evals SDK Release * Fix bug * Fix for ADV_CONV for FDP projects * Update release date * re-add pyrit to matrix * Change grader ids * Update unit test * replace all old grader IDs in tests * Update platform-matrix.json Add pyrit and not remove the other one * Update test to ensure everything is mocked * tox/black fixes * Skip that test with issues * update grader ID according to API View feedback * Update test * remove string check for grader ID * Update changelog and officialy start freeze * update the enum according to suggestions * update the changelog * Finalize logic * Initial plan * Fix client request ID headers in azure-ai-evaluation Co-authored-by: nagkumar91 <4727422+nagkumar91@users.noreply.github.com> * Fix client request ID header format in rai_service.py Co-authored-by: nagkumar91 <4727422+nagkumar91@users.noreply.github.com> --------- Co-authored-by: Nagkumar Arkalgud <nagkumar@naarkalg-work-mac.local> Co-authored-by: Nagkumar Arkalgud <nagkumar@Mac.lan> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nagkumar91 <4727422+nagkumar91@users.noreply.github.com>
1 parent 70db1ec commit 86d9bd5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_common/rai_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ async def submit_request_onedp(
290290
payload = generate_payload(normalized_user_text, metric, annotation_task=annotation_task)
291291
headers = get_common_headers(token, evaluator_name)
292292
if scan_session_id:
293-
headers["client_request_id"] = scan_session_id
293+
headers["x-ms-client-request-id"] = scan_session_id
294294
response = client.evaluations.submit_annotation(payload, headers=headers)
295295
result = json.loads(response)
296296
operation_id = result["location"].split("/")[-1]

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_model_tools/_generated_rai_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async def get_attack_objectives(
124124
risk_category=risk_category,
125125
lang="en",
126126
strategy=strategy,
127-
headers={"client_request_id": scan_session_id},
127+
headers={"x-ms-client-request-id": scan_session_id},
128128
)
129129
return response
130130

@@ -146,7 +146,7 @@ async def get_jailbreak_prefixes(self, scan_session_id: Optional[str] = None) ->
146146
try:
147147
# Send the request using the autogenerated client
148148
response = self._client.get_jail_break_dataset_with_type(
149-
type="upia", headers={"client_request_id": scan_session_id}
149+
type="upia", headers={"x-ms-client-request-id": scan_session_id}
150150
)
151151
if isinstance(response, list):
152152
return response

0 commit comments

Comments
 (0)