Skip to content

Commit dc4e967

Browse files
committed
Update model_auditor.py
Fix target model receiving only latest probe instead of full conversation history _call_async was building a fresh [system, user] message list on every turn, so the target model had no memory of prior turns. Added a `history` parameter and pass the full conversation list when calling the target in run_scenario.
1 parent 44014de commit dc4e967

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

simpleaudit/model_auditor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@ async def _call_async(
111111
system: Optional[str],
112112
user: str,
113113
response_format: Optional[Dict[str, str]] = None,
114+
history: Optional[List[Dict]] = None,
114115
) -> str:
115116
messages = []
116117
if system:
117118
messages.append({"role": "system", "content": system})
118-
messages.append({"role": "user", "content": user})
119+
if history:
120+
messages.extend(history)
121+
else:
122+
messages.append({"role": "user", "content": user})
119123
kwargs: Dict[str, Any] = {
120124
"model": model,
121125
"messages": messages,
@@ -260,6 +264,7 @@ async def run_scenario(
260264
self.target_model,
261265
self.system_prompt,
262266
probe,
267+
history=conversation,
263268
)
264269
response = ModelAuditor.strip_thinking(response)
265270

0 commit comments

Comments
 (0)