langchain-ai / langchain-aws

Build LangChain Applications on AWS
MIT License
95 stars 70 forks source link

Error: Mistral Models are not working for ChatBedrock & BedrockLLM #55

Closed arm-diaz closed 4 months ago

arm-diaz commented 4 months ago

This is an example with ChatBedrock.

from langchain_core.messages import HumanMessage
from langchain_aws import ChatBedrock, BedrockLLM

chat = ChatBedrock(
    model_id="mistral.mistral-large-2402-v1:0",
    model_kwargs={"temperature": 0.1},
)
messages = [
    HumanMessage(
        content="Translate this sentence from English to French. I love programming."
    )
]
chat.invoke(messages)

Error below:

ValueError: Error raised by bedrock service: 'stop_reason'

The error is present for all mistral models. It's been a few days already since we detected this error.

nithiyn commented 4 months ago

Running into a similar error with simple api calls to mistral models as well

3coins commented 4 months ago

Looking into this.