1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
How exactly are you invoking Bedrock Nova Lite?
Would it be possible for you to share the sample code where the error occurs?
For reference, I have confirmed that the following Python code works on my AWS account.
https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started-api-keys.html
import boto3
import os
os.environ['AWS_BEARER_TOKEN_BEDROCK'] = "API Key"
client = boto3.client(
"bedrock-runtime",
region_name="us-west-2"
)
response = client.converse(
modelId="global.amazon.nova-2-lite-v1:0",
messages=[
{
"role": "user",
"content": [
{
"text": "Hi Who are you?"
}
]
}
],
inferenceConfig={
"maxTokens": 500,
"temperature": 0.7,
"topP": 0.9
}
)
print(response["output"]["message"]["content"][0]["text"])
