Embed a list of strings.
Google Generative AI currently sets a max batch size of 100 strings.
embed_documents(
self,
texts: list[str],
*,
batch_size: int = _DEFAULT_BATCH_SIZE,
task_type: str | None = None,
titles: list[str] | None = None,
output_dimensionality: int | None = None
) -> list[list[float]]| Name | Type | Description |
|---|---|---|
texts* | list[str] | The list of strings to embed. |
batch_size | int | Default: _DEFAULT_BATCH_SIZEBatch size of embeddings to send to the model |
task_type | str | None | Default: None |
titles | list[str] | None | Default: NoneOptional list of titles for texts provided. Only applicable when |
output_dimensionality | int | None | Default: NoneOptional reduced dimension for the output embedding. |