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
demandé il y a un mois420 vues
2 réponses
0
profile picture
EXPERT
répondu il y a un mois
profile pictureAWS
EXPERT
vérifié il y a un mois
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
répondu il y a un mois
profile picture
EXPERT
vérifié il y a un mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions