-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Bedrock' object has no attribute 'invoke-model' #3881
Comments
Hi @redsting thanks for reaching out. It looks like you want to use |
Thanks. The link was somewhere on Amazon's site when it referenced, but this extra link fixes the runtime issue that was also referenced in the old documentation. |
|
Is this issue fixed? I have
and the reproduction steps provided by @redsting redsting still give the same error: Thank you! |
Hi,
The documentation was older. The service name when you instantiate that boto3.client object needs to be updated to "bedrock-runtime" and that should fix it.
https://docs.aws.amazon.com/pdfs/bedrock/latest/userguide/bedrock-ug.pdf
Joe
…________________________________
From: anniekmyatt ***@***.***>
Sent: Tuesday, October 3, 2023 6:33 AM
To: boto/boto3 ***@***.***>
Cc: Joe Webb ***@***.***>; Mention ***@***.***>
Subject: Re: [boto/boto3] 'Bedrock' object has no attribute 'invoke-model' (Issue #3881)
Is this issue fixed? I have
langchain==0.0.306
boto3==1.28.58
botocore==1.31.58
and the reproduction steps provided by @redsting<https://github.com/redsting> redsting still give the same error:
AttributeError: 'Bedrock' object has no attribute 'invoke_model'"?
Thank you!
—
Reply to this email directly, view it on GitHub<#3881 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALJ4RKVNXL6TRLNGBETYQ6DX5QAZHAVCNFSM6AAAAAA5LUTS2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBUHA3TIMRRGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hello Joe, Thank you for your quick reply! Yep, that works now. It helps to read the instructions 🤦♀️ . Thanks again! Best wishes, |
No worries. The link on the boto3 versioning page was older docs that didn’t break out the models or give the right service names. Once the boto3 service team pointed to the right docs, everything worked as expected.
Thanks,
Joe
On Oct 3, 2023, at 2:05 PM, anniekmyatt ***@***.***> wrote:
Hello Joe,
Thank you for your quick reply! Yep, that works now. It helps to read the instructions 🤦♀️ .
Thanks again!
Best wishes,
Anniek
—
Reply to this email directly, view it on GitHub<#3881 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALJ4RKRQ2PCPDAFEVWASIADX5RVZLAVCNFSM6AAAAAA5LUTS2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVGY2DIOBTHA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Describe the bug
#boto3
boto3 version 1.28.57
Bedrock object returns attribute error for invoke_model
AttributeError: 'Bedrock' object has no attribute 'invoke_model'
bedrock object instantiates fine
bedrock = boto3.client('bedrock', endpoint_url='https://invoke-bedrock.us-east-1.amazonaws.com')
running the example code for an image generation causes the error
image_data = bedrock.invoke_model(body = body, modelId = modelId, contentType = contentType, accept = accept)
Expected Behavior
boto3.client('bedrock') should have invoke_model.
Current Behavior
invoke_model and invoke_model_with_stream both return AttributeErrors
Reproduction Steps
import boto3
import json
bedrock = boto3.client('bedrock', endpoint_url='https://invoke-bedrock.us-east-1.amazonaws.com')
modelId = "stability.stable-diffusion-xl-v0"
contentType = "application/json"
accept = "/"
body = json.dumps({"inputText": "A kitten on a rock playing with a ball of string"})
image_data = bedrock.invoke_model(body = body, modelId = modelId, contentType = contentType, accept = accept)
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.28.57
Environment details (OS name and version, etc.)
IntelliJ with jupyter notebook running under Windows 11.
The text was updated successfully, but these errors were encountered: