EmbeddingService

Embed text in vector space

Inheritors

Properties

Link copied to clipboard

Whether this service is standing in for a model the deployment does not have a key for yet, so nothing may be embedded and — above all — no dimension may be read from it.

Link copied to clipboard
abstract val dimensions: Int

Dimension of the embedding vectors produced by this model

Link copied to clipboard
abstract val name: String

Name of the LLM, such as "gpt-3.5-turbo"

Link copied to clipboard
abstract val pricingModel: PricingModel?

The pricing model for the embedding service, if known. Null for local models (Ollama, ONNX) where the cost is zero.

Link copied to clipboard
abstract val provider: String

Name of the provider, such as "OpenAI"

Link copied to clipboard
open override val type: ModelType

Functions

Link copied to clipboard
abstract fun embed(text: String): FloatArray

Embed a single text in vector space

abstract fun embed(texts: List<String>): List<FloatArray>

Embed multiple texts in vector space Use this method for better performance when embedding multiple texts

Link copied to clipboard
open fun infoString(verbose: Boolean?, indent: Int): String