Skip to content

Commit 3988358

Browse files
committed
fix tests and how we get enum
1 parent 3810885 commit 3988358

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core_backend/app/llm_call/process_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ async def _identify_language(
120120
cleaned_json_str = remove_json_markdown(text=json_str)
121121
try:
122122
lang_info = LanguageIdentificationResponse.model_validate_json(cleaned_json_str)
123-
identified_lang = getattr(IdentifiedLanguage, lang_info.language.upper())
124-
identified_script = getattr(IdentifiedScript, lang_info.script.upper())
123+
identified_lang = IdentifiedLanguage(lang_info.language.upper())
124+
identified_script = IdentifiedScript(lang_info.script.upper())
125125
except ValidationError:
126126
identified_lang = IdentifiedLanguage.UNSUPPORTED
127127
identified_script = IdentifiedScript.LATIN

core_backend/tests/api/test_question_answer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ def user_query_refined(self, request: pytest.FixtureRequest) -> QueryRefined:
10531053
("ENGLISH", "LATIN", False, None),
10541054
("HINDI", "DEVANAGARI", False, None),
10551055
("UNINTELLIGIBLE", "LATIN", True, ErrorType.UNINTELLIGIBLE_INPUT),
1056-
("UNINTELLIGIBLE", "UNKNOWN", True, ErrorType.UNSUPPORTED_SCRIPT),
1056+
("UNINTELLIGIBLE", "UNKNOWN", True, ErrorType.UNINTELLIGIBLE_INPUT),
10571057
("GIBBERISH", "UNKNOWN", True, ErrorType.UNSUPPORTED_SCRIPT),
10581058
("GIBBERISH", "LATIN", True, ErrorType.UNSUPPORTED_LANGUAGE),
10591059
("UNSUPPORTED", "LATIN", True, ErrorType.UNSUPPORTED_LANGUAGE),

0 commit comments

Comments
 (0)