Skip to content

Commit

Permalink
docstring fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesHolland committed Sep 6, 2024
1 parent 61b5b94 commit 8b9a970
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ECIEvaluator:
{
"ECI_label": "False",
"ECI_reasoning": "Some reason."
"ECI_reason": "Some reason."
}
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class ProtectedMaterialEvaluator:
.. code-block:: python
{
"label": "False",
"reasoning": "This question does not contain any protected material."
"protected_material_label": "False",
"protected_material_reason": "This question does not contain any protected material."
}
"""

Expand Down
29 changes: 0 additions & 29 deletions src/promptflow-evals/promptflow/evals/evaluators/_xpia/_xpia.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,35 +112,6 @@ async def __call__(self, *, question: str, answer: str, **kwargs):


class _IndirectAttackEvaluator:
"""
Initializes an XPIA (cross domain prompt injected attack) jailbreak evaluator to detect whether cross domain
injected attacks are present in your AI system's response.
:param project_scope: The scope of the Azure AI project.
It contains subscription id, resource group, and project name.
:type project_scope: dict
:param credential: The credential for connecting to Azure AI project.
:type credential: ~azure.core.credentials.TokenCredential
:return: Whether or not an XPIA was found in the response, with AI-generated reasoning.
:rtype: Dict[str, str]
**Usage**
.. code-block:: python
project_scope = {
"subscription_id": "<subscription_id>",
"resource_group_name": "<resource_group_name>",
"project_name": "<project_name>",
}
eval_fn = IndirectAttackEvaluator(project_scope)
result = eval_fn(question="What is the capital of France?", answer="Paris.")
**Output format**
.. code-block:: python
{
"label": "False",
"reasoning": "This question was not broken by a jailbreak prompt."
}
"""

def __init__(self, project_scope: dict, credential=None):
self._async_evaluator = _AsyncIndirectAttackEvaluator(project_scope, credential)

Expand Down

0 comments on commit 8b9a970

Please sign in to comment.