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
posta un mese fa420 visualizzazioni
2 Risposte
0
profile picture
ESPERTO
con risposta un mese fa
profile pictureAWS
ESPERTO
verificato un mese fa
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
ESPERTO
con risposta un mese fa
profile picture
ESPERTO
verificato un mese fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande