problem with anthropic claude haiku

0

in php when using the anthropic.claude-3-haiku-20240307-v1:0 model, it replaces the ":" with "%3A" which produces the error: Aws\BedrockRuntime\Exception\BedrockRuntimeException' with message 'Error executing "InvokeModel" on "https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-haiku-20240307-v1%3A0/invoke"; AWS HTTP error: Client error: POST https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-haiku-20240307-v1%3A0/invoke resulted in a 400 Bad Request response: {"message":""claude-3-haiku-20240307" is not supported on this API. Please use the Messages API instead."}

how can I solve that? The call I use is:

$path="anthropic.claude-3-haiku-20240307-v1:0";
  $bedrock = new Aws\BedrockRuntime\BedrockRuntimeClient(['region' => env('AWS_REGION', 'us-east-1'),'debug'=>true]);
            $result = $bedrock->invokeModel([
                'accept' => '*/*',
                'body' => $body,
                'contentType' => 'application/json',
                'modelId' =>($path)
                            //anthropic.claude-3-haiku-20240307-v1:0
            ]);
Luis
asked 20 days ago347 views
2 Answers
0
profile picture
EXPERT
answered 20 days ago
profile pictureAWS
EXPERT
reviewed 20 days ago
0

Hi,

If you've used Claude v2 models, prompt structure in Haiku v3 is different. You must use the new structure to get answers from Haiku.

You have a full example there: If you've used Claude v2 models, prompt structure in Haiku v3 is different. You must use the new structure to get answers from Haiku.

Best,

Didier

profile pictureAWS
EXPERT
answered 20 days ago
profile picture
EXPERT
reviewed 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions