embed_documents

Function

Calls the TEI service to convert the text list provided by the user into vectors.

Prototype

def embed_documents(texts, batch_size)

Parameters

Parameter

Data Type

Required/Optional

Description

texts

List[str]

Required

Text list. The list length range is (0, 1000 × 1000], and the string length range is [1, 128 × 1024 × 1024].

batch_size

Integer

Optional

Batch size. texts of batch_size is combined for embedding each time. The value range is [1, 1024]. The default value is 32.

Return Value

Data Type

Description

List[List[float]]

Vector array after the conversion of texts.

If texts is an array whose length is 4 and the output of the embedding model is a 1024-dimensional vector, the final output result is an array of size (4, 1024).