feat: add AWS Bedrock provider#95
Conversation
Add support for AWS Bedrock as an AI provider, enabling models like Claude 3.5 Sonnet, Llama 3, and Amazon Nova. Uses langchain4j-bedrock module with the default AWS credential chain (environment variables, instance profile, etc.), making it suitable for Jenkins instances running on AWS infrastructure. New files: - BedrockProvider.java - Provider implementation with region and model config - config.jelly - UI configuration form - help-region.html, help-model.html - Field documentation - Tests for null/empty model validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use var instead of non-existent BedrockChatModelBuilder inner class - Set temperature via defaultRequestParameters(BedrockChatRequestParameters) instead of direct builder method which doesn't exist in langchain4j-bedrock Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds AWS Bedrock as a new BaseAIProvider implementation so Jenkins users can run error analysis against Bedrock-hosted models (via the default AWS credential/region resolution chain).
Changes:
- Introduces
BedrockProviderwith region + model configuration and a “Test Configuration” UI action. - Adds Jenkins UI resources (config + help) for the new provider.
- Extends provider validation tests and adds the Bedrock LangChain4j dependency.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pom.xml |
Adds langchain4j-bedrock dependency needed for Bedrock integration. |
src/main/java/io/jenkins/plugins/explain_error/provider/BedrockProvider.java |
Implements the Bedrock-backed provider, including region handling and test endpoint. |
src/main/resources/io/jenkins/plugins/explain_error/provider/BedrockProvider/config.jelly |
Adds Jenkins configuration form fields for region/model and a test button. |
src/main/resources/io/jenkins/plugins/explain_error/provider/BedrockProvider/help-region.html |
Documents how region selection works (including default AWS resolution). |
src/main/resources/io/jenkins/plugins/explain_error/provider/BedrockProvider/help-model.html |
Documents expected model IDs and links to Bedrock model list. |
src/test/java/io/jenkins/plugins/explain_error/provider/ProviderTest.java |
Adds null/empty model validation tests for Bedrock provider. |
src/main/resources/io/jenkins/plugins/explain_error/provider/BedrockProvider/help-model.html
Outdated
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/explain_error/provider/BedrockProvider.java
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/explain_error/provider/BedrockProvider.java
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/explain_error/provider/BedrockProvider.java
Show resolved
Hide resolved
- Add rel="noopener noreferrer" to external link in help-model.html to prevent reverse-tabnabbing - Configure ResponseFormat.JSON in BedrockChatRequestParameters for consistent structured output with other providers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@lidiams96 Thanks for the PR. I installed the package and try with AWS Bedrock, does it miss some filed, any idea?
|
|
@shenxianpeng Thanks for reporting this. I’ve pushed a fix in a new commit—please try again when you can. Root cause: the Bedrock provider was setting
|
|
Thanks @lidiams96! I don’t have an environment available to test it myself, but based on your testing and the screenshot, it looks good. I’m going to go ahead and merge it |


Summary
Add AWS Bedrock as a new AI provider, enabling models like Claude 3.5 Sonnet, Llama 3, Amazon Nova, and other Bedrock-supported models.
Motivation
AWS Bedrock is widely used in enterprise environments running Jenkins on AWS infrastructure. Adding Bedrock support allows users to:
Changes
pom.xmllangchain4j-bedrockdependencyBedrockProvider.javaconfig.jellyhelp-region.htmlhelp-model.htmlProviderTest.javaConfiguration
eu-west-1,us-east-1). Optional — falls back to default AWS SDK region resolution.eu.anthropic.claude-3-5-sonnet-20240620-v1:0).Testing
ProviderTest.java