Skip to content

Commit

Permalink
add signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
D-W- authored and Ying Chen committed May 6, 2024
1 parent 12a0f98 commit 845dcf7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@

import numpy as np

from promptflow.core import AzureOpenAIModelConfiguration
from promptflow.evals.evaluators import CoherenceEvaluator, FluencyEvaluator, GroundednessEvaluator, RelevanceEvaluator

logger = logging.getLogger(__name__)


class ChatEvaluator:
def __init__(
self, model_config, eval_last_turn: bool = False, parallel: bool = True
self, model_config: AzureOpenAIModelConfiguration, eval_last_turn: bool = False, parallel: bool = True
):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
from pathlib import Path

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
from promptflow.core._prompty_utils import convert_model_configuration_to_connection


class CoherenceEvaluator:
def __init__(self, model_config):
def __init__(self, model_config: AzureOpenAIModelConfiguration):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
from pathlib import Path

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
from promptflow.core._prompty_utils import convert_model_configuration_to_connection


class FluencyEvaluator:
def __init__(self, model_config):
def __init__(self, model_config: AzureOpenAIModelConfiguration):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
from pathlib import Path

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
from promptflow.core._prompty_utils import convert_model_configuration_to_connection


class GroundednessEvaluator:
def __init__(self, model_config):
def __init__(self, model_config: AzureOpenAIModelConfiguration):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
Expand Down
3 changes: 2 additions & 1 deletion src/promptflow-evals/promptflow/evals/evaluators/qa/_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from concurrent.futures import ThreadPoolExecutor, as_completed

from promptflow.core import AzureOpenAIModelConfiguration
from promptflow.evals.evaluators import (
CoherenceEvaluator,
F1ScoreEvaluator,
Expand All @@ -15,7 +16,7 @@


class QAEvaluator:
def __init__(self, model_config, parallel: bool = True):
def __init__(self, model_config: AzureOpenAIModelConfiguration, parallel: bool = True):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
from pathlib import Path

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
from promptflow.core._prompty_utils import convert_model_configuration_to_connection


class RelevanceEvaluator:
def __init__(self, model_config):
def __init__(self, model_config: AzureOpenAIModelConfiguration):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
from pathlib import Path

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
from promptflow.core._prompty_utils import convert_model_configuration_to_connection


class SimilarityEvaluator:
def __init__(self, model_config):
def __init__(self, model_config: AzureOpenAIModelConfiguration):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
Expand Down

0 comments on commit 845dcf7

Please sign in to comment.