This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

character / scripts / verify-live-response.ts
1.3 kB 36 lines
1import { GeminiLiveProvider } from '../src/gemini-live'; 2import { OBSControlClient } from '../src/obs-control'; 3import { OpenVTControlClient } from '../src/openvt-control'; 4import { CharacterRuntime } from '../src/runtime'; 5 6const runtime = new CharacterRuntime(new GeminiLiveProvider()); 7const openvt = new OpenVTControlClient(); 8const obs = new OBSControlClient({ 9 sceneName: process.env.OBS_SCENE_NAME ?? 'Scene', 10 textInputName: process.env.OBS_TEXT_INPUT_NAME ?? 'Agent Reply', 11}); 12 13const message = { 14 author: process.env.TEST_CHAT_AUTHOR ?? 'streamplace-viewer', 15 text: process.env.TEST_CHAT_TEXT ?? 'hey haru what do you think about stream.place?', 16 timestamp: new Date().toISOString(), 17}; 18 19console.log(JSON.stringify({ phase: 'input', message }, null, 2)); 20 21await openvt.sendTalkState('start'); 22await openvt.sendEmotion('curious'); 23 24const result = await runtime.handleMessage(message); 25console.log(JSON.stringify({ phase: 'output', result }, null, 2)); 26 27await openvt.sendText(result.reply); 28await obs.setText(result.reply); 29await obs.setProgramScene(); 30await openvt.sendResponse({ 31 ...result, 32 actions: result.actions.filter((action) => action.type !== 'talk:start'), 33}); 34 35console.log(JSON.stringify({ phase: 'delivered' }, null, 2)); 36