• Python
    • DataImport
    • EmbeddingModels
      • BGEM3EmbeddingFunction
      • BM25EmbeddingFunction
      • CohereEmbeddingFunction
      • GeminiEmbeddingFunction
      • InstructorEmbeddingFunction
      • JinaEmbeddingFunction
      • MGTEEmbeddingFunction
      • MistralAIEmbeddingFunction
      • Model2VecEmbeddingFunction
      • NomicEmbeddingFunction
      • OnnxEmbeddingFunction
      • OpenAIEmbeddingFunction
      • SentenceTransformerEmbeddingFunction
      • SpladeEmbeddingFunction
      • TEIEmbeddingFunction
      • VoyageEmbeddingFunction
    • Exceptions
    • FileResource
    • MilvusClient
    • ORM
    • Rerankers

TEIEmbeddingFunction

TEIEmbeddingFunction is a class in pymilvus that handles encoding text into embeddings using a Text Embeddings Inference (TEI) service to support embedding retrieval in Milvus.

pymilvus.model.dense.TEIEmbeddingFunction

Constructor

Constructs a TEIEmbeddingFunction for common use cases.

TEIEmbeddingFunction(
    api_url: str,
    dimensions: Optional[int] = None
)

PARAMETERS:

  • api_url (string) -

    [REQUIRED]

    The URL of the Text Embeddings Inference (TEI) service to use for encoding.

    The class appends /v1/embeddings to the specified URL to form the encoding endpoint.

  • dimensions (int) -

    The number of dimensions the resulting output embeddings should have.

    The value defaults to None, in which case the class determines the dimension by sending a test request to the TEI service.

Example

from pymilvus.model.dense import TEIEmbeddingFunction

tei_ef = TEIEmbeddingFunction(
    api_url="http://localhost:8080", # Replace with the URL of your TEI service
)

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?