"errorMessage": "Unknown service: 'bedrock-agent-runtime'.

0

Getting "errorMessage": "Unknown service: 'bedrock-agent-runtime' in lambda function when using with Boto3 in python code.

but able execute aws bedrock-agent-runtime retrieve-and-generate in CLI

import json import boto3 def lambda_handler(event, context): client = boto3.client('bedrock-agent-runtime','us-west') #client = boto3.client(service_name="bedrock-agent-runtime", region_name="us-west-2") response = client.retrieve_and_generate(

1 Answer
0

Hello.

I think the version of boto3 may be old.
Please update the boto3 version to the latest version.

Looking at the changelog below, "bedrock-agent-runtime" has been added since 1.33.2.
So I think you need to make sure your boto3 version is newer than this.
https://github.com/boto/boto3/blob/develop/CHANGELOG.rst

profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions