base
langroid/embedding_models/base.py
EmbeddingModel
¶
Bases: ABC
Abstract base class for an embedding model.
clone()
¶
Return a copy of this embedding model suitable for use in cloned agents. Default behaviour attempts to deep-copy the model configuration and instantiate a fresh model of the same type; if that is not possible, the original instance is reused.
Source code in langroid/embedding_models/base.py
similarity(text1, text2)
¶
Compute cosine similarity between two texts.