fix(ocr): address code review: add model fallback default, remove unused variable
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -261,7 +261,7 @@ def check_text_quality(text: str, text_source: TextSource) -> TextQualityResult:
|
||||
response_text: Optional[str] = None
|
||||
try:
|
||||
provider = get_ai_provider()
|
||||
model = settings.ai_model or settings.openai_model
|
||||
model = settings.ai_model or settings.openai_model or "gpt-4o-mini"
|
||||
response_text = provider.chat_completion(
|
||||
messages=[
|
||||
{
|
||||
|
||||
@@ -401,7 +401,6 @@ class TestCheckTextQualityAI:
|
||||
|
||||
assert len(captured_prompts) == 1
|
||||
# The prompt should NOT contain more than _TEXT_SAMPLE_MAX_CHARS "a"s
|
||||
count_a = captured_prompts[0].count("a" * 100)
|
||||
assert "a" * (_TEXT_SAMPLE_MAX_CHARS + 1) not in captured_prompts[0]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user