xinference.client.handlers.EmbeddingModelHandle.create_embedding#
- EmbeddingModelHandle.create_embedding(input: str | List[str] | List[int] | List[List[int]] | Dict[str, Any] | List[Dict[str, Any]] | List[str | Dict[str, Any]], **kwargs) Embedding#
Create an Embedding from user input via RESTful APIs.
- Parameters:
input (Union[str, List[str], List[int], List[List[int]], Dict[str, Any],) – List[Dict[str, Any]], List[Union[str, Dict[str, Any]]]] Text, token IDs, or multimodal input. Multimodal dictionaries may contain text, image, video, or interleaved role/content messages.
- Returns:
The resulted Embedding vector that can be easily consumed by machine learning models and algorithms.
- Return type:
Embedding
- Raises:
RuntimeError – Report the failure of embeddings and provide the error message.