Skip to content
This repository was archived by the owner on Aug 21, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lelamp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ def _lamp_cfg_get(key: str, default: str = "") -> str:
# For Gemini: "off" disables automatic activity detection; any other value enables it.
# For OpenAI: maps to turn_detection type in session config.
REALTIME_TURN_DETECTION: str = os.environ.get("LELAMP_REALTIME_TURN_DETECTION", "off")
REALTIME_CONNECT_MAX_RETRIES: int = int(os.environ.get("LELAMP_REALTIME_CONNECT_MAX_RETRIES", "3"))

# --- Realtime: Gemini Live ---
REALTIME_GEMINI_API_KEY: str = (
Expand Down
12 changes: 2 additions & 10 deletions lelamp/service/realtime/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@


def _load_language() -> str | None:
"""Load language from Lamp's config.json (stt_language field)."""
"""Load language from device config.json (stt_language field)."""
from lelamp.config import _lamp_cfg_get

lang: str = _lamp_cfg_get("stt_language", "").strip()
return lang if lang else None


def _parse_turn_detection(value: str) -> OpenAITurnDetectionType | None:
"""Parse LELAMP_REALTIME_TURN_DETECTION into an OpenAITurnDetectionType or None (off)."""
"""Parse HAL_REALTIME_TURN_DETECTION into an OpenAITurnDetectionType or None (off)."""
v = value.strip().lower()
if v in ("off", "none", ""):
return None
Expand All @@ -51,8 +51,6 @@ class OpenAIConfig(BaseModel):
)
truncation_type: OpenAITruncationType = OpenAITruncationType.RETENTION_RATIO
truncation_retention_ratio: float = 0.5
max_retries: int = 3
reconnect_delay_s: float = 2.0


class GeminiConfig(BaseModel):
Expand All @@ -73,9 +71,3 @@ class GeminiConfig(BaseModel):
"",
)
context_window_compression: bool = True
max_retries: int = 3
reconnect_delay_s: float = 2.0
send_timeout_s: float = 10.0
recv_timeout_s: float = 300.0
queue_poll_s: float = 1.0
join_timeout_s: float = 5.0
Loading