Insert text data with embeddings vectors into Milvus.
This method inserts a batch of text embeddings into a Milvus collection. If the collection is not initialized, it will automatically initialize the collection based on the embeddings,metadatas, and other parameters. The embeddings are expected to be pre-generated using compatible embedding functions, and the metadata associated with each text is optional but must match the number of texts.
add_embeddings(
self,
texts: List[str],
embeddings: List[List[float]] | List[List[List[float]]],
metadatas: Optional[List[dict]] = None,
timeout: Optional[float] = None,
batch_size: int = 1000,
*,
ids: Optional[List[str]] = None,
**kwargs: Any = {}
) -> List[str]| Name | Type | Description |
|---|---|---|
texts* | List[str] | the texts to insert |
embeddings* | List[List[float]] | List[List[List[float]]] | A vector embeddings for each text (in case of a single vector) or list of vectors for each text (in case of multi-vector) |
metadatas | Optional[List[dict]] | Default: NoneMetadata dicts attached to each of the texts. Defaults to None. |
timeout | Optional[float] | Default: NoneTimeout for each batch insert. Defaults to None. |
batch_size | int | Default: 1000Batch size to use for insertion. Defaults to 1000. |
ids | Optional[List[str]] | Default: NoneList of text ids. The length of each item should be less than 65535 bytes. Required and work when auto_id is False. |