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 ListFoundationModelsCommand error "byProvider" #5608

Closed
Depaa opened this issue Nov 4, 2023 · 3 comments
Closed

Bedrock ListFoundationModelsCommand error "byProvider" #5608

Depaa opened this issue Nov 4, 2023 · 3 comments
Assignees
Labels
guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p3 This is a minor priority issue

Comments

@Depaa
Copy link

Depaa commented Nov 4, 2023

Describe the bug

ListFoundationModelsCommand should accept no parameters, instead it throws an error in the byProvider section.

Expected Behavior

With no parameter or with byProvider parameter, it should return the foundation models

Current Behavior

Returns error when passing no parameter, and returns 400 when passing the correct byProvider

to bypass you need to use one of the other filters like "byInferenceType"

Reproduction Steps

const {
  BedrockClient,
  ListFoundationModelsCommand,
} = require('@aws-sdk/client-bedrock');
const client = new BedrockClient({ region: process.env.REGION || 'us-east-1' });

const command = new ListFoundationModelsCommand();
const res = await client.send(command);

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.441.0

Environment details (OS name and version, etc.)

Windows

@Depaa Depaa added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 4, 2023
@RanVaknin RanVaknin self-assigned this Dec 20, 2023
@RanVaknin RanVaknin transferred this issue from aws/aws-sdk-js Dec 20, 2023
@RanVaknin RanVaknin added guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p3 This is a minor priority issue and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 20, 2023
@RanVaknin
Copy link
Contributor

Hi @Depaa ,

The syntax for v3 is to supply an empty object when no params are needed. So:

const {
  BedrockClient,
  ListFoundationModelsCommand,
} = require('@aws-sdk/client-bedrock');
const client = new BedrockClient({ region: process.env.REGION || 'us-east-1' });

- const command = new ListFoundationModelsCommand();
+ const command = new ListFoundationModelsCommand({});
const res = await client.send(command);

Thanks,
Ran~

@RanVaknin RanVaknin closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2023
@Depaa
Copy link
Author

Depaa commented Dec 21, 2023

Hey @RanVaknin just to let you know the bug has been fixed in one of the latest versions of the SDK. Before the fix, if you happen to use 'byProvider' it would have returned status code 400 every time. I'm just glad it works now

Copy link

github-actions bot commented Jan 5, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants