even more demo cleanup, making run_llm play well with asyncio
This commit is contained in:
@@ -84,7 +84,7 @@ class AzureLLMService(LLMService):
|
||||
messages_for_log = json.dumps(messages)
|
||||
self.logger.debug(f"Generating chat via azure: {messages_for_log}")
|
||||
|
||||
response = self.get_response(messages, stream=False)
|
||||
response = await asyncio.to_thread(self.get_response, messages, False)
|
||||
if response and len(response.choices) > 0:
|
||||
return response.choices[0].message.content
|
||||
else:
|
||||
|
||||
@@ -212,11 +212,13 @@ class DailyTransportService(EventHandler):
|
||||
try:
|
||||
while not self.stop_threads.is_set():
|
||||
if self.image:
|
||||
print("rendering image")
|
||||
self.camera.write_frame(self.image)
|
||||
|
||||
time.sleep(1.0 / 8.0) # 8 fps
|
||||
time.sleep(1.0 / 24) # 24 fps
|
||||
except Exception as e:
|
||||
self.logger.error(f"Exception {e} in camera thread.")
|
||||
print("exiting run_camera thread")
|
||||
|
||||
def frame_consumer(self):
|
||||
self.logger.info("🎬 Starting frame consumer thread")
|
||||
|
||||
Reference in New Issue
Block a user