Skip to content

Commit d4aae57

Browse files
authored
init (#42455)
1 parent b1b22a5 commit d4aae57

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ async def request_api(
208208
flag = True
209209
while flag:
210210
try:
211-
response = session.evaluations.operation_results(operation_id, headers=headers)
211+
response = session.red_teams.operation_results(operation_id, headers=headers)
212212
except Exception as e:
213213
from types import SimpleNamespace # pylint: disable=forgotten-debug-statement
214214

@@ -217,9 +217,10 @@ async def request_api(
217217
response_data = response
218218
flag = False
219219
break
220-
if response.status_code == 200:
221-
response_data = cast(List[Dict], response.json())
220+
if not isinstance(response, SimpleNamespace) and response.get("object") == "chat.completion":
221+
response_data = response
222222
flag = False
223+
break
223224
else:
224225
request_count += 1
225226
sleep_time = RAIService.SLEEP_TIME**request_count

0 commit comments

Comments
 (0)