aws

package
v0.0.0-...-7319f5f Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelLlama213BChatV1  = "meta.llama2-13b-chat-v1"
	ModelLlama270BChatV1  = "meta.llama2-70b-chat-v1"
	ModelTitanTextExpress = "amazon.titan-text-express-v1"
	ModelTitanTextLite    = "amazon.titan-text-lite-v1"
	ModelTitanEmbedText   = "amazon.titan-embed-text-v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AI

type AI struct {
	Output       *bedrock.ListFoundationModelsOutput
	CustomOutput *bedrock.ListCustomModelsOutput
	// contains filtered or unexported fields
}

func NewAI

func NewAI() (*AI, error)

NewAI gets a new AI which uses the default AWS configuration (i.e. ~/.aws/config and standard AWS env vars).

func NewAIFromConfig

func NewAIFromConfig(cfg aws.Config) (*AI, error)

func (*AI) GenerateStream

func (ai *AI) GenerateStream(req *aicli.GenerateRequest, output io.Writer) (aicli.Message, error)

func (*AI) GetEmbedding

func (ai *AI) GetEmbedding(req *aicli.EmbeddingRequest) ([]aicli.Embedding, error)

type AWSEmbedModel

type AWSEmbedModel interface {
	MakeBodyEmbed(req *aicli.EmbeddingRequest) ([]byte, error)
	HandleResponseEmbed(respBytes []byte) ([]float32, error)
}

type AWSSubModel

type AWSSubModel interface {
	MakeBody(req *aicli.GenerateRequest) ([]byte, error)
	HandleResponseChunk(chunkBytes []byte) ([]byte, error)
}

type LlamaSubModel

type LlamaSubModel struct{}

func (LlamaSubModel) HandleResponseChunk

func (m LlamaSubModel) HandleResponseChunk(chunkBytes []byte) ([]byte, error)

func (LlamaSubModel) MakeBody

func (m LlamaSubModel) MakeBody(req *aicli.GenerateRequest) ([]byte, error)

type TitanEmbedTextSubModel

type TitanEmbedTextSubModel struct{}

func (TitanEmbedTextSubModel) HandleResponseEmbed

func (m TitanEmbedTextSubModel) HandleResponseEmbed(body []byte) ([]float32, error)

func (TitanEmbedTextSubModel) MakeBodyEmbed

func (m TitanEmbedTextSubModel) MakeBodyEmbed(req *aicli.EmbeddingRequest) ([]byte, error)

type TitanTextSubModel

type TitanTextSubModel struct{}

func (TitanTextSubModel) HandleResponseChunk

func (m TitanTextSubModel) HandleResponseChunk(chunkBytes []byte) ([]byte, error)

func (TitanTextSubModel) MakeBody

func (m TitanTextSubModel) MakeBody(req *aicli.GenerateRequest) ([]byte, error)

Jump to

Keyboard shortcuts

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