Add voice control mode, OmniVoice worker and managed voice studios

This commit is contained in:
Mikei386 committed 2026-10-04 21:14:49 +02:00
1 parent 260740994f
commit 5fa8e6de90
33 files changed
+411 -64

No files matched your search

+13
View File
@@ -61,6 +61,19 @@ class EndpointTests(unittest.TestCase):
def request(self,path='/v1/models',data=None,token='A'*32):
conn=http.client.HTTPConnection('127.0.0.1',self.port,timeout=5);headers={'Content-Type':'application/json','Authorization':'Bearer '+token}
conn.request('POST' if data is not None else 'GET',path,body=json.dumps(data) if data is not None else None,headers=headers);r=conn.getresponse();body=r.read();conn.close();return r.status,(body if data and data.get('stream') else json.loads(body))
def test_voice_profiles_are_exclusive_and_mode_rejects_other_work(self):
for ident in ('vox','omni'):
self.rows.append(dict(id=ident,name=ident,kind='voice',revision=1,updated_at=1,runnable=True,blockers=[],parameters={}))
self.enable('vox');self.enable('omni')
self.assertEqual([p['id'] for p in self.ep.rows() if p['kind']=='voice' and p['enabled']],['omni'])
self.ep.scheduler.gpu_mode='voice'
code,result=self.request('/v1/audio/speech/models');self.assertEqual(code,200)
self.assertEqual([p['id'] for p in result['data']],['omni'])
for path in ('/v1/chat/completions','/v1/images/generations','/v1/audio/music'):
code,result=self.request(path,{});self.assertEqual(code,503);self.assertEqual(result['error']['code'],'voice_mode_active')
release=self.ep.scheduler.image_reservation(kind='voice');release()
with self.assertRaises(InferenceError):self.ep.scheduler.image_reservation(kind='image')
def test_api_identity_and_legacy_name_share_profile(self):
self.rows[0].update(name='Qwen Medium',api_id='qwen-medium',api_aliases=['Old Name'])
self.enable('alpha')