Skip to content

Commit e678074

Browse files
jsonbaileyclaude
andcommitted
feat: Add bedrock provider package
Introduce launchdarkly-server-sdk-ai-bedrock, an AWS Bedrock provider for the LaunchDarkly AI SDK. The model runner wraps boto3 bedrock-runtime.converse(...) via asyncio.to_thread. The agent runner integrates the Strands Agents SDK, available through the optional [agents] extra. Agent-graph support is intentionally deferred — create_agent_graph raises NotImplementedError. The package mirrors the OpenAI provider layout: BedrockRunnerFactory, BedrockModelRunner, BedrockAgentRunner, helper module, and tests. Register the new package in the workspace pyproject.toml, root Makefile, release-please configuration, and CI / release workflows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c8b8a75 commit e678074

20 files changed

Lines changed: 1863 additions & 1 deletion

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,48 @@ jobs:
139139
- name: Run tests
140140
run: make -C packages/ai-providers/server-ai-openai test
141141

142+
server-ai-bedrock-linux:
143+
runs-on: ubuntu-latest
144+
strategy:
145+
matrix:
146+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
147+
148+
steps:
149+
- uses: actions/checkout@v4
150+
151+
- uses: ./.github/actions/ci
152+
with:
153+
workspace_path: packages/ai-providers/server-ai-bedrock
154+
python_version: ${{ matrix.python-version }}
155+
156+
- uses: ./.github/actions/build
157+
with:
158+
workspace_path: packages/ai-providers/server-ai-bedrock
159+
160+
server-ai-bedrock-windows:
161+
runs-on: windows-latest
162+
defaults:
163+
run:
164+
shell: powershell
165+
166+
strategy:
167+
matrix:
168+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
169+
170+
steps:
171+
- uses: actions/checkout@v4
172+
173+
- name: Set up uv
174+
uses: astral-sh/setup-uv@6ee6290f1cbc4156c0bdd66691b2c144ef8df19a # v7.4
175+
with:
176+
python-version: ${{ matrix.python-version }}
177+
178+
- name: Install dependencies
179+
run: make -C packages/ai-providers/server-ai-bedrock install
180+
181+
- name: Run tests
182+
run: make -C packages/ai-providers/server-ai-bedrock test
183+
142184
server-ai-optimization-linux:
143185
runs-on: ubuntu-latest
144186
strategy:

.github/workflows/release-please.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ on:
2727
- packages/sdk/server-ai
2828
- packages/ai-providers/server-ai-langchain
2929
- packages/ai-providers/server-ai-openai
30+
- packages/ai-providers/server-ai-bedrock
3031
- packages/optimization
3132
dry_run:
3233
description: 'Is this a dry run. If so no package will be published.'
@@ -47,6 +48,8 @@ jobs:
4748
package-server-ai-langchain-tag-name: ${{ steps.release.outputs['packages/ai-providers/server-ai-langchain--tag_name'] }}
4849
package-server-ai-openai-released: ${{ steps.release.outputs['packages/ai-providers/server-ai-openai--release_created'] }}
4950
package-server-ai-openai-tag-name: ${{ steps.release.outputs['packages/ai-providers/server-ai-openai--tag_name'] }}
51+
package-server-ai-bedrock-released: ${{ steps.release.outputs['packages/ai-providers/server-ai-bedrock--release_created'] }}
52+
package-server-ai-bedrock-tag-name: ${{ steps.release.outputs['packages/ai-providers/server-ai-bedrock--tag_name'] }}
5053
package-server-ai-optimization-released: ${{ steps.release.outputs['packages/optimization--release_created'] }}
5154
package-server-ai-optimization-tag-name: ${{ steps.release.outputs['packages/optimization--tag_name'] }}
5255
steps:
@@ -193,6 +196,42 @@ jobs:
193196
password: ${{ env.PYPI_AUTH_TOKEN }}
194197
packages-dir: packages/ai-providers/server-ai-openai/dist/
195198

199+
release-server-ai-bedrock:
200+
runs-on: ubuntu-latest
201+
needs: ['release-please']
202+
permissions:
203+
id-token: write # Needed for OIDC to get release secrets from AWS.
204+
attestations: write # Needed for actions/attest.
205+
if: ${{ needs.release-please.outputs.package-server-ai-bedrock-released == 'true' }}
206+
steps:
207+
- uses: actions/checkout@v4
208+
209+
- uses: ./.github/actions/ci
210+
with:
211+
workspace_path: packages/ai-providers/server-ai-bedrock
212+
213+
- uses: ./.github/actions/build
214+
id: build
215+
with:
216+
workspace_path: packages/ai-providers/server-ai-bedrock
217+
218+
- name: Attest build provenance
219+
uses: actions/attest@v4
220+
with:
221+
subject-path: 'packages/ai-providers/server-ai-bedrock/dist/*'
222+
223+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
224+
name: 'Get PyPI token'
225+
with:
226+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
227+
ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN'
228+
229+
- name: Publish to PyPI
230+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
231+
with:
232+
password: ${{ env.PYPI_AUTH_TOKEN }}
233+
packages-dir: packages/ai-providers/server-ai-bedrock/dist/
234+
196235
release-server-ai-optimization:
197236
runs-on: ubuntu-latest
198237
needs: ['release-please']

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"packages/sdk/server-ai": "1.0.1",
33
"packages/ai-providers/server-ai-langchain": "0.8.0",
44
"packages/ai-providers/server-ai-openai": "0.7.0",
5+
"packages/ai-providers/server-ai-bedrock": "0.1.0",
56
"packages/optimization": "0.1.0"
67
}

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ BUILDDIR = $(SOURCEDIR)/build
1010
SERVER_AI_PKG = packages/sdk/server-ai
1111
LANGCHAIN_PKG = packages/ai-providers/server-ai-langchain
1212
OPENAI_PKG = packages/ai-providers/server-ai-openai
13+
BEDROCK_PKG = packages/ai-providers/server-ai-bedrock
1314

1415
.PHONY: help
1516
help: #! Show this help message
@@ -38,6 +39,10 @@ install-langchain: #! Install langchain provider package
3839
install-openai: #! Install openai provider package
3940
$(MAKE) -C $(OPENAI_PKG) install
4041

42+
.PHONY: install-bedrock
43+
install-bedrock: #! Install bedrock provider package
44+
$(MAKE) -C $(BEDROCK_PKG) install
45+
4146
#
4247
# Quality control checks
4348
#
@@ -47,6 +52,7 @@ test: #! Run unit tests for all packages
4752
$(MAKE) test-server-ai
4853
$(MAKE) test-langchain
4954
$(MAKE) test-openai
55+
$(MAKE) test-bedrock
5056

5157
.PHONY: test-server-ai
5258
test-server-ai: #! Run unit tests for server-ai package
@@ -60,11 +66,16 @@ test-langchain: #! Run unit tests for langchain provider package
6066
test-openai: #! Run unit tests for openai provider package
6167
$(MAKE) -C $(OPENAI_PKG) test
6268

69+
.PHONY: test-bedrock
70+
test-bedrock: #! Run unit tests for bedrock provider package
71+
$(MAKE) -C $(BEDROCK_PKG) test
72+
6373
.PHONY: lint
6474
lint: #! Run type analysis and linting checks for all packages
6575
$(MAKE) lint-server-ai
6676
$(MAKE) lint-langchain
6777
$(MAKE) lint-openai
78+
$(MAKE) lint-bedrock
6879

6980
.PHONY: lint-server-ai
7081
lint-server-ai: #! Run type analysis and linting checks for server-ai package
@@ -78,6 +89,10 @@ lint-langchain: #! Run type analysis and linting checks for langchain provider p
7889
lint-openai: #! Run type analysis and linting checks for openai provider package
7990
$(MAKE) -C $(OPENAI_PKG) lint
8091

92+
.PHONY: lint-bedrock
93+
lint-bedrock: #! Run type analysis and linting checks for bedrock provider package
94+
$(MAKE) -C $(BEDROCK_PKG) lint
95+
8196
#
8297
# Build targets
8398
#
@@ -87,6 +102,7 @@ build: #! Build all packages
87102
$(MAKE) build-server-ai
88103
$(MAKE) build-langchain
89104
$(MAKE) build-openai
105+
$(MAKE) build-bedrock
90106

91107
.PHONY: build-server-ai
92108
build-server-ai: #! Build server-ai package
@@ -100,6 +116,10 @@ build-langchain: #! Build langchain provider package
100116
build-openai: #! Build openai provider package
101117
$(MAKE) -C $(OPENAI_PKG) build
102118

119+
.PHONY: build-bedrock
120+
build-bedrock: #! Build bedrock provider package
121+
$(MAKE) -C $(BEDROCK_PKG) build
122+
103123
#
104124
# Documentation generation
105125
#
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PYTEST_FLAGS=-W error::SyntaxWarning
2+
3+
.PHONY: help
4+
help: #! Show this help message
5+
@echo 'Usage: make [target] ... '
6+
@echo ''
7+
@echo 'Targets:'
8+
@grep -h -F '#!' $(MAKEFILE_LIST) | grep -v grep | sed 's/:.*#!/:/' | column -t -s":"
9+
10+
.PHONY: install
11+
install: #! Install package dependencies
12+
uv sync --all-groups
13+
14+
.PHONY: test
15+
test: #! Run unit tests
16+
test: install
17+
uv run pytest $(PYTEST_FLAGS)
18+
19+
.PHONY: lint
20+
lint: #! Run type analysis and linting checks
21+
lint: install
22+
uv run mypy src/ldai_bedrock
23+
uv run isort --check --atomic src/ldai_bedrock
24+
uv run pycodestyle src/ldai_bedrock
25+
26+
.PHONY: build
27+
build: #! Build distribution files
28+
build: install
29+
uv build --out-dir dist

0 commit comments

Comments
 (0)