vertexaichat

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 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 ChatOption

type ChatOption func(p *ChatVertexAI)

func WithBatchSize

func WithBatchSize(batchSize int) ChatOption

WithBatchSize is an option for specifying the batch size.

func WithClient

func WithClient(client vertexai.Chat) ChatOption

WithClient is an option for providing the LLM client.

func WithStripNewLines

func WithStripNewLines(stripNewLines bool) ChatOption

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

type ChatVertexAI

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

ChatVertexAI is the embedder using the VertexAI api.

func NewChatVertexAI

func NewChatVertexAI(opts ...ChatOption) (ChatVertexAI, error)

NewChatVertexAI creates a new ChatVertexAI with options. Options for client, strip new lines and batch.

func (ChatVertexAI) EmbedDocuments

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

func (ChatVertexAI) EmbedQuery

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

Jump to

Keyboard shortcuts

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