CerebriumAI / examples

292 stars 36 forks source link

voice-agent runtime error #36

Open eddieoz opened 1 week ago

eddieoz commented 1 week ago

After sucessfully building the project, I'm getting an error when running it:

Live Replica View log:

Jun 29 08:22:29 PM
 2024-06-29 13:22:29.791 | DEBUG | pipecat.services.deepgram:run_tts:65 - Generating TTS: [Hello, I'm FastBot, how can I help you today?]
Jun 29 08:22:29 PM
 2024-06-29 13:22:29.794 | ERROR | pipecat.services.deepgram:run_tts:94 - Voice exception: Cannot connect to host 127.0.0.1:8082 ssl:default [Connection refused]

Run log

Jun 29 08:30:53 PM
WebSocketException in AsyncLiveClient.start: [Errno 111] Connection refused

I believe both errors are connected because on the code it adresses:

main.py

stt = DeepgramSTTService(
            name="STT",
            api_key=None,
            url='ws://127.0.0.1:8082/v1/listen'
)
tts = ClearableDeepgramTTSService(
            name="Voice",
            aiohttp_session=session,
            api_key=None,
            voice=deepgram_voice,
            base_url="http://127.0.0.1:8082/v1/speak"
)

How can I check if the deepgram server is running ok locally, or debugging it?

milo157 commented 5 days ago

You need to create a similar function to that which checks that the vLLM server is running. I am not too sure what this endpoint would be looking at the Deepgram docs but if they had some thing that returned "ready" that would be ideal. But maybe you can hit the listen or speak endpoint and see if the response is a 200? Not the best way I know

eddieoz commented 5 days ago

My workaround was something like this:

stt = DeepgramSTTService(
            name="STT",
            api_key='<key>',
            url='https://api.deepgram.com/v1/listen'
        )

        tts = ClearableDeepgramTTSService(
            name="Voice",
            aiohttp_session=session,
            api_key='<key>',
            voice=deepgram_voice,
            base_url="https://api.deepgram.com/v1/speak"
        )

I tried to bring the key with get_secret from my dashboard, but it was not working. Than I hardcoded the key and somehow it worked.

It is working fine by consuming on their API.

milo157 commented 5 days ago

If you are using the local Deepgram model, the API key should be set to "None".

It sounds like you are maybe calling the deepgram models while the models are still connecting and then causes it to error. If you set min replicas to 1 and then call it for the first time does it work?