Skip to content

Commit 84012b6

Browse files
authored
Changed the parameter from max_count to limit (#34406)
1 parent c18f7ec commit 84012b6

File tree

1 file changed

+13
-13
lines changed
  • sdk/ai/azure-ai-generative/azure/ai/generative/synthetic/simulator/simulator

1 file changed

+13
-13
lines changed

sdk/ai/azure-ai-generative/azure/ai/generative/synthetic/simulator/simulator/simulator.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async def simulate_async(
216216
max_conversation_turns: int,
217217
parameters: List[dict] = [],
218218
jailbreak: bool = False,
219-
api_call_retry_max_count: int = 3,
219+
api_call_retry_limit: int = 3,
220220
api_call_retry_sleep_sec: int = 1,
221221
api_call_delay_sec: float = 0,
222222
concurrent_async_task: int = 3
@@ -233,8 +233,8 @@ async def simulate_async(
233233
:keyword jailbreak: If set to True, allows breaking out of the conversation flow defined by the template.
234234
Defaults to False.
235235
:paramtype jailbreak: bool, optional
236-
:keyword api_call_retry_max_count: The maximum number of API call retries in case of errors. Defaults to 3.
237-
:paramtype api_call_retry_max_count: int, optional
236+
:keyword api_call_retry_limit: The maximum number of API call retries in case of errors. Defaults to 3.
237+
:paramtype api_call_retry_limit: int, optional
238238
:keyword api_call_retry_sleep_sec: The time in seconds to wait between API call retries. Defaults to 1.
239239
:paramtype api_call_retry_sleep_sec: int, optional
240240
:keyword api_call_delay_sec: The time in seconds to wait between API calls. Defaults to 0.
@@ -287,7 +287,7 @@ async def simulate_async(
287287
template=t,
288288
parameters=p,
289289
max_conversation_turns=max_conversation_turns,
290-
api_call_retry_max_count=api_call_retry_max_count,
290+
api_call_retry_limit=api_call_retry_limit,
291291
api_call_delay_sec=api_call_delay_sec,
292292
sem=semaphore,
293293
)
@@ -303,7 +303,7 @@ async def _simulate_async(
303303
template: "Template",
304304
max_conversation_turns: int,
305305
parameters: dict = {},
306-
api_call_retry_max_count: int = 3,
306+
api_call_retry_limit: int = 3,
307307
api_call_retry_sleep_sec: int = 1,
308308
api_call_delay_sec: float = 0,
309309
sem: "asyncio.Semaphore" = asyncio.Semaphore(3),
@@ -318,7 +318,7 @@ async def _simulate_async(
318318
the simulations. Defaults to an empty list.
319319
jailbreak (bool, optional): If set to True, allows breaking out of the conversation flow defined by the
320320
template. Defaults to False.
321-
api_call_retry_max_count (int, optional): The maximum number of API call retries in case of errors.
321+
api_call_retry_limit (int, optional): The maximum number of API call retries in case of errors.
322322
Defaults to 3.
323323
api_call_retry_sleep_sec (int, optional): The time in seconds to wait between API call retries. Defaults to 1.
324324
api_call_delay_sec (float, optional): The time in seconds to wait between API calls. Defaults to 0.
@@ -339,7 +339,7 @@ async def _simulate_async(
339339
# simulate the conversation
340340

341341
asyncHttpClient = AsyncHTTPClientWithRetry(
342-
n_retry=api_call_retry_max_count,
342+
n_retry=api_call_retry_limit,
343343
retry_timeout=api_call_retry_sleep_sec,
344344
logger=logging.getLogger(),
345345
)
@@ -437,7 +437,7 @@ def _wrap_async(
437437
max_conversation_turns: int,
438438
parameters: List[dict] = [],
439439
jailbreak: bool = False,
440-
api_call_retry_max_count: int = 3,
440+
api_call_retry_limit: int = 3,
441441
api_call_retry_sleep_sec: int = 1,
442442
api_call_delay_sec: float = 0,
443443
concurrent_async_task: int = 1,
@@ -448,7 +448,7 @@ def _wrap_async(
448448
parameters=parameters,
449449
max_conversation_turns=max_conversation_turns,
450450
jailbreak=jailbreak,
451-
api_call_retry_max_count=api_call_retry_max_count,
451+
api_call_retry_limit=api_call_retry_limit,
452452
api_call_retry_sleep_sec=api_call_retry_sleep_sec,
453453
api_call_delay_sec=api_call_delay_sec,
454454
concurrent_async_task=concurrent_async_task,
@@ -462,7 +462,7 @@ def simulate(
462462
max_conversation_turns: int,
463463
parameters: List[dict] = [],
464464
jailbreak: bool = False,
465-
api_call_retry_max_count: int = 3,
465+
api_call_retry_limit: int = 3,
466466
api_call_retry_sleep_sec: int = 1,
467467
api_call_delay_sec: float = 0,
468468
):
@@ -477,8 +477,8 @@ def simulate(
477477
:type parameters: List[dict], optional
478478
:param jailbreak: A flag to determine if the simulation should continue when encountering API errors.
479479
:type jailbreak: bool, optional
480-
:param api_call_retry_max_count: The maximum number of retries for API calls upon encountering an error.
481-
:type api_call_retry_max_count: int, optional
480+
:param api_call_retry_limit: The maximum number of retries for API calls upon encountering an error.
481+
:type api_call_retry_limit: int, optional
482482
:param api_call_retry_sleep_sec: The number of seconds to wait between retry attempts of an API call.
483483
:type api_call_retry_sleep_sec: int, optional
484484
:param api_call_delay_sec: The number of seconds to wait before making a new API call to simulate conversation delay.
@@ -497,7 +497,7 @@ def simulate(
497497
max_conversation_turns,
498498
parameters,
499499
jailbreak,
500-
api_call_retry_max_count,
500+
api_call_retry_limit,
501501
api_call_retry_sleep_sec,
502502
api_call_delay_sec,
503503
concurrent_async_task,

0 commit comments

Comments
 (0)