Documentation
¶
Overview ¶
Package bedrock provides a ModelProvider adapter for AWS Bedrock Converse API. It implements the Converse API wire format with HAND-ROLLED SigV4 signing (no aws-sdk dep).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option is a functional option for configuring a Provider.
func WithCredentials ¶
WithCredentials sets AWS credentials for SigV4 signing.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client for requests.
func WithRegion ¶
WithRegion sets the AWS region (default: us-east-1).
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements runtime.ModelProvider for AWS Bedrock Converse API.
func NewWithEndpoint ¶
NewWithEndpoint creates a new Bedrock provider with a custom endpoint. Used primarily for testing with httptest.Server.
func (*Provider) Complete ¶
Complete sends a request to the model and returns its complete response.
func (*Provider) Stream ¶
Stream sends a request to the model and returns a StreamReader for reading chunks. NOTE: AWS Bedrock converse-stream uses binary event-stream framing which is complex. For httptest.Server compatibility, we implement Stream as Complete-then-single-chunk emulation: Stream makes a Complete call and returns it wrapped as a single chunk. This is deterministic and contract-compatible with the runtime.StreamReader interface, though it differs from true streaming. Production code should use the /converse-stream endpoint with proper AWS event-stream decoding when available.