bedrock

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package bedrock connects to the Amazon Bedrock Converse API.

Index

Constants

View Source
const (
	ProviderOptionAdditionalModelRequestFields      = "additionalModelRequestFields"
	ProviderOptionAdditionalModelResponseFieldPaths = "additionalModelResponseFieldPaths"
	ProviderOptionGuardrailConfig                   = "guardrailConfig"
	ProviderOptionPerformanceConfig                 = "performanceConfig"
	ProviderOptionPromptVariables                   = "promptVariables"
	ProviderOptionRequestMetadata                   = "requestMetadata"
)

ProviderOptions are native Converse fields copied into the body. An option naming a generated object is merged into it, so model-specific fields go under "additionalModelRequestFields".

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Name identifies the provider in responses, errors and ProviderState,
	// "bedrock" by default.
	Name string
	// Region selects the endpoint and signing region, us-east-1 by default.
	Region string
	// BaseURL overrides the bedrock-runtime endpoint.
	BaseURL string
	// Credentials is required and resolved for every call.
	Credentials CredentialsProvider
	HTTPClient  litellm.HTTPClient
}

Config configures Converse. HTTPClient, when set, sends the SigV4-signed requests; wrap it with retry.NewHTTPClient to retry.

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

Credentials are AWS credentials; SessionToken is for temporary ones.

type CredentialsProvider

type CredentialsProvider interface {
	Credentials(context.Context) (Credentials, error)
}

CredentialsProvider supplies credentials, allowing rotation.

func StaticCredentials

func StaticCredentials(accessKeyID, secretAccessKey, sessionToken string) CredentialsProvider

StaticCredentials returns a CredentialsProvider with fixed credentials.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements litellm.Provider and litellm.CapabilityProvider.

func New

func New(cfg Config) (*Provider, error)

New returns a Provider for cfg.

func (*Provider) Capabilities added in v1.8.1

func (p *Provider) Capabilities() litellm.Capabilities

Capabilities reports the static protocol facts.

func (*Provider) Chat

func (p *Provider) Chat(ctx context.Context, req *litellm.Request) (*litellm.Response, error)

Chat sends a Converse request; Request.Model is the model or inference profile ID.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the configured name.

func (*Provider) Stream

func (p *Provider) Stream(ctx context.Context, req *litellm.Request) (litellm.Stream, error)

Stream sends a ConverseStream request.

Jump to

Keyboard shortcuts

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