Skip to content
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

Closed
redsting opened this issue Sep 28, 2023 · 7 comments
Closed

'Bedrock' object has no attribute 'invoke-model' #3881

redsting opened this issue Sep 28, 2023 · 7 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made.

Comments

@redsting
Copy link

redsting commented Sep 28, 2023

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.

@redsting redsting added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2023
@tim-finnigan tim-finnigan self-assigned this Sep 28, 2023
@tim-finnigan
Copy link
Contributor

Hi @redsting thanks for reaching out. It looks like you want to use bedrock-runtime for the invoke_model command. Here are the documentation pages for the bedrock and bedrock-runtime services:

@tim-finnigan tim-finnigan added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2023
@redsting
Copy link
Author

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.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@anniekmyatt
Copy link

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 redsting still give the same error:
AttributeError: 'Bedrock' object has no attribute 'invoke_model'"?

Thank you!

@redsting
Copy link
Author

redsting commented Oct 3, 2023 via email

@anniekmyatt
Copy link

Hello Joe,

Thank you for your quick reply! Yep, that works now. It helps to read the instructions 🤦‍♀️ .

Thanks again!

Best wishes,
Anniek

@redsting
Copy link
Author

redsting commented Oct 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made.
Projects
None yet
Development

No branches or pull requests

3 participants