Fixes 03
This commit is contained in:
parent
a8f128c18f
commit
5b0f1fc48c
1 changed files with 2 additions and 2 deletions
|
|
@ -80,7 +80,7 @@ class ContentValidator:
|
||||||
overall_success = False
|
overall_success = False
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"overallSuccess": overall_success.group(1).lower() == 'true' if overall_success else False,
|
"overallSuccess": overall_success if isinstance(overall_success, bool) else (overall_success.group(1).lower() == 'true' if overall_success else False),
|
||||||
"qualityScore": float(quality_score.group(1)) if quality_score else 0.5,
|
"qualityScore": float(quality_score.group(1)) if quality_score else 0.5,
|
||||||
"validationDetails": [{
|
"validationDetails": [{
|
||||||
"documentName": "AI Validation (Fallback)",
|
"documentName": "AI Validation (Fallback)",
|
||||||
|
|
@ -163,7 +163,7 @@ IMPORTANT: Even if the content is binary files (like .docx, .pdf, etc.), you mus
|
||||||
|
|
||||||
# If first attempt fails, try with more explicit prompt
|
# If first attempt fails, try with more explicit prompt
|
||||||
if response and not self._isValidJsonResponse(response):
|
if response and not self._isValidJsonResponse(response):
|
||||||
logger.warning("First AI validation attempt failed, retrying with explicit JSON-only prompt")
|
logger.debug("First AI validation attempt failed, retrying with explicit JSON-only prompt")
|
||||||
explicitPrompt = f"""
|
explicitPrompt = f"""
|
||||||
{validationPrompt}
|
{validationPrompt}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue