Fix Registry so it scopes keys by object types

This commit is contained in:
Ashwin Bharambe 2024-11-12 12:25:43 -08:00
parent b1c3a95485
commit b94e6c0bd4
7 changed files with 63 additions and 47 deletions

View file

@ -27,7 +27,7 @@ async def get_client_impl(config: RemoteProviderConfig, _deps: Any) -> Safety:
def encodable_dict(d: BaseModel):
return json.loads(d.json())
return json.loads(d.model_dump_json())
class SafetyClient(Safety):
@ -80,7 +80,7 @@ async def run_main(host: str, port: int, image_path: str = None):
)
cprint(f"User>{message.content}", "green")
response = await client.run_shield(
shield_id="llama_guard",
shield_id="Llama-Guard-3-1B",
messages=[message],
)
print(response)