Class AwsBedrockPlugin
java.lang.Object
com.google.genkit.plugins.awsbedrock.AwsBedrockPlugin
- All Implemented Interfaces:
Plugin
AwsBedrockPlugin provides AWS Bedrock model integrations for Genkit.
This plugin registers various AWS Bedrock models including Amazon Nova,
Amazon Titan, Anthropic Claude, AI21 Jamba, Meta Llama, Cohere Command,
Mistral, DeepSeek, Google Gemma, Qwen, NVIDIA, OpenAI, Writer, MiniMax,
Moonshot, and TwelveLabs models as Genkit actions for text generation with
support for streaming.
Supports both direct model IDs and inference profile IDs/ARNs. Inference profiles enable cross-region inference and are required for certain models (e.g., Claude 4.x, Claude 3.5+ models).
Using Inference Profiles
For models that require inference profiles, you can use either:
- Inference profile ID:
us.anthropic.claude-sonnet-4-5-v2:0 - Model ID (if ON_DEMAND supported):
amazon.nova-lite-v1:0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionSupported AWS Bedrock models with ON_DEMAND or INFERENCE_PROFILE support. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an AwsBedrockPlugin with default options.AwsBedrockPlugin(AwsBedrockPluginOptions options) Creates an AwsBedrockPlugin with the specified options. -
Method Summary
Modifier and TypeMethodDescriptionstatic AwsBedrockPlugincreate()Creates an AwsBedrockPlugin using default AWS credentials and us-east-1 region.static AwsBedrockPluginCreates an AwsBedrockPlugin with the specified region.customModel(String modelId) Registers a custom model ID or inference profile.getName()Returns the unique identifier for the plugin.Gets the plugin options.init()Initializes the plugin.
-
Field Details
-
SUPPORTED_MODELS
Supported AWS Bedrock models with ON_DEMAND or INFERENCE_PROFILE support.
-
-
Constructor Details
-
AwsBedrockPlugin
public AwsBedrockPlugin()Creates an AwsBedrockPlugin with default options. -
AwsBedrockPlugin
Creates an AwsBedrockPlugin with the specified options.- Parameters:
options- the plugin options
-
-
Method Details
-
create
Creates an AwsBedrockPlugin with the specified region.- Parameters:
region- the AWS region string (e.g., "us-east-1")- Returns:
- a new AwsBedrockPlugin
-
create
Creates an AwsBedrockPlugin using default AWS credentials and us-east-1 region.- Returns:
- a new AwsBedrockPlugin
-
getName
Description copied from interface:PluginReturns the unique identifier for the plugin. This name is used for registration and lookup. -
init
Description copied from interface:PluginInitializes the plugin. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides. -
customModel
Registers a custom model ID or inference profile. Use this to work with models not in the default list or to use inference profiles. Call this method before passing the plugin to Genkit.builder().- Parameters:
modelId- the model ID or inference profile ID (e.g., "us.anthropic.claude-sonnet-4-5-v2:0")- Returns:
- this plugin instance for method chaining
-
getOptions
Gets the plugin options.- Returns:
- the options
-