janus.embedding.embedding_models_info#

Attributes#

Classes#

Functions#

load_embedding_model(model_name)

Load an embedding model from the configuration file or create a new one

Module Contents#

janus.embedding.embedding_models_info.log#
class janus.embedding.embedding_models_info.EmbeddingModelType#

Bases: aenum.MultiValueEnum

OpenAI = ('OpenAI', 'openai', 'open-ai', 'oai')#
HuggingFaceLocal = ('HuggingFaceLocal', 'huggingfacelocal', 'huggingface-local', 'hfl')#
HuggingFaceInferenceAPI = ('HuggingFaceInferenceAPI', 'huggingfaceinferenceapi', 'huggingface-inference-api', 'hfia')#
janus.embedding.embedding_models_info.EMBEDDING_MODEL_TYPE_CONSTRUCTORS: Dict[EmbeddingModelType, Callable[[Any], langchain_core.embeddings.Embeddings]]#
janus.embedding.embedding_models_info.EMBEDDING_MODEL_TYPE_DEFAULT_IDS: Dict[EmbeddingModelType, Dict[str, Any]]#
janus.embedding.embedding_models_info.EMBEDDING_MODEL_DEFAULT_ARGUMENTS: Dict[str, Dict[str, Any]]#
janus.embedding.embedding_models_info.EMBEDDING_MODEL_CONFIG_DIR#
janus.embedding.embedding_models_info.EMBEDDING_TOKEN_LIMITS: Dict[str, int]#
janus.embedding.embedding_models_info.EMBEDDING_COST_PER_MODEL: Dict[str, float]#
janus.embedding.embedding_models_info.load_embedding_model(model_name)#

Load an embedding model from the configuration file or create a new one

Parameters:
  • model_name (str) – The user-given name of the model to load.

  • model_type – The type of the model to load.

  • identifier – The identifier for the model (e.g. the name, URL, or HuggingFace path).

Return type:

Tuple[langchain_core.embeddings.Embeddings, int, Dict[str, float]]