Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# pylint: disable=E0611

import logging
import pandas as pd

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def calculate_metrics(self) -> Dict:
dict_list = self._get_data_for_pf_by_task_type(metrics)

flow_path = path.join(path.dirname(__file__), "pf_templates", "built_in_metrics", self.task_type)

# pylint: disable=E0611
from promptflow import PFClient
from promptflow.entities import AzureOpenAIConnection, OpenAIConnection

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# pylint: skip-file
import os.path
import json
import pathlib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ def _wrap_async(
api_call_retry_sleep_sec: int = 1,
api_call_delay_sec: float = 0,
concurrent_async_task: int = 1,
max_simulation_results: int = 3,
):
if parameters is None:
parameters = []
Expand All @@ -503,6 +504,7 @@ def _wrap_async(
api_call_retry_limit=api_call_retry_limit,
api_call_retry_sleep_sec=api_call_retry_sleep_sec,
api_call_delay_sec=api_call_delay_sec,
max_simulation_results=max_simulation_results,
concurrent_async_task=concurrent_async_task,
)
)
Expand All @@ -517,6 +519,7 @@ def simulate(
api_call_retry_limit: int = 3,
api_call_retry_sleep_sec: int = 1,
api_call_delay_sec: float = 0,
max_simulation_results: int = 3,
):
"""
Simulates a conversation using a predefined template with customizable parameters and control over API behavior.
Expand All @@ -536,6 +539,8 @@ def simulate(
:param api_call_delay_sec: The number of seconds to wait
before making a new API call to simulate conversation delay.
:type api_call_delay_sec: float, optional
:keyword max_simulation_results: The maximum number of simulation results to return. Defaults to 3.
:paramtype max_simulation_results: int, optional
:return: The outcome of the simulated conversations as a list.
:rtype: List[Dict]
"""
Expand All @@ -555,6 +560,7 @@ def simulate(
api_call_retry_limit,
api_call_retry_sleep_sec,
api_call_delay_sec,
max_simulation_results,
concurrent_async_task,
),
)
Expand Down