Skip to content

Commit

Permalink
fix: mypy fix
Browse files Browse the repository at this point in the history
Signed-off-by: nextedoff <[email protected]>
  • Loading branch information
nextedoff committed Sep 2, 2024
1 parent 8be222a commit 31df738
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ async def evaluate(auth_claims: dict[str, Any]):

input_data_file = request_files.get("input_data")
num_questions_str = request_form.get("num_questions", "")
num_questions = 0 if num_questions_str == "" else int(num_questions_str)
num_questions = None if num_questions_str == "" else int(num_questions_str)
config = json.loads(request_form.get("config", "{}"))

if input_data_file is not None:
Expand Down
3 changes: 2 additions & 1 deletion app/backend/evaluation/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
from dataclasses import dataclass
from pathlib import Path
from typing import Optional

from pyrit.prompt_target import PromptChatTarget

Expand Down Expand Up @@ -29,7 +30,7 @@ class RedTeamingConfig:
max_turns: int = 3


def get_evaluation_config(enabled: bool, num_questions: int, target_url: str) -> EvaluationConfig:
def get_evaluation_config(enabled: bool, num_questions: Optional[int], target_url: str) -> EvaluationConfig:
"""Get the evaluation configuration."""
return EvaluationConfig(enabled=enabled, num_questions=num_questions, target_url=target_url)

Expand Down

0 comments on commit 31df738

Please sign in to comment.