feat(voice): specialize prompt for Isfahan Industrial Parks, emit source excerpts, and bound generation
- Specialize voice assistant identity and agent system prompt for «شرکت شهرکهای صنعتی اصفهان» (English instructions with Persian proper names) - Emit bounded chunk text excerpts (up to 2000 chars) and identify primary_source in realtime sources events - Bound OpenAI output generation via OPENAI_REALTIME_MAX_OUTPUT_TOKENS and add answer_limited event - Handle old-turn search cancellation safely on turn supersession - Add end-to-end search tracing pipeline and diagnostic CLI - Add database organization title and settings update script
This commit is contained in:
+4
-1
@@ -278,12 +278,15 @@ async def handle_stream_websocket(websocket, session_id, auth_service, lifecycle
|
||||
except WebSocketDisconnect:
|
||||
outcome = 'LIVE_TRANSPORT_FAILED'
|
||||
failed = True
|
||||
except Exception:
|
||||
except Exception as exc:
|
||||
if runtime and runtime.failure:
|
||||
outcome = runtime.failure
|
||||
else:
|
||||
outcome = 'LIVE_SETUP_FAILED' if runtime is None or not runtime.ready else 'LIVE_TRANSPORT_FAILED'
|
||||
failed = True
|
||||
http_status = getattr(getattr(exc, 'response', None), 'status_code', None)
|
||||
diagnostic(str(session_id), 'stream_setup' if outcome == 'LIVE_SETUP_FAILED' else 'stream_transport',
|
||||
'STREAM_EXCEPTION', exc=exc, code=outcome, http_status=http_status)
|
||||
finally:
|
||||
async def cleanup():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user