Open supreetkt opened 1 week ago
Hello! It appears that the AWS Mistral Large models have started using Messages, unlike the older Mistral models that use Prompt strings. The current implementation of ChatBedrock will only pass Prompt strings to Mistral provider models thus causing ValidationError due to the Mistral Large Models expecting Messages instead of Prompt strings. If possible, I'd like to work on this issue and create a PR to add compatibility for ChatBedrock to use the Mistral Large chat models (along with the ability to tool call with that model).
I have a plan to address this by following the structure of the request and converting Mistral responses accordingly.
If there are additional details I should consider, please let me know. Thanks!
Hi @HyphenHook - I think what you're saying might also apply to this other issue I opened regarding AI21 models. Please check.
Oh I see. If BedrockLLM is going to be deprecated in favor of ChatBedrockConverse then I suppose ChatBedrock would probably be deprecated as well since ChatBedrock relies on the BedrockLLM code currently. If ChatBedrock is eventually going to be deprecated would there be any need to introduce support for the "new" models (like Mistral Large)?
@HyphenHook
I would recommend using ChatBedrockConverse
for now until we add support in ChatBedrock. Both AI21 and Mistral Large seems to be supported by the converse API.
https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html
While trying to use tools with Mistral, here is a sample code for boto3 which works fine:
The request body using boto3 is:
However, while using
ChatBedrock
:The request body is (not including accept, contentType and modelId):
And I get the following
ValidationError
while usingChatBedrock
:Unfortunately, the error is not very descriptive from Bedrock, so its also difficult to debug. But the request body gives a fair indication between a boto3 and
ChatBedrock
request.