Skip to content

Commit ced749c

Browse files
authored
Remove use of private _token_provider from pyrit (Azure#40385)
* remove use of private _token_provider from pyrit * pin pyrit
1 parent 3308694 commit ced749c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/red_team/_red_team.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,8 +1362,6 @@ async def _process_attack(
13621362
converter = self._get_converter_for_strategy(strategy)
13631363
try:
13641364
self.logger.debug(f"Calling orchestrator for {strategy_name} strategy")
1365-
if isinstance(self.chat_target,OpenAIChatTarget) and not self.chat_target._headers.get("Api-Key", None):
1366-
self.chat_target._headers["Authorization"] = f"Bearer {self.chat_target._token_provider()}"
13671365
orchestrator = await call_orchestrator(self.chat_target, all_prompts, converter, strategy_name, risk_category.value, timeout)
13681366
except PyritException as e:
13691367
log_error(self.logger, f"Error calling orchestrator for {strategy_name} strategy", e)

sdk/evaluation/azure-ai-evaluation/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
],
8484
extras_require={
8585
"redteam": [
86-
"pyrit>=0.8.1"
86+
"pyrit==0.8.1"
8787
]
8888
},
8989
project_urls={

0 commit comments

Comments
 (0)