chore: support default model in moderations API

# What does this PR do?


## Test Plan
This commit is contained in:
Eric Huang 2025-10-22 15:11:27 -07:00
parent 7b90e0e9c8
commit 894c212901
23 changed files with 220 additions and 36 deletions

View file

@ -200,7 +200,10 @@ class LlamaGuardSafetyImpl(Safety, ShieldsProtocolPrivate):
return await impl.run(messages)
async def run_moderation(self, input: str | list[str], model: str) -> ModerationObject:
async def run_moderation(self, input: str | list[str], model: str | None = None) -> ModerationObject:
if model is None:
raise ValueError("Llama Guard moderation requires a model identifier.")
if isinstance(input, list):
messages = input.copy()
else: