You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Work lands as small PRs into a shared base branch, py-bedrock-plugin,
rather than straight to main. The base branch rebases onto main
periodically; when the train completes, one PR takes the assembled plugin
to main. Reviewers get small diffs during development and the full
plugin at the end.
Plugin lives at py/plugins/amazon-bedrock, package genkit-plugin-amazon-bedrock, module genkit.plugins.amazon_bedrock.
Port structure (Go file → Python module)
Go file
Responsibility
Python module
bedrock.go
plugin init, model/embedder definition, cache-point part
plugin.py
types.go
config, roles, finish reasons, reasoning part ctor
Namespace bedrock, matching Go, so model refs read bedrock/anthropic.claude-... in every language.
Plain boto3 + thread bridge, behind an internal transport seam.
aioboto3 rejected: aiobotocore pins botocore to a narrow patch range, so
the plugin would dictate boto3 versions for every user. A thread bridge
(asyncio.to_thread for unary calls, a pump thread for ConverseStream)
keeps the event loop unblocked at LLM concurrency levels. Same call as
Strands, pydantic-ai (Should we move to aioboto3? pydantic/pydantic-ai#1222), and langchain-aws.
All boto3 calls go through one transport module so we can swap to AWS's
async SDK when it matures.
Reranker as a plugin helper. Neither runtime has a usable reranker
primitive. Python core carries ActionKind.RERANKER
(_core/_action.py:128) and nothing else: no define_reranker, no ai.rerank(), and the schema types are denylisted from codegen
(py/scripts/schema_to_typing.py:17-28). Go has no reranker action type
at all, though it does ship the generated ai.RerankerRequest/RerankerResponse types. Registering an action of
that kind works mechanically, the registry does not constrain kind, but
callers would be left on resolve_action plus arun with hand-rolled
types. So rerank ships as a method on the plugin, as in Go. Worth
revisiting if ai.rerank() lands upstream, since a registered action
would also pick up reflection listing and tracing spans.
Tests land with each slice: pytest-asyncio unit tests plus env-gated live
tests mirroring the Go *_live_test.go matrix.
Open questions
boto3 version floor: Converse cache points and newer stop reasons need
recent botocore; will pin it down at slice 3.
Go train items 11/13/14 (region resolution, live-test matrix, docs) are
still open upstream; we'll port their outcomes when they land rather
than freezing current Go behavior.
Port of the Amazon Bedrock plugin to Python, using the Go plugin
(
genkit-ai/aws-bedrock-go-plugin)as the source of truth. Same slice discipline as the Go train
(genkit-ai/aws-bedrock-go-plugin#136).
Landing strategy
Work lands as small PRs into a shared base branch,
py-bedrock-plugin,rather than straight to
main. The base branch rebases ontomainperiodically; when the train completes, one PR takes the assembled plugin
to
main. Reviewers get small diffs during development and the fullplugin at the end.
Plugin lives at
py/plugins/amazon-bedrock, packagegenkit-plugin-amazon-bedrock, modulegenkit.plugins.amazon_bedrock.Port structure (Go file → Python module)
bedrock.goplugin.pytypes.goconfig.py,typing.pymodels.gomodel_info.pygenerate.goconverters.py+models.pystream.gomodels.pyembed.goembedders.pyimage.goimage.pyrerank.gorerank.pyKey decisions
bedrock, matching Go, so model refs readbedrock/anthropic.claude-...in every language.boto3+ thread bridge, behind an internal transport seam.aioboto3 rejected: aiobotocore pins botocore to a narrow patch range, so
the plugin would dictate boto3 versions for every user. A thread bridge
(
asyncio.to_threadfor unary calls, a pump thread forConverseStream)keeps the event loop unblocked at LLM concurrency levels. Same call as
Strands, pydantic-ai (Should we move to aioboto3? pydantic/pydantic-ai#1222), and langchain-aws.
All boto3 calls go through one transport module so we can swap to AWS's
async SDK when it matures.
primitive. Python core carries
ActionKind.RERANKER(
_core/_action.py:128) and nothing else: nodefine_reranker, noai.rerank(), and the schema types are denylisted from codegen(
py/scripts/schema_to_typing.py:17-28). Go has no reranker action typeat all, though it does ship the generated
ai.RerankerRequest/RerankerResponsetypes. Registering an action ofthat kind works mechanically, the registry does not constrain
kind, butcallers would be left on
resolve_actionplusarunwith hand-rolledtypes. So rerank ships as a method on the plugin, as in Go. Worth
revisiting if
ai.rerank()lands upstream, since a registered actionwould also pick up reflection listing and tracing spans.
PR train
media, cache points, usage, stop reasons - feat(py/plugins/amazon-bedrock): add Converse non-streaming generate path #5876
Tests land with each slice: pytest-asyncio unit tests plus env-gated live
tests mirroring the Go
*_live_test.gomatrix.Open questions
recent botocore; will pin it down at slice 3.
still open upstream; we'll port their outcomes when they land rather
than freezing current Go behavior.