mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-01 08:59:46 +02:00
Initial Commit 🚀 🚀
This commit is contained in:
commit
4f2a629340
444 changed files with 76863 additions and 0 deletions
34
api/services/configuration/defaults.py
Normal file
34
api/services/configuration/defaults.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
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,
|
||||
OpenAILLMService,
|
||||
ServiceProviders,
|
||||
)
|
||||
|
||||
# Mapping of service to (provider enum, configuration class)
|
||||
_DEFAULTS = {
|
||||
"llm": (ServiceProviders.OPENAI, OpenAILLMService),
|
||||
"tts": (ServiceProviders.ELEVENLABS, ElevenlabsTTSConfiguration),
|
||||
"stt": (ServiceProviders.DEEPGRAM, DeepgramSTTConfiguration),
|
||||
}
|
||||
|
||||
# Public mapping of service name -> default provider
|
||||
DEFAULT_SERVICE_PROVIDERS = {
|
||||
field: provider for field, (provider, _) in _DEFAULTS.items()
|
||||
}
|
||||
|
||||
__all__ = [
|
||||
"DEFAULT_SERVICE_PROVIDERS",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue