bedrock

package
v1.4.577 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bedrock provides a plugin to use Amazon Bedrock models.

ListModels reads the model list from the Bedrock control plane. Models must support the Converse and ConverseStream operations.

Authentication has three modes, in priority order:

  1. Bearer token: a Bedrock API key (ABSK token).
  2. Explicit credentials: an AWS access key ID and secret access key from fabric --setup or the .env file.
  3. The AWS credential provider chain, the same chain that the AWS CLI and SDKs use: https://docs.aws.amazon.com/sdkref/latest/guide/standardized-credentials.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BedrockClient

type BedrockClient struct {
	*plugins.PluginBase
	// contains filtered or unexported fields
}

BedrockClient is a plugin to add support for Amazon Bedrock. It implements the plugins.Plugin interface and provides methods for interacting with AWS Bedrock's Converse and ConverseStream APIs.

Authentication modes (in priority order):

  1. Bearer token: BEDROCK_API_KEY (ABSK token) — simplest, like Claude Code
  2. Explicit credentials: BEDROCK_AWS_ACCESS_KEY_ID + BEDROCK_AWS_SECRET_ACCESS_KEY provided via setup
  3. AWS credential chain: Standard AWS SDK credential resolution (env vars, profiles, IAM roles, etc.)

func NewClient

func NewClient() (ret *BedrockClient)

NewClient returns a new Bedrock plugin client. Client initialization is deferred to configure() so that explicit credentials from the .env file or --setup can be used when available.

func (*BedrockClient) ListModels

func (c *BedrockClient) ListModels(ctx context.Context) ([]string, error)

ListModels retrieves all available foundation models and inference profiles from AWS Bedrock that can be used with this plugin. When using bearer token auth, the API may not be accessible, so a static fallback list of common models is returned instead.

func (*BedrockClient) Send

func (c *BedrockClient) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions) (ret string, err error)

Send sends the messages the Bedrock Converse API

func (*BedrockClient) SendStream

func (c *BedrockClient) SendStream(ctx context.Context, msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions, channel chan domain.StreamUpdate) (err error)

SendStream sends the messages to the Bedrock ConverseStream API

func (*BedrockClient) Setup added in v1.4.430

func (c *BedrockClient) Setup() (err error)

Setup overrides the default plugin Setup to provide a guided auth flow: 1. Choose auth method: API Key (ABSK) or AWS Access Key + Secret 2. Based on choice, ask only the relevant questions 3. Choose region from list or type custom 4. Choose model from list or type custom

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL