mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-06 12:37:33 +00:00
test safety against safety client
This commit is contained in:
parent
d6a41d98d2
commit
9252e81a7b
19 changed files with 1076 additions and 10754 deletions
|
@ -78,7 +78,7 @@ class MockInferenceAPI:
|
|||
|
||||
|
||||
class MockSafetyAPI:
|
||||
async def run_shields(
|
||||
async def run_shield(
|
||||
self, shield_type: str, messages: List[Message]
|
||||
) -> RunShieldResponse:
|
||||
return RunShieldResponse(violation=None)
|
||||
|
@ -220,13 +220,13 @@ async def test_chat_agent_create_and_execute_turn(chat_agent):
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_run_shields_wrapper(chat_agent):
|
||||
async def test_run_multiple_shields_wrapper(chat_agent):
|
||||
messages = [UserMessage(content="Test message")]
|
||||
shields = ["test_shield"]
|
||||
|
||||
responses = [
|
||||
chunk
|
||||
async for chunk in chat_agent.run_shields_wrapper(
|
||||
async for chunk in chat_agent.run_multiple_shields_wrapper(
|
||||
turn_id="test_turn_id",
|
||||
messages=messages,
|
||||
shields=shields,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue