Skip to content

Commit

Permalink
fixing references to re-enable guardrail callback (#299)
Browse files Browse the repository at this point in the history
not sure how to add a test to this, since all tests that currently
address "GUARDRAIL_INTERVENED" messages do not cover the callback
section

this is related to
#78
  • Loading branch information
jonathanglima authored Dec 20, 2024
1 parent 30c7894 commit 94cb00b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/aws/langchain_aws/llms/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
)

AMAZON_BEDROCK_TRACE_KEY = "amazon-bedrock-trace"
GUARDRAILS_BODY_KEY = "amazon-bedrock-guardrailAssessment"
GUARDRAILS_BODY_KEY = "amazon-bedrock-guardrailAction"
HUMAN_PROMPT = "\n\nHuman:"
ASSISTANT_PROMPT = "\n\nAssistant:"
ALTERNATION_ERROR = (
Expand Down Expand Up @@ -886,7 +886,7 @@ def _get_bedrock_services_signal(self, body: dict) -> dict:
}

def _is_guardrails_intervention(self, body: dict) -> bool:
return body.get(GUARDRAILS_BODY_KEY) == "GUARDRAIL_INTERVENED"
return body.get(GUARDRAILS_BODY_KEY) == "INTERVENED"

def _prepare_input_and_invoke_stream(
self,
Expand Down

0 comments on commit 94cb00b

Please sign in to comment.