From bb698192679fc6875eeeb62f90b015c80dc82e90 Mon Sep 17 00:00:00 2001 From: Matheus Henrique Raymundo Date: Sun, 21 Apr 2024 21:06:06 -0300 Subject: [PATCH] community: Fix the stop sequence key name for Mistral in Bedrock (#20709) Fixing the wrong stop sequence key name that causes an error on AWS Bedrock. You can check the MistralAI bedrock parameters [here](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-mistral.html) This change fixes this [issue](https://github.com/langchain-ai/langchain/issues/20095) --- libs/community/langchain_community/llms/bedrock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/community/langchain_community/llms/bedrock.py b/libs/community/langchain_community/llms/bedrock.py index 6d03c7be95b..cfbc393b00e 100644 --- a/libs/community/langchain_community/llms/bedrock.py +++ b/libs/community/langchain_community/llms/bedrock.py @@ -339,7 +339,7 @@ class BedrockBase(BaseModel, ABC): "amazon": "stopSequences", "ai21": "stop_sequences", "cohere": "stop_sequences", - "mistral": "stop_sequences", + "mistral": "stop", } guardrails: Optional[Mapping[str, Any]] = {