zhipuai

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 5 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 *ZhiPuAI)

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 llmzhipuai.ZhiPuAI) 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 ZhiPuAI

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

func NewZhiPuAI

func NewZhiPuAI(opts ...Option) (ZhiPuAI, error)

func (ZhiPuAI) EmbedDocuments

func (e ZhiPuAI) EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error)

EmbedDocuments creates one vector embedding for each of the texts.

func (ZhiPuAI) EmbedQuery

func (e ZhiPuAI) EmbedQuery(ctx context.Context, text string) ([]float32, error)

EmbedQuery embeds a single text.

Jump to

Keyboard shortcuts

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