bedrock

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TITAN_EMBED_TEXT_V1 = ModelID("amazon.titan-embed-text-v1")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(opts ...Option) (*Client, error)

Creates AWS BedRock embeddings client.

By default `us-east-1` region is used, supply custom `aws.Config` to alter behavior.

The client is configurable using

WithConfig(cfg aws.Config)

func (*Client) ConsumedTokens

func (c *Client) ConsumedTokens() int

Number of tokens consumed within the session

func (*Client) Embedding

func (c *Client) Embedding(ctx context.Context, text string) ([]float32, error)

Calculates embedding vector

type ModelID added in v0.0.3

type ModelID string

type Option

type Option func(*Client)

func WithConfig

func WithConfig(cfg aws.Config) Option

func WithModel added in v0.0.3

func WithModel(id ModelID) Option

Jump to

Keyboard shortcuts

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