bedrockruntime

package
v1.8.11 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BedrockRuntime

type BedrockRuntime struct {
	// define the AWS region that BedrockRuntime is located at
	AwsRegion awsregion.AWSRegion

	// custom http2 client options
	HttpOptions *awshttp2.HttpClientSettings

	// CallTimeout, when > 0, overrides the per-InvokeModel call deadline
	// (defaultBedrockCallTimeout, 120s). Zero (the default) keeps the built-in
	// bound, so existing callers are unaffected. Set a larger value for a model
	// or prompt that legitimately runs longer than 120s, or a smaller value to
	// fit a tighter caller budget.
	//
	// Set this at construction (like a constructor parameter) and treat it as
	// immutable thereafter. It is read lock-free on the InvokeModel path; unlike
	// HttpOptions/the client (which Connect mutates at runtime under mu), this
	// field has no internal writer, so a getter under mu would not make a direct
	// consumer write race-free — mutating it concurrently with an in-flight call
	// is therefore unsupported.
	CallTimeout time.Duration
	// contains filtered or unexported fields
}

BedrockRuntime struct encapsulates the AWS BedrockRuntime access functionality

func (*BedrockRuntime) Connect

func (s *BedrockRuntime) Connect(parentSegment ...*xray.XRayParentSegment) (err error)

Connect will establish a connection to the BedrockRuntime service

func (*BedrockRuntime) Disconnect

func (s *BedrockRuntime) Disconnect()

Disconnect will clear bedrockruntime client

func (*BedrockRuntime) InvokeModel

func (s *BedrockRuntime) InvokeModel(modelId string, requestBody []byte) (responseBody []byte, err error)

func (*BedrockRuntime) UpdateParentSegment

func (s *BedrockRuntime) UpdateParentSegment(parentSegment *xray.XRayParentSegment)

UpdateParentSegment updates this struct's xray parent segment, if no parent segment, set nil

Jump to

Keyboard shortcuts

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