mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-21 12:01:47 +00:00
community[minor]: bump version of LayerupSecurity, add support for untrusted_input parameter (#19985)
**Description:** update version of LayerupSecurity package for the Layerup Security integration. Add untrusted_input parameter.
This commit is contained in:
parent
f1c3687aa5
commit
3e749369ef
@ -82,7 +82,7 @@ class LayerupSecurity(LLM):
|
|||||||
|
|
||||||
if self.prompt_guardrails:
|
if self.prompt_guardrails:
|
||||||
security_response = self.client.execute_guardrails(
|
security_response = self.client.execute_guardrails(
|
||||||
self.prompt_guardrails, messages, self.metadata
|
self.prompt_guardrails, messages, prompt, self.metadata
|
||||||
)
|
)
|
||||||
if not security_response["all_safe"]:
|
if not security_response["all_safe"]:
|
||||||
return self.handle_prompt_guardrail_violation(security_response)
|
return self.handle_prompt_guardrail_violation(security_response)
|
||||||
@ -98,7 +98,7 @@ class LayerupSecurity(LLM):
|
|||||||
|
|
||||||
if self.response_guardrails:
|
if self.response_guardrails:
|
||||||
security_response = self.client.execute_guardrails(
|
security_response = self.client.execute_guardrails(
|
||||||
self.response_guardrails, messages, self.metadata
|
self.response_guardrails, messages, result, self.metadata
|
||||||
)
|
)
|
||||||
if not security_response["all_safe"]:
|
if not security_response["all_safe"]:
|
||||||
return self.handle_response_guardrail_violation(security_response)
|
return self.handle_response_guardrail_violation(security_response)
|
||||||
|
Loading…
Reference in New Issue
Block a user