vertexai

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(p *VertexAIPaLM)

Option is a function type that can be used to modify the client.

func WithBatchSize

func WithBatchSize(batchSize int) Option

WithBatchSize is an option for specifying the batch size.

func WithClient

func WithClient(client vertexai.LLM) Option

WithClient is an option for providing the LLM client.

func WithStripNewLines

func WithStripNewLines(stripNewLines bool) Option

WithStripNewLines is an option for specifying the should it strip new lines.

type VertexAIPaLM

type VertexAIPaLM struct {
	StripNewLines bool
	BatchSize     int
	// contains filtered or unexported fields
}

VertexAIPaLM is the embedder using the Google PaLM api.

func NewVertexAIPaLM

func NewVertexAIPaLM(opts ...Option) (*VertexAIPaLM, error)

NewVertexAIPaLM creates a new VertexAI with options. Options for client, strip new lines and batch size.

func (VertexAIPaLM) EmbedDocuments

func (e VertexAIPaLM) EmbedDocuments(ctx context.Context, texts []string) ([][]float64, error)

EmbedDocuments creates one vector embedding for each of the texts.

func (VertexAIPaLM) EmbedQuery

func (e VertexAIPaLM) EmbedQuery(ctx context.Context, text string) ([]float64, error)

EmbedQuery embeds a single text.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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