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

Aws::BedrockRuntime::Types::<X> doesn't have event_type= #2942

Closed
elijahkim opened this issue Nov 9, 2023 · 3 comments · Fixed by #2943
Closed

Aws::BedrockRuntime::Types::<X> doesn't have event_type= #2942

elijahkim opened this issue Nov 9, 2023 · 3 comments · Fixed by #2943
Labels
bug This issue is a bug.

Comments

@elijahkim
Copy link

elijahkim commented Nov 9, 2023

Describe the bug

When AWS returns an error to the bedrock runtime client when streaming, it raises

undefined method `event_type=' for #<struct Aws::BedrockRuntime::Types::ThrottlingException message="Too many requests, please wait before trying again. You have sent too many requests. Wait before trying again.">

Expected Behavior

To be able to handle it with handler.on_error_event

Current Behavior

it raises

undefined method `event_type=' for #<struct Aws::BedrockRuntime::Types::ThrottlingException message="Too many requests, please wait before trying again. You have sent too many requests. Wait before trying again.">

Reproduction Steps

body =  {  
  "prompt" => "Instructions: This is a test. Respond confirming a successful response\n\nHuman: (Taps, mic...) Is this thing on?\n\nAssistant: ",
  "temperature": 0.7,
  "max_tokens_to_sample": 1000000
}

Aws::BedrockRuntime::Client.new().invobe_model_with_response_stream({body: body.to_json, model_id: "anthropic.claude-v2})

Possible Solution

Give all the Aws::BedrockRuntime::Types::<X> event_type= method

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-bedrockruntime (1.1.0)

Environment details (Version of Ruby, OS environment)

Ruby 3.0, macOS

@elijahkim elijahkim added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 9, 2023
@jterapin
Copy link
Contributor

Thanks for reaching out! We will be taking a look.

@jterapin jterapin added investigating Issue is being investigated and removed needs-triage This issue or PR still needs to be triaged. labels Nov 10, 2023
@mullermp mullermp removed the investigating Issue is being investigated label Nov 10, 2023
@mullermp
Copy link
Contributor

I've put out a PR for the fix, it will probably be reviewed Monday morning and hopefully released Monday or Tuesday. In the mean time, you can probably monkey patch the event_type member to the structure.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants