Issue Fix
Upload 404 warning doc_set(merge=True) in upload.py — creates doc if missing MQTT call_end 404 error doc_set(merge=True) in mqtt_handler.py — same root cause Transcription 404 (saving transcript to nonexistent doc) doc_set(merge=True) in transcription.py Transcription ADC credentials error Explicit service_account.Credentials from gcp-key.json in _sync_transcribe — same pattern as storage.py
This commit is contained in:
@@ -35,7 +35,7 @@ async def transcribe_call(call_id: str, gcs_uri: str) -> Optional[str]:
|
||||
|
||||
if transcript:
|
||||
try:
|
||||
await fstore.doc_update("calls", call_id, {"transcript": transcript})
|
||||
await fstore.doc_set("calls", call_id, {"transcript": transcript})
|
||||
logger.info(f"Transcript saved for call {call_id} ({len(transcript)} chars)")
|
||||
except Exception as e:
|
||||
logger.warning(f"Could not save transcript for {call_id}: {e}")
|
||||
@@ -46,8 +46,17 @@ async def transcribe_call(call_id: str, gcs_uri: str) -> Optional[str]:
|
||||
def _sync_transcribe(gcs_uri: str) -> Optional[str]:
|
||||
"""Synchronous STT call — run in a thread via asyncio.to_thread."""
|
||||
from google.cloud import speech
|
||||
from app.config import settings
|
||||
|
||||
client = speech.SpeechClient()
|
||||
if settings.gcp_credentials_path:
|
||||
from google.oauth2 import service_account
|
||||
creds = service_account.Credentials.from_service_account_file(
|
||||
settings.gcp_credentials_path,
|
||||
scopes=["https://www.googleapis.com/auth/cloud-platform"],
|
||||
)
|
||||
client = speech.SpeechClient(credentials=creds)
|
||||
else:
|
||||
client = speech.SpeechClient()
|
||||
|
||||
audio = speech.RecognitionAudio(uri=gcs_uri)
|
||||
config = speech.RecognitionConfig(
|
||||
|
||||
Reference in New Issue
Block a user