dograh/api/services/configuration/defaults.py
Abhishek ef5b9e40a9
feat: knowledge base functionality for the voice agent (#120)
* feat: upload file and store embedding

* feat: add documents in nodes

* feat: add openai embedding service
2026-01-17 14:37:03 +05:30

36 lines
1.1 KiB
Python

from __future__ import annotations
"""Utilities for building default service configurations for a new user.
The defaults follow the same provider choices exposed by `/user/configurations/defaults`.
Values for `api_key` are pulled from environment variables named *{PROVIDER}_API_KEY*.
If an environment variable is missing, that particular provider configuration is
left as ``None``.
"""
from api.services.configuration.registry import (
DeepgramSTTConfiguration,
ElevenlabsTTSConfiguration,
OpenAIEmbeddingsConfiguration,
OpenAILLMService,
ServiceProviders,
)
# Mapping of service to (provider enum, configuration class)
_DEFAULTS = {
"llm": (ServiceProviders.OPENAI, OpenAILLMService),
"tts": (ServiceProviders.ELEVENLABS, ElevenlabsTTSConfiguration),
"stt": (ServiceProviders.DEEPGRAM, DeepgramSTTConfiguration),
"embeddings": (ServiceProviders.OPENAI, OpenAIEmbeddingsConfiguration),
}
# Public mapping of service name -> default provider
DEFAULT_SERVICE_PROVIDERS = {
field: provider for field, (provider, _) in _DEFAULTS.items()
}
__all__ = [
"DEFAULT_SERVICE_PROVIDERS",
]