Skip to content

Commit 3a4636e

Browse files
authored
adding max_simulation_results for sync call (#34923)
* adding max_simulation_results for sync call * # pylint: skip-file * # pylint: disable=E0611 * # pylint: disable=E0611
1 parent ce9bea7 commit 3a4636e

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

sdk/ai/azure-ai-generative/azure/ai/generative/evaluate/_local_flow_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ---------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
4+
# pylint: disable=E0611
5+
46
import logging
57
import pandas as pd
68

sdk/ai/azure-ai-generative/azure/ai/generative/evaluate/_metric_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def calculate_metrics(self) -> Dict:
6666
dict_list = self._get_data_for_pf_by_task_type(metrics)
6767

6868
flow_path = path.join(path.dirname(__file__), "pf_templates", "built_in_metrics", self.task_type)
69-
69+
# pylint: disable=E0611
7070
from promptflow import PFClient
7171
from promptflow.entities import AzureOpenAIConnection, OpenAIConnection
7272

sdk/ai/azure-ai-generative/azure/ai/generative/evaluate/_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ---------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
4+
# pylint: skip-file
45
import os.path
56
import json
67
import pathlib

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ def _wrap_async(
491491
api_call_retry_sleep_sec: int = 1,
492492
api_call_delay_sec: float = 0,
493493
concurrent_async_task: int = 1,
494+
max_simulation_results: int = 3,
494495
):
495496
if parameters is None:
496497
parameters = []
@@ -503,6 +504,7 @@ def _wrap_async(
503504
api_call_retry_limit=api_call_retry_limit,
504505
api_call_retry_sleep_sec=api_call_retry_sleep_sec,
505506
api_call_delay_sec=api_call_delay_sec,
507+
max_simulation_results=max_simulation_results,
506508
concurrent_async_task=concurrent_async_task,
507509
)
508510
)
@@ -517,6 +519,7 @@ def simulate(
517519
api_call_retry_limit: int = 3,
518520
api_call_retry_sleep_sec: int = 1,
519521
api_call_delay_sec: float = 0,
522+
max_simulation_results: int = 3,
520523
):
521524
"""
522525
Simulates a conversation using a predefined template with customizable parameters and control over API behavior.
@@ -536,6 +539,8 @@ def simulate(
536539
:param api_call_delay_sec: The number of seconds to wait
537540
before making a new API call to simulate conversation delay.
538541
:type api_call_delay_sec: float, optional
542+
:keyword max_simulation_results: The maximum number of simulation results to return. Defaults to 3.
543+
:paramtype max_simulation_results: int, optional
539544
:return: The outcome of the simulated conversations as a list.
540545
:rtype: List[Dict]
541546
"""
@@ -555,6 +560,7 @@ def simulate(
555560
api_call_retry_limit,
556561
api_call_retry_sleep_sec,
557562
api_call_delay_sec,
563+
max_simulation_results,
558564
concurrent_async_task,
559565
),
560566
)

0 commit comments

Comments
 (0)