Skip to content

Commit dcf44cc

Browse files
authored
redteam bugfix for processing prompts (#43627)
1 parent 648cd38 commit dcf44cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ async def _prompt_sending_orchestrator(
284284
else None
285285
)
286286

287+
# Initialize processed_prompt with the original prompt as default
288+
processed_prompt = prompt
289+
287290
# Determine how to handle the prompt based on target type and context fields
288291
if isinstance(chat_target, _CallbackChatTarget):
289292
# CallbackChatTarget: Always pass contexts via context_dict, embed in prompt content
@@ -511,6 +514,9 @@ async def _multi_turn_orchestrator(
511514
ctx.get("content", "") if isinstance(ctx, dict) else str(ctx) for ctx in contexts
512515
)
513516

517+
# Initialize processed_prompt with the original prompt as default
518+
processed_prompt = prompt
519+
514520
# Determine how to handle the prompt based on target type and context fields
515521
if isinstance(chat_target, _CallbackChatTarget):
516522
# CallbackChatTarget: Always pass contexts via context_dict, embed in prompt content
@@ -756,6 +762,9 @@ async def _crescendo_orchestrator(
756762
ctx.get("content", "") if isinstance(ctx, dict) else str(ctx) for ctx in contexts
757763
)
758764

765+
# Initialize processed_prompt with the original prompt as default
766+
processed_prompt = prompt
767+
759768
# Determine how to handle the prompt based on target type and context fields
760769
if isinstance(chat_target, _CallbackChatTarget):
761770
# CallbackChatTarget: Always pass contexts via context_dict, embed in prompt content

0 commit comments

Comments
 (0)