Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket Disconnects #19

Open
CodingFu opened this issue Jan 9, 2025 · 5 comments
Open

Websocket Disconnects #19

CodingFu opened this issue Jan 9, 2025 · 5 comments

Comments

@CodingFu
Copy link

CodingFu commented Jan 9, 2025

We are planning to use Conversational AI in production.

We have noticed that sometimes (1 time in 20) during the conversation, the socket closes and we see error like

Screenshot 2025-01-09 at 09 19 25

I suppose it means 1 out of 2 things:

  • your servers close websocket connection mid-conversation
  • internet connection errors
  1. is there a way to avoid or at least find out a reason for disconnection?
  2. does the library attempts reconnecting if websocket connection was broken (i read connection.ts and did not find any reconnection logic)
@simonschmalfeld
Copy link

I'm having the same error every time when I use a prompt override while initializing the conversation. If I don't use the override, it works fine.

Error code:

await conversation.startSession({
  agentId: 'YOUR_AGENT_ID',
  overrides: {
    agent: {
      prompt: {
        prompt: "You are a helpful chatbot."
      }
    }
  }
})

Working code:

await conversation.startSession({
  agentId: 'YOUR_AGENT_ID',
  // overrides: {
  //   agent: {
  //     prompt: {
  //       prompt: 'You are a helpful chatbot.'
  //     }
  //   }
  // }
})

Also, message events seem to currently not be triggered in my code (but have worked before).

@simonschmalfeld
Copy link

Update: I noticed that both my issues mentioned above only happen with the Gemini 1.5 Flash model.

@CodingFu
Copy link
Author

CodingFu commented Jan 15, 2025

I forked their code and added websocket reconnects if websocket wasn't closed properly #22

@CodingFu
Copy link
Author

@gmrchk @aarthificial @louisjoecodes @sedatcagdas @lacop11

Are you guys at 11labs hiring? I will be happy to join you as contractor part time so that my company can use 11labs conversatonal ai on production 😁

@oscar-horizonsarchitecture

@gmrchk @aarthificial @louisjoecodes @sedatcagdas @lacop11 We need this update, because this problem breaks conversations with agents in production systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants