mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 12:21:52 +00:00
nuke safety/list_shields, we don't need it now
This commit is contained in:
parent
bc394882a0
commit
484dc2e4f5
3 changed files with 2 additions and 51 deletions
|
@ -80,27 +80,6 @@ class MetaReferenceSafetyImpl(Safety):
|
|||
|
||||
return RunShieldResponse(violation=violation)
|
||||
|
||||
async def list_shields(self) -> ListShieldsResponse:
|
||||
supported_sheilds = [
|
||||
v.value for v in MetaReferenceShieldType if self.is_supported(v)
|
||||
]
|
||||
return ListShieldsResponse(shields=supported_sheilds)
|
||||
|
||||
def is_supported(self, typ: MetaReferenceShieldType) -> bool:
|
||||
if typ == MetaReferenceShieldType.llama_guard:
|
||||
return self.config.llama_guard_shield is not None
|
||||
|
||||
if typ == MetaReferenceShieldType.jailbreak_shield:
|
||||
return self.config.prompt_guard_shield is not None
|
||||
|
||||
if typ == MetaReferenceShieldType.injection_shield:
|
||||
return self.config.prompt_guard_shield is not None
|
||||
|
||||
if typ == MetaReferenceShieldType.code_scanner_guard:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def get_shield_impl(self, typ: MetaReferenceShieldType) -> ShieldBase:
|
||||
cfg = self.config
|
||||
if typ == MetaReferenceShieldType.llama_guard:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue