kikocis/llama-stack public
Changesets · Branches · Tags · Compare
| Changeset | 566afbf5da2b47d15e9e81bd7ddef1fe4edc4db8688c62354ac37b4cf33a7421 |
|---|---|
| Author | Ashwin Bharambe <ashwin.bharambe@gmail.com> · 2024-09-18 20:38 -07:00 |
| Committer | Ashwin Bharambe <ashwin.bharambe@gmail.com> · 2024-09-18 20:38 -07:00 |
| Parents | 780141a617b6 |
1 file changed
modified llama_stack/providers/impls/meta_reference/agents/safety.py +3 −6
| @@ -7,15 +7,14 @@ | ||
| 7 | 7 | from typing import List |
| 8 | 8 | |
| 9 | 9 | from llama_models.llama3.api.datatypes import Message, Role, UserMessage |
| 10 | +from termcolor import cprint | |
| 10 | 11 | |
| 11 | 12 | from llama_stack.apis.safety import ( |
| 12 | 13 | OnViolationAction, |
| 13 | - RunShieldRequest, | |
| 14 | 14 | Safety, |
| 15 | 15 | ShieldDefinition, |
| 16 | 16 | ShieldResponse, |
| 17 | 17 | ) |
| 18 | -from termcolor import cprint | |
| 19 | 18 | |
| 20 | 19 | |
| 21 | 20 | class SafetyException(Exception): # noqa: N818 |
| @@ -45,10 +44,8 @@ | ||
| 45 | 44 | messages[0] = UserMessage(content=messages[0].content) |
| 46 | 45 | |
| 47 | 46 | res = await self.safety_api.run_shields( |
| 48 | - RunShieldRequest( | |
| 49 | - messages=messages, | |
| 50 | - shields=shields, | |
| 51 | - ) | |
| 47 | + messages=messages, | |
| 48 | + shields=shields, | |
| 52 | 49 | ) |
| 53 | 50 | |
| 54 | 51 | results = res.responses |