|
@@ -118,6 +118,7 @@ class EvaluationProvider:
|
|
|
# Safely parse tool call arguments (if any)
|
|
# Safely parse tool call arguments (if any)
|
|
|
content = True
|
|
content = True
|
|
|
reason = ""
|
|
reason = ""
|
|
|
|
|
+ corrected_msg = ""
|
|
|
try:
|
|
try:
|
|
|
tool_calls = getattr(msg, "tool_calls", None) or []
|
|
tool_calls = getattr(msg, "tool_calls", None) or []
|
|
|
if tool_calls:
|
|
if tool_calls:
|
|
@@ -128,6 +129,7 @@ class EvaluationProvider:
|
|
|
if isinstance(args, dict):
|
|
if isinstance(args, dict):
|
|
|
content = bool(args.get("pass", True))
|
|
content = bool(args.get("pass", True))
|
|
|
reason = str(args.get("reason", "")).strip()
|
|
reason = str(args.get("reason", "")).strip()
|
|
|
|
|
+ corrected_msg = str(args.get("corrected_copy", "")).strip()
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
logger.error("parse tool call failed: %s", e, exc_info=True)
|
|
logger.error("parse tool call failed: %s", e, exc_info=True)
|
|
|
return DataResponse(code=1, data=None, msg=f"parse tool call failed: {e}")
|
|
return DataResponse(code=1, data=None, msg=f"parse tool call failed: {e}")
|
|
@@ -135,4 +137,4 @@ class EvaluationProvider:
|
|
|
print("✅ PASS:\n", content)
|
|
print("✅ PASS:\n", content)
|
|
|
print("✅ REASON:\n", reason)
|
|
print("✅ REASON:\n", reason)
|
|
|
|
|
|
|
|
- return DataResponse(code=0, data=CopywritingEvaluationPayload(content=content, reason=reason), msg="success")
|
|
|
|
|
|
|
+ return DataResponse(code=0, data=CopywritingEvaluationPayload(content=content, reason=reason, corrected_msg=corrected_msg), msg="success")
|