forked from phoenix/litellm-mirror
(docs) add example post call rules to proxy
This commit is contained in:
parent
fcc1e23a05
commit
2873f587fd
2 changed files with 12 additions and 0 deletions
8
litellm/proxy/post_call_rules.py
Normal file
8
litellm/proxy/post_call_rules.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
def post_response_rule(input): # receives the model response
|
||||
print(f"post_response_rule:input={input}") # noqa
|
||||
if len(input) < 200:
|
||||
return {
|
||||
"decision": False,
|
||||
"message": "This violates LiteLLM Proxy Rules. Response too short",
|
||||
}
|
||||
return {"decision": True} # message not required since, request will pass
|
Loading…
Add table
Add a link
Reference in a new issue