- Newest
- Most votes
- Most comments
It appears that you're encountering an error when trying to invoke a model in Amazon Bedrock using an API Gateway (Apigee) endpoint. The error message suggests that there's an unknown operation exception, which could be due to a few reasons:
-
Incorrect API endpoint: Ensure you're using the correct Bedrock runtime API endpoint for invoking models.
-
Payload format: The payload format you're using seems to be a mix of different model invocation styles. For Amazon Bedrock's Nova model, you should use the Converse API format instead of the InvokeModel format.
-
Authentication: Make sure your AWS4Auth is correctly set up with the appropriate credentials and region.
-
Model availability: Verify that you have access to the Nova Lite model in your AWS account and region.
To resolve this, try modifying your payload to match the Converse API format for Nova:
payload = { "modelId": "amazon.nova-lite-v1:0", "messages": [ { "role": "user", "content": [ { "text": "In 5-6 sentences, summarize the basic principles of quantum mechanics" } ] } ], "inferenceConfig": { "maxTokens": 500, "temperature": 0.7, "topP": 0.9, "topK": 20 } }
Also, double-check your API endpoint and ensure you're using the Converse operation instead of InvokeModel. If the issue persists, verify your AWS credentials and permissions, and make sure you have the necessary access to use the Nova model in Amazon Bedrock.
Sources
Invoke Amazon Nova on Amazon Bedrock using Bedrock's Converse API - Amazon Bedrock
Build generative AI applications on Amazon Bedrock with the AWS SDK for Python (Boto3) | AWS Machine Learning Blog
