def test_tesponse(): resp = Response(Id="_") resp.AddVoice("local_voice") resp.AddVoiceTTS("tts_voice") resp.AddVoiceWeb("http://web_voice") resp.AddAnimation("walk") resp.AddFace("smile") avreq = resp.AnimatedVoiceRequest assert avreq.AnimatedVoices[0].Voices[0].Name == "local_voice" assert avreq.AnimatedVoices[0].Voices[0].Source == VoiceSource.Local assert avreq.AnimatedVoices[0].Voices[1].Text == "tts_voice" assert avreq.AnimatedVoices[0].Voices[1].Source == VoiceSource.TTS assert avreq.AnimatedVoices[0].Voices[2].Url == "http://web_voice" assert avreq.AnimatedVoices[0].Voices[2].Source == VoiceSource.Web assert avreq.AnimatedVoices[0].Animations["Base Layer"][0].Name == "walk" assert avreq.AnimatedVoices[0].Faces[0].Name == "smile"
async def get_prompt_async(self, request: Request, state: State) -> Response: resp = Response(Id="_" if request is None else request.Id) resp.AddVoiceTTS("非同期サーバーからのプロンプトです。何か喋ってください。") return resp
def pre_process(self, request: Request, state: State) -> Response: return Response(Id=request.Id)
async def process_async(self, request: Request, state: State) -> Response: return Response(Id=request.Id)
async def process_async(self, request: Request, state: State) -> Response: resp = Response(Id=request.Id) resp.AddVoiceTTS(request.Text) return resp