From dcdadd336170b4b5a54818933a63294d38ff0dbd Mon Sep 17 00:00:00 2001 From: Sameer Pashikanti Date: Fri, 13 Feb 2026 09:27:05 +0000 Subject: [PATCH] fix: build issues --- .../src/components/project/HostGuidePDF.tsx | 2 +- echo/server/dembrane/api/api.py | 2 +- echo/server/dembrane/api/user_settings.py | 2 +- echo/server/dembrane/llm_router.py | 14 ++++++++------ echo/server/dembrane/llms.py | 2 +- echo/server/dembrane/settings.py | 5 +++-- echo/server/dembrane/transcribe.py | 2 +- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/echo/frontend/src/components/project/HostGuidePDF.tsx b/echo/frontend/src/components/project/HostGuidePDF.tsx index 9b458c30..56ca598f 100644 --- a/echo/frontend/src/components/project/HostGuidePDF.tsx +++ b/echo/frontend/src/components/project/HostGuidePDF.tsx @@ -272,7 +272,7 @@ export const HostGuidePDF = ({ {steps.map((step, index) => ( - + {index + 1}. {step} diff --git a/echo/server/dembrane/api/api.py b/echo/server/dembrane/api/api.py index 975be3ea..e9852626 100644 --- a/echo/server/dembrane/api/api.py +++ b/echo/server/dembrane/api/api.py @@ -11,8 +11,8 @@ from dembrane.api.stateless import StatelessRouter from dembrane.api.participant import ParticipantRouter from dembrane.api.conversation import ConversationRouter -from dembrane.api.project_webhook import ProjectWebhookRouter from dembrane.api.user_settings import UserSettingsRouter +from dembrane.api.project_webhook import ProjectWebhookRouter logger = getLogger("api") diff --git a/echo/server/dembrane/api/user_settings.py b/echo/server/dembrane/api/user_settings.py index 3cef62d3..95e93f31 100644 --- a/echo/server/dembrane/api/user_settings.py +++ b/echo/server/dembrane/api/user_settings.py @@ -1,7 +1,7 @@ from logging import getLogger import requests -from fastapi import APIRouter, HTTPException, UploadFile +from fastapi import APIRouter, UploadFile, HTTPException from dembrane.directus import directus from dembrane.api.dependency_auth import DependencyDirectusSession diff --git a/echo/server/dembrane/llm_router.py b/echo/server/dembrane/llm_router.py index da3a8974..27aaa97a 100644 --- a/echo/server/dembrane/llm_router.py +++ b/echo/server/dembrane/llm_router.py @@ -18,9 +18,9 @@ import json import logging -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Literal, Optional -from litellm import Router +from litellm import Router # type: ignore[attr-defined] from litellm.utils import get_model_info from dembrane.settings import LLMProviderConfig, get_settings @@ -34,7 +34,7 @@ ROUTER_NUM_RETRIES = 3 ROUTER_ALLOWED_FAILS = 3 # Failures per minute before cooldown ROUTER_COOLDOWN_TIME = 60 # Seconds to cooldown a failed deployment -ROUTER_ROUTING_STRATEGY = "simple-shuffle" # Recommended for production +ROUTER_ROUTING_STRATEGY: Literal["simple-shuffle"] = "simple-shuffle" # Recommended for production # Global router instance (lazy initialized) _router: Optional[Router] = None @@ -261,9 +261,11 @@ def get_min_context_length(model_group: str) -> int: try: resolved = config.resolve() model_info = get_model_info(resolved.model) - if model_info and model_info.get("max_input_tokens"): - max_tokens = model_info["max_input_tokens"] - if min_tokens is None or max_tokens < min_tokens: + max_tokens = model_info.get("max_input_tokens") if model_info else None + if isinstance(max_tokens, int) and max_tokens > 0: + if min_tokens is None: + min_tokens = max_tokens + elif max_tokens < min_tokens: min_tokens = max_tokens logger.debug(f" {model_group}[{suffix}] {resolved.model}: {max_tokens} tokens") except Exception as e: diff --git a/echo/server/dembrane/llms.py b/echo/server/dembrane/llms.py index bb016e1c..495c8832 100644 --- a/echo/server/dembrane/llms.py +++ b/echo/server/dembrane/llms.py @@ -8,7 +8,7 @@ from dembrane.settings import get_settings if TYPE_CHECKING: - from litellm import Router + from litellm import Router # type: ignore[attr-defined] logger = logging.getLogger(__name__) diff --git a/echo/server/dembrane/settings.py b/echo/server/dembrane/settings.py index 15bdc129..ce49a963 100644 --- a/echo/server/dembrane/settings.py +++ b/echo/server/dembrane/settings.py @@ -184,8 +184,9 @@ def get_deployments_for_group( value = vars_dict[env_field] # Handle JSON fields if config_field in ("vertex_credentials", "gcp_sa_json"): - value = _coerce_service_account(value) - config_data[config_field] = value + config_data[config_field] = _coerce_service_account(value) + else: + config_data[config_field] = value # Only add if model is configured if config_data.get("model"): diff --git a/echo/server/dembrane/transcribe.py b/echo/server/dembrane/transcribe.py index d777c258..b717f26f 100644 --- a/echo/server/dembrane/transcribe.py +++ b/echo/server/dembrane/transcribe.py @@ -368,7 +368,7 @@ def transcribe_audio_dembrane_26_01_redaction( logger.info( f"Transcription failed with AssemblyAI. Continuing with empty transcript: {e}" ) - transcript, response = "[Nothing to transcribe]", {} + transcript = "[Nothing to transcribe]" # Apply regex PII redaction BEFORE the correction workflow if not assemblyai_response_failed: