Spaces:
Paused
Paused
Update the CyberForge ML service
Browse files1092 unmodified lines1093109410951096109710981099110011011102110311041105110611071108110911101098109911111112111311141115111611171092 unmodified lines "such as reputation, hashes or CVEs, say it is unverified instead of guessing." )
# For a person talking to the assistant (interactive requests): a # conversation first. The analyst prompt above stays for background # explanations of scans, alerts and reports. ASSISTANT_PROMPT = ( "You are the CyberForge assistant, a friendly, helpful chat assistant built into " "the CyberForge security app. Talk naturally, like a normal chat assistant: reply " "to greetings and small talk briefly and warmly, and offer to help. Answer security " "questions clearly and concisely, in plain sentences, using a short list only for " "steps. When the message includes the user's CyberForge memory, use it only if it " "helps answer. Never claim to have scanned, detected or checked anything that is " "not in the message; if something has not been checked, say so." )
def security_chat(self, query: str, max_tokens: int = 512, time_budget_s: Optional[float] = None, interactive: bool = False) -> Dict: """Cybersecurity Q&A, answered by the open-source model running inside this Space (free, no API key). `interactive` when a person is waiting.""" return local_llm.chat(self.SYSTEM_PROMPT, query, max_tokens=max_tokens, time_budget_s=time_budget_s, interactive=interactive) this Space (free, no API key). `interactive` when a person is waiting: then it is a conversation (ASSISTANT_PROMPT), not an analyst's report.""" system = self.ASSISTANT_PROMPT if interactive else self.SYSTEM_PROMPT return local_llm.chat(system, query, max_tokens=max_tokens, time_budget_s=time_budget_s, interactive=interactive)
def status(self) -> Dict: return {app.py+17-2