fix(gateway): constrain verified Qwen replies to emotion schema
This commit is contained in:
@@ -37,6 +37,8 @@ async def probe():
|
||||
if event['type']=='hello': break
|
||||
summary['face_context_supported']=event.get('context_face_cue_version')
|
||||
summary['reply_emotion_supported']=event.get('reply_emotion_version')
|
||||
summary['llm_structured_output']=event.get('llm_structured_output')
|
||||
assert summary['llm_structured_output']=='json_schema', 'live schema mode missing'
|
||||
assert summary['reply_emotion_supported']==1
|
||||
if after: assert summary['face_context_supported']==1, 'face protocol not advertised'
|
||||
await ws.send(json.dumps({'type':'listen','mode':'manual','state':'start','barge_in':False}))
|
||||
@@ -98,7 +100,7 @@ async def probe():
|
||||
if kind=='voice.metrics': summary['tts_requests']=event.get('tts_request_count')
|
||||
if kind=='metrics':
|
||||
values=event.get('values',{})
|
||||
summary['backend_metrics']={key:values.get(key) for key in ('stt_ms','llm_first_token_ms','llm_first_body_ms','structured_wait_ms','reply_parse_ms','llm_finished_ms','tts_first_pcm_ms','capture_to_first_pcm_ms','total_ms','tts_request_count','face_cue_used','reply_emotion_reason','reply_parse_branch','reply_emotion','reply_intensity','llm_finish_reason','llm_usage','llm_max_tokens')}
|
||||
summary['backend_metrics']={key:values.get(key) for key in ('stt_ms','llm_first_token_ms','llm_first_body_ms','structured_wait_ms','reply_parse_ms','llm_finished_ms','tts_first_pcm_ms','capture_to_first_pcm_ms','total_ms','tts_request_count','face_cue_used','reply_emotion_reason','reply_parse_branch','reply_emotion','reply_intensity','llm_finish_reason','llm_usage','llm_max_tokens','llm_structured_output')}
|
||||
summary['segments']=[{key:s.get(key) for key in ('audio_seconds','total_ms','rtf','max_chunk_interarrival_ms')} for s in values.get('tts_segments',[])]
|
||||
if kind=='error': raise RuntimeError('gateway_backend_error')
|
||||
if kind=='tts' and event.get('state')=='stop':
|
||||
@@ -117,6 +119,7 @@ async def probe():
|
||||
while json.loads(await asyncio.wait_for(ws.recv(),5)).get('type')!='pong': pass
|
||||
summary['invalid_face_control_survived']=True
|
||||
assert summary['emotion_count']==1 and summary.get('tts_input_matches_body') and summary.get('tts_requests')==1
|
||||
assert summary['structured_model_output'], 'live structured reply fell back'
|
||||
assert summary['pcm_peak']>327, 'no voiced PCM amplitude'
|
||||
summary['pcm_rms']=round(math.sqrt(summary.pop('pcm_square')/(summary['downlink_bytes']//2)),2)
|
||||
summary['status']='passed'
|
||||
|
||||
Reference in New Issue
Block a user