diff --git a/libs/aws/langchain_aws/llms/bedrock.py b/libs/aws/langchain_aws/llms/bedrock.py index 7ef898c0..1348e7f6 100644 --- a/libs/aws/langchain_aws/llms/bedrock.py +++ b/libs/aws/langchain_aws/llms/bedrock.py @@ -579,19 +579,20 @@ class BedrockBase(BaseLanguageModel, ABC): """ An optional dictionary to configure guardrails for Bedrock. - This field 'guardrails' consists of two keys: 'id' and 'version', - which should be strings, but are initialized to None. It's used to - determine if specific guardrails are enabled and properly set. + This field 'guardrails' consists of two keys: 'guardrailId' and + 'guardrailVersion', which should be strings, but are initialized to None. + It's used to determine if specific guardrails are enabled and properly set. Type: - Optional[Mapping[str, str]]: A mapping with 'id' and 'version' keys. + Optional[Mapping[str, str]]: A mapping with 'guardrailId' and + 'guardrailVersion' keys. Example: llm = BedrockLLM(model_id="", client=, model_kwargs={}, guardrails={ - "id": "", - "version": ""}) + "guardrailId": "", + "guardrailVersion": ""}) To enable tracing for guardrails, set the 'trace' key to True and pass a callback handler to the 'run_manager' parameter of the 'generate', '_call' methods. @@ -600,8 +601,8 @@ class BedrockBase(BaseLanguageModel, ABC): llm = BedrockLLM(model_id="", client=, model_kwargs={}, guardrails={ - "id": "", - "version": "", + "guardrailId": "", + "guardrailVersion": "", "trace": True}, callbacks=[BedrockAsyncCallbackHandler()])