forked from phoenix/litellm-mirror
fix lakera ai tests
This commit is contained in:
parent
2ad1c0455a
commit
e66a735304
1 changed files with 16 additions and 16 deletions
|
@ -122,16 +122,16 @@ class _ENTERPRISE_lakeraAI_Moderation(CustomLogger):
|
||||||
"Skipping lakera prompt injection, no roles with messages found"
|
"Skipping lakera prompt injection, no roles with messages found"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
data = {"input": lakera_input}
|
||||||
|
_json_data = json.dumps(data)
|
||||||
elif "input" in data and isinstance(data["input"], str):
|
elif "input" in data and isinstance(data["input"], str):
|
||||||
text = data["input"]
|
text = data["input"]
|
||||||
|
_json_data = json.dumps({"input": text})
|
||||||
elif "input" in data and isinstance(data["input"], list):
|
elif "input" in data and isinstance(data["input"], list):
|
||||||
text = "\n".join(data["input"])
|
text = "\n".join(data["input"])
|
||||||
|
_json_data = json.dumps({"input": text})
|
||||||
|
|
||||||
# https://platform.lakera.ai/account/api-keys
|
# https://platform.lakera.ai/account/api-keys
|
||||||
data = {"input": lakera_input}
|
|
||||||
|
|
||||||
_json_data = json.dumps(data)
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
export LAKERA_GUARD_API_KEY=<your key>
|
export LAKERA_GUARD_API_KEY=<your key>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue