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
gefragt vor einem Monat421 Aufrufe
2 Antworten
0
profile picture
EXPERTE
beantwortet vor einem Monat
profile pictureAWS
EXPERTE
überprüft vor einem Monat
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
EXPERTE
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen