nim_to_list
embeds(CreateEmbeddingResponse): The embedding response returned by the NIM API.
list[list[float]]: One embedding per input document.
NimEncoder Objects
https://integrate.api.nvidia.com/v1 rather than
depending on LiteLLM. Point base_url at your own host to use a self-hosted NIM.
NVIDIA’s nv-embedqa models are asymmetric: queries must be embedded with
input_type="query" and stored documents with input_type="passage", so
:meth:0 and :meth:1 differ accordingly.
__init__
name(str): The name of the embedding model to use such as “nvidia/nv-embedqa-e5-v5”.api_key(str): The Nim API key, can also be set via the NVIDIA_NIM_API_KEY environment variable.score_threshold(float): The score threshold for the embeddings.base_url(str): Override the NIM API base URL, can also be set via the NVIDIA_NIM_API_BASE environment variable. Use this to target a self-hosted NIM container.
ValueError: If no API key is provided or found in the environment.
__call__
docs(list[Any]): List of text documents to encode.
list[list[float]]: List of embeddings for each document.
acall
docs(list[Any]): List of text documents to encode.
list[list[float]]: List of embeddings for each document.
