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 ¶
- type BedrockClient
- func (c *BedrockClient) ListModels() ([]string, error)
- func (c *BedrockClient) NeedsRawMode(modelName string) bool
- func (c *BedrockClient) Send(ctx context.Context, msgs []*goopenai.ChatCompletionMessage, ...) (ret string, err error)
- func (c *BedrockClient) SendStream(msgs []*goopenai.ChatCompletionMessage, opts *common.ChatOptions, ...) (err error)
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 []*goopenai.ChatCompletionMessage, opts *common.ChatOptions) (ret string, err error)
Send sends the messages the Bedrock Converse API
func (*BedrockClient) SendStream ¶
func (c *BedrockClient) SendStream(msgs []*goopenai.ChatCompletionMessage, opts *common.ChatOptions, channel chan string) (err error)
SendStream sends the messages to the the Bedrock ConverseStream API