asofter commited on
Commit
7fcadc1
·
1 Parent(s): 805526f

* aws update

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -172,11 +172,11 @@ def detect_aws_bedrock(prompt: str) -> (bool, bool):
172
  ])
173
 
174
  logger.info(f"Prompt injection result from AWS Bedrock Guardrails: {response}")
175
- # if response["ResponseMetadata"]["HTTPStatusCode"] != 200:
176
- # logger.error(f"Failed to call AWS Comprehend API: {response}")
177
- # return False, False
178
 
179
- return True, True
180
 
181
 
182
  def detect_sydelabs(prompt: str) -> (bool, bool):
 
172
  ])
173
 
174
  logger.info(f"Prompt injection result from AWS Bedrock Guardrails: {response}")
175
+ if response["ResponseMetadata"]["HTTPStatusCode"] != 200:
176
+ logger.error(f"Failed to call AWS Bedrock Guardrails API: {response}")
177
+ return False, False
178
 
179
+ return True, response['action'] != 'NONE'
180
 
181
 
182
  def detect_sydelabs(prompt: str) -> (bool, bool):