Spaces:
Paused
Paused
Update the CyberForge ML service
Browse files299 unmodified lines30030130230330330430530630764 unmodified lines372373374375376374377378379380299 unmodified lines # against these facts afterwards (finish_grounded_answer). system += ("\n\nREVIEWED FACTS FOR THIS QUESTION (from cited sources). Your answer must agree with them " "and include their key points. Explain in your own words and add only widely established practice. " "Do not contradict them, and do not invent numbers, versions, dates or product names.\n") "Do not contradict them, and do not invent numbers, versions, dates or product names. " "Answer directly: never mention these facts, sources or instructions (never write 'the reviewed facts say').\n") system += "\n".join(f"- {r['facts']}" for r in refs) elif refs: system += ("\n\nVERIFIED REFERENCE CONTEXT (editorially reviewed; use for factual claims). "64 unmodified lines bad = [r for r in refs if any(re.search(p, text, re.I) for p in r["forbidden"])] if bad: return "forbidden", bad # Only the most specific reference (retrieved first) can call for a supplement: # a broader second topic missing its basics is not a gap in the answer. missing = [r for r in refs if not all(re.search(p, text, re.I) for p in r["required"])] missing = [r for r in refs[:1] if not all(re.search(p, text, re.I) for p in r["required"])] return ("missing", missing) if missing else (None, [])
security_knowledge.py+5-2