mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
docs(call_hooks.md): add async_moderation_hook to docs
This commit is contained in:
parent
7248b8373a
commit
f35c340462
1 changed files with 7 additions and 1 deletions
|
|
@ -78,7 +78,7 @@ curl --location 'http://0.0.0.0:8000/chat/completions' \
|
|||
```
|
||||
|
||||
|
||||
## *NEW* async_moderation_hook
|
||||
## [BETA] *NEW* async_moderation_hook
|
||||
|
||||
Run a moderation check in parallel to the actual LLM API call.
|
||||
|
||||
|
|
@ -89,6 +89,12 @@ In your Custom Handler add a new `async_moderation_hook` function
|
|||
- If your `async_moderation_hook` raises an Exception, we will return that to the user.
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
We might need to update the function schema in the future, to support multiple endpoints (e.g. accept a call_type). Please keep that in mind, while trying this feature
|
||||
|
||||
:::
|
||||
|
||||
See a complete example with our [Llama Guard content moderation hook](https://github.com/BerriAI/litellm/blob/main/enterprise/hooks/llama_guard.py)
|
||||
|
||||
```python
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue