내용으로 건너뛰기

Amazon Bedrock에서 검증 예외를 해결하려면 어떻게 해야 합니까?

3분 분량
0

Amazon Bedrock 기초 모델을 간접 호출할 때 검증 예외를 해결하고 싶습니다.

해결 방법

잘못된 추론 파라미터 또는 이에 해당하는 값을 사용하는 파운데이션 모델에서 InvokeModel 또는 InvokeModelWithResponseStream API에 대한 모델 간접 호출 API를 실행하면 검증 오류가 발생합니다. 이러한 오류는 한 모델에 대한 추론 파라미터를 동일한 API 파라미터가 없는 모델에 사용할 때 발생합니다. AWS Identity and Access Management(IAM) 역할 정책을 사용하여 권한 없이 파운데이션 모델에 액세스하는 경우에도 검증 오류가 발생합니다.

권한이 충분하지 않음

권한 없이 IAM 역할 또는 IAM 사용자를 사용하는 Amazon Bedrock 모델을 간접적으로 호출하면 다음과 같은 오류가 발생합니다.

"An error occurred (ValidationException) when calling the InvokeModelWithResponseStream operation: Your AWS account is not authorized to invoke this API operation."

이 오류를 해결하려면 IAM 사용자 또는 역할의 정책에 Amazon Bedrock 모델을 간접적으로 호출할 권한이 있는지 확인하십시오.

잘못된 모델 식별자

잘못된 파운데이션 모델 식별자를 사용하여 Amazon Bedrock 모델을 간접 호출하면 다음과 같은 오류가 발생합니다.

"Error raised by bedrock service: An error occurred (ValidationException) when calling the InvokeModel operation: The provided model identifier is invalid."

이 오류를 해결하려면 간접 호출하는 Amazon Bedrock 모델의 모델 ID를 사용하고 전달해야 합니다. 또한 해당 AWS 리전의 특정 모델 가용성을 확인하십시오. 자세한 내용은 파운데이션 모델에 대한 정보 가져오기를 참조하십시오.

잘못된 가드레일 입력 형식

잘못된 가드레일 입력으로 Amazon Bedrock 모델을 간접 호출하면 다음과 같은 오류가 발생합니다.

"An error occurred (ValidationException) when calling the InvokeModel operation: Guardrail was enabled but input is in incorrect format."

이 오류를 해결하려면 guardrail-identifier에 유효한 가드레일 ID 하나와 guardrailVersion의 버전 번호만 제공해야 합니다.

잘못된 형식의 입력 요청

잘못된 입력 요청으로 Amazon Bedrock 모델을 간접 호출하면 다음 오류가 발생합니다.

"ValueError: Error raised by bedrock service: An error occurred (ValidationException) when calling the InvokeModel operation: Malformed input request: extraneous key [textGenerationConfig] is not permitted, please reformat your input and try again."

이 오류를 해결하려면 간접 호출 시 특정 모델에서 지원하는 입력 구성을 보내야 합니다.

입력이 모델 할당량을 초과함

입력 및 출력 토큰의 총 수가 지정된 할당량보다 많으면 다음과 같은 오류가 발생합니다.

"ValidationException('An error occurred (ValidationException) when calling the InvokeModel operation: Input is too long for requested model.')"}}."

이 오류를 해결하려면 모델의 할당량 내에서 모델에 입력을 제공해야 합니다. 이 할당량은 입력 토큰 크기와 출력 토큰 요청의 조합입니다.

지원되지 않는 API

모델에서 지원하지 않는 API를 사용하여 Amazon Bedrock 모델을 간접 호출하면 다음과 같은 오류가 발생합니다.

"ValidationException: "claude-3-sonnet-20240229" is not supported on this API. Please use the Messages API instead.(short issue description)"

이 오류를 해결하려면 Claude 3.0에서 지원되는 Anthropic Claude 메시지 API를 따르도록 코드를 조정하십시오. Claude 모델을 사용하는 경우 새 메시지 API로 마이그레이션하는 것이 가장 좋습니다. 메시지 요소는 입력에 각 턴의 역할과 콘텐츠를 포함하는 JSON 객체 목록을 나타냅니다.

지원되지 않는 국가, 지역 또는 영토

지원되지 않는 리전에서 Amazon Bedrock 모델에 액세스하거나 간접 호출하려고 하면 다음 오류가 발생합니다.

"Can't invoke 'us.anthropic.claude-3-haiku-20240307-v1:0'. Reason: An error occurred (ValidationException) when calling the Converse operation: Access to Anthropic models is not allowed from unsupported countries, regions, or territories. Please refer to https://www.anthropic.com/supported-countries for more information on the countries and regions Anthropic currently supports."

이 오류를 해결하려면 지원되는 리전에서 Amazon Bedrock 모델에 액세스하고 AWS 계정 세금 주소에 지원되는 리전이 있는지 확인하십시오. 리전에는 계정의 세금 주소, 청구지 주소, Amazon Bedrock 모델에 액세스하려는 시스템의 위치가 포함되며 이에 국한되지 않습니다.

청구 정보를 업데이트하려면 결제 연락처 정보를 추가하거나 업데이트하려면 어떻게 해야 합니까?를 참조하십시오.

관련 정보

가드레일 테스트

파운데이션 모델의 추론 요청 파라미터 및 응답 필드