Documentation ¶
Index ¶
Constants ¶
View Source
const ( /* ModelCohereEn is the model id for the cohere english embeddings. ModelDimensions := 1024 MaxTokens := 512 Languages := []string{"English"} */ ModelCohereEn = "cohere.embed-english-v3" /* ModelCohereMulti is the model id for the cohere multilingual embeddings. ModelDimensions := 1024 MaxTokens:= 512 Languages := [108]string */ ModelCohereMulti = "cohere.embed-multilingual-v3" )
View Source
const ( // CohereInputTypeText is the input type for text embeddings. CohereInputTypeText = "search_document" // CohereInputTypeQuery is the input type for query embeddings. CohereInputTypeQuery = "search_query" )
View Source
const (
/*
ModelTitanEmbedG1 is the model id for the amazon text embeddings.
MaxTokens := 8000
ModelDimensions := 1536
Languages := []string{"English", "Arabic", "Chinese (Simplified)", "French", "German", "Hindi", "Japanese", "Spanish", "Czech", "Filipino", "Hebrew", "Italian", "Korean", "Portuguese", "Russian", "Swedish", "Turkish", "Chinese (Traditional)", "Dutch", "Kannada", "Malayalam", "Marathi", "Polish", "Tamil", "Telugu", ...}
*/
ModelTitanEmbedG1 = "amazon.titan-embed-text-v1"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bedrock ¶
type Bedrock struct { ModelID string StripNewLines bool BatchSize int // contains filtered or unexported fields }
Bedrock is the embedder used generate text embeddings through Amazon Bedrock.
func NewBedrock ¶
NewBedrock returns a new embeddings.Embedder that uses Amazon Bedrock to generate embeddings.
func (*Bedrock) EmbedDocuments ¶
EmbedDocuments implements embeddings.Embedder and generates embeddings for the supplied texts.
type Option ¶
type Option func(p *Bedrock)
Option is a function type that can be used to modify the client.
func WithBatchSize ¶
WithBatchSize is an option for specifying the batch size. Only applicable to Cohere provider.
func WithClient ¶
func WithClient(client *bedrockruntime.Client) Option
WithClient is an option for providing the Bedrock client.
func WithStripNewLines ¶
WithStripNewLines is an option for specifying the should it strip new lines.
Click to show internal directories.
Click to hide internal directories.