Chainlit / cookbook

Chainlit's cookbook repo
https://github.com/Chainlit/chainlit
760 stars 278 forks source link

chainlit realtime-assistant not working in local : observing panics #148

Open adhil-tinvio opened 1 week ago

adhil-tinvio commented 1 week ago

Was trying out chainlit realtime-assistant in local could see these errors like below audio recording. how can i fix this to test things out in local.

Log Trace:


  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/tasks.py", line 314, in __step_run_and_handle_result
    result = coro.send(None)
             ^^^^^^^^^^^^^^^
  File "/Users/adhile/cookbook/realtime-assistant/realtime/__init__.py", line 109, in _receive_messages
    self.dispatch(f"server.{event['type']}", event)
  File "/Users/adhile/cookbook/realtime-assistant/realtime/__init__.py", line 66, in dispatch
    handler(event)
  File "/Users/adhile/cookbook/realtime-assistant/realtime/__init__.py", line 434, in _on_speech_stopped
    self._process_event(event, self.input_audio_buffer)
  File "/Users/adhile/cookbook/realtime-assistant/realtime/__init__.py", line 424, in _process_event
    item, delta = self.conversation.process_event(event, *args)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adhile/cookbook/realtime-assistant/realtime/__init__.py", line 176, in process_event
    return event_processor(self, event, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adhile/cookbook/realtime-assistant/realtime/__init__.py", line 146, in <lambda>
    'input_audio_buffer.speech_stopped': lambda self, event, input_audio_buffer: self._process_speech_stopped(event, input_audio_buffer),
                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adhile/cookbook/realtime-assistant/realtime/__init__.py", line 268, in _process_speech_stopped
    speech = self.queued_speech_items[item_id]
             ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'item_AG19J1QC1KjVkIBVgWiOL'```
willydouhard commented 1 week ago

is it happening randomly or are you able to reproduce?

adhil-tinvio commented 1 week ago

@willydouhard it is happening everytime. i was trying to spawn this locally and see how it works to adap to our tool i can record audio and when i complete recording it just stays same. i can see these logs in my terminal

adhil-tinvio commented 1 week ago

FYI,i am just cloning this repo and testing out in my local. that should be working?

willydouhard commented 1 week ago

@willydouhard it is happening everytime. i was trying to spawn this locally and see how it works to adap to our tool i can record audio and when i complete recording it just stays same. i can see these logs in my terminal

Are you running the cookbook as is or modified?

willydouhard commented 1 week ago

FYI,i am just cloning this repo and testing out in my local. that should be working?

it should