Class AwsBedrockPlugin

java.lang.Object
com.google.genkit.plugins.awsbedrock.AwsBedrockPlugin
All Implemented Interfaces:
Plugin

public class AwsBedrockPlugin extends Object implements 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 Details

    • SUPPORTED_MODELS

      public static final List<String> 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

      public AwsBedrockPlugin(AwsBedrockPluginOptions options)
      Creates an AwsBedrockPlugin with the specified options.
      Parameters:
      options - the plugin options
  • Method Details

    • create

      public static AwsBedrockPlugin create(String region)
      Creates an AwsBedrockPlugin with the specified region.
      Parameters:
      region - the AWS region string (e.g., "us-east-1")
      Returns:
      a new AwsBedrockPlugin
    • create

      public static AwsBedrockPlugin create()
      Creates an AwsBedrockPlugin using default AWS credentials and us-east-1 region.
      Returns:
      a new AwsBedrockPlugin
    • getName

      public String getName()
      Description copied from interface: Plugin
      Returns the unique identifier for the plugin. This name is used for registration and lookup.
      Specified by:
      getName in interface Plugin
      Returns:
      the plugin name
    • init

      public List<Action<?,?,?>> init()
      Description copied from interface: Plugin
      Initializes the plugin. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides.
      Specified by:
      init in interface Plugin
      Returns:
      list of actions provided by this plugin
    • customModel

      public AwsBedrockPlugin customModel(String modelId)
      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

      public AwsBedrockPluginOptions getOptions()
      Gets the plugin options.
      Returns:
      the options