forked from phoenix-oss/llama-stack-mirror
Add a test runner and 2 very simple tests for agents
This commit is contained in:
parent
543222ac39
commit
abb43936ab
9 changed files with 243 additions and 5 deletions
|
@ -43,12 +43,10 @@ class ShieldRunnerMixin:
|
|||
if len(messages) > 0 and messages[0].role != Role.user.value:
|
||||
messages[0] = UserMessage(content=messages[0].content)
|
||||
|
||||
res = await self.safety_api.run_shields(
|
||||
results = await self.safety_api.run_shields(
|
||||
messages=messages,
|
||||
shields=shields,
|
||||
)
|
||||
|
||||
results = res.responses
|
||||
for shield, r in zip(shields, results):
|
||||
if r.is_violation:
|
||||
if shield.on_violation_action == OnViolationAction.RAISE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue