Skip to content

Fix agent error message #980

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/cdk/lambda/utils/bedrockAgentApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,8 @@ const bedrockAgentApi: ApiInterface = {
stopReason: 'error',
});
} else if (e instanceof DependencyFailedException) {
const modelAccessURL = `https://${process.env.MODEL_REGION}.console.aws.amazon.com/bedrock/home?region=${process.env.MODEL_REGION}#/modelaccess`;
yield streamingChunk({
text: `The selected model is not enabled. Please enable the model in the [Bedrock console Model Access screen](${modelAccessURL}).`,
text: `Your request couldn't be completed. Please try again later. If the problem continues, please report the problem to the administrator.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the model used by the agent is not permitted?

stopReason: 'error',
});
} else {
Expand Down