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
feita há um mês420 visualizações
2 Respostas
0
profile picture
ESPECIALISTA
respondido há um mês
profile pictureAWS
ESPECIALISTA
avaliado há um mês
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
ESPECIALISTA
respondido há um mês
profile picture
ESPECIALISTA
avaliado há um mês

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas