from src.services.speechtotext import SpeechToText from src.services.texttotext import ConversationHandler from src.services.texttospeech import TextToSpeech from elevenlabs import play class Pipeline: def __init__(self): self.speech_to_text = SpeechToText() self.text_to_text=ConversationHandler() self.text_to_speech=TextToSpeech() def speech_to_text_(self): transcribed_text = self.speech_to_text.record_and_transcribe() return transcribed_text async def text_to_text_(self): response=await self.text_to_text.give_response(self.speech_to_text_()) return response async def text_to_speech_(self): response=await self.text_to_speech.synthesize(self.text_to_text_()) return response if __name__ == "__main__": import asyncio async def main(): p=Pipeline() op=await p.text_to_text_() print(op) asyncio.run(main())