bedrock

package
v1.4.232 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package bedrock provides a plugin to use Amazon Bedrock models. Supported models are defined in the MODELS variable. To add additional models, append them to the MODELS array. Models must support the Converse and ConverseStream operations Authentication uses the AWS credential provider chain, similar.to the AWS CLI and SDKs 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.

func NewClient

func NewClient() (ret *BedrockClient)

NewClient returns a new Bedrock plugin client

func (*BedrockClient) ListModels

func (c *BedrockClient) ListModels() ([]string, error)

ListModels retrieves all available foundation models and inference profiles from AWS Bedrock that can be used with this plugin.

func (*BedrockClient) NeedsRawMode

func (c *BedrockClient) NeedsRawMode(modelName string) bool

NeedsRawMode indicates whether the model requires raw mode processing. Bedrock models do not require raw mode.

func (*BedrockClient) Send

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

Send sends the messages the Bedrock Converse API

func (*BedrockClient) SendStream

func (c *BedrockClient) SendStream(msgs []*chat.ChatCompletionMessage, opts *common.ChatOptions, channel chan string) (err error)

SendStream sends the messages to the the Bedrock ConverseStream API

Jump to

Keyboard shortcuts

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