RemiFabre commited on
Commit
697c679
·
1 Parent(s): 599891c

Disable idle signal to prevent unwanted emotion calls

Browse files
src/feeling_machine/openai_realtime.py CHANGED
@@ -521,16 +521,15 @@ class OpenaiRealtimeHandler(AsyncStreamHandler):
521
  # sends to the stream the stuff put in the output queue by the openai event handler
522
  # This is called periodically by the fastrtc Stream
523
 
524
- # Handle idle
525
- idle_duration = asyncio.get_event_loop().time() - self.last_activity_time
526
- if idle_duration > 15.0 and self.deps.movement_manager.is_idle():
527
- try:
528
- await self.send_idle_signal(idle_duration)
529
- except Exception as e:
530
- logger.warning("Idle signal skipped (connection closed?): %s", e)
531
- return None
532
-
533
- self.last_activity_time = asyncio.get_event_loop().time() # avoid repeated resets
534
 
535
  return await wait_for_item(self.output_queue) # type: ignore[no-any-return]
536
 
 
521
  # sends to the stream the stuff put in the output queue by the openai event handler
522
  # This is called periodically by the fastrtc Stream
523
 
524
+ # Idle signal disabled - was causing unwanted emotion calls
525
+ # idle_duration = asyncio.get_event_loop().time() - self.last_activity_time
526
+ # if idle_duration > 15.0 and self.deps.movement_manager.is_idle():
527
+ # try:
528
+ # await self.send_idle_signal(idle_duration)
529
+ # except Exception as e:
530
+ # logger.warning("Idle signal skipped (connection closed?): %s", e)
531
+ # return None
532
+ # self.last_activity_time = asyncio.get_event_loop().time()
 
533
 
534
  return await wait_for_item(self.output_queue) # type: ignore[no-any-return]
535