getting started on 06-

This commit is contained in:
Moishe Lettvin
2024-01-10 13:00:36 -05:00
parent cd204ebd21
commit 7229fc806e
4 changed files with 95 additions and 9 deletions

View File

@@ -1,8 +1,8 @@
import logging
from asyncio import Queue
from abc import abstractmethod
from collections.abc import AsyncGenerator
from typing import AsyncGenerator
from dataclasses import dataclass
@@ -16,9 +16,7 @@ class AIService:
class LLMService(AIService):
# Generate a set of responses to a prompt. Yields a list of responses.
@abstractmethod
async def run_llm_async(
self, messages
) -> AsyncGenerator[str, None]:
async def run_llm_async(self, messages) -> AsyncGenerator[str, None]:
pass
# Generate a responses to a prompt. Returns the response

View File

@@ -222,13 +222,13 @@ class DailyTransportService(EventHandler):
pass
def on_transcription_stopped(self, stopped_by, stopped_by_error):
self.logger.info(f"Transcription stopped {stopped_by}, {stopped_by_error}")
pass
def on_transcription_error(self, message):
self.logger.error(f"Transcription error {message}")
pass
def on_transcription_started(self, status):
self.logger.info(f"Transcription started {status}")
pass
def set_image(self, image: bytes):
self.image: bytes | None = image

View File

@@ -20,7 +20,6 @@ class GoogleAIService(AIService):
)
def run_tts(self, sentence):
print("running google tts")
synthesis_input = texttospeech.SynthesisInput(text = sentence.strip())
result = self.client.synthesize_speech(input=synthesis_input, voice=self.voice, audio_config=self.audio_config)
return result