fix: ruff lint + format fixes in tests, ESLint fixes in frontend
This commit is contained in:
@@ -98,10 +98,18 @@ def _parse_response(raw_content: str) -> dict[str, Any]:
|
||||
data = json.loads(text[start : end + 1])
|
||||
except json.JSONDecodeError:
|
||||
logger.error("Failed to parse OpenRouter response: %s", text[:200])
|
||||
return {"structured_data": {}, "confidence_score": 0.0, "raw_text": raw_content}
|
||||
return {
|
||||
"structured_data": {},
|
||||
"confidence_score": 0.0,
|
||||
"raw_text": raw_content,
|
||||
}
|
||||
else:
|
||||
logger.error("No JSON found in OpenRouter response: %s", text[:200])
|
||||
return {"structured_data": {}, "confidence_score": 0.0, "raw_text": raw_content}
|
||||
return {
|
||||
"structured_data": {},
|
||||
"confidence_score": 0.0,
|
||||
"raw_text": raw_content,
|
||||
}
|
||||
|
||||
# Extract confidence score (may be inside or outside the data)
|
||||
confidence = data.pop("confidence_score", None)
|
||||
|
||||
Reference in New Issue
Block a user