#Client tool thread safe
1 messages · Page 1 of 1 (latest)
Certainly.
I tried to run a web scraper through client tool, and it led to WebSocket disconnection, error 1008 policy violation. I troubleshooted quite a bit and it seems the root issue is operations like web scraping (or perhaps other operations that takes long time to run) , when running in the same event loop as the web socket, it caused connection to time out. web socket expects specific message format, and is quite picky in terms of disruption/timeout, etc.
Yeah but you can just run it on a different event loop in executor
So your main websocket is still answering and responding to our pings
like this: client_tools.register("make_reservation", create_reservation_handler, is_async=True) ? Tried, didn't work as expected. anyway, webhook works all right.
I see. you mean something like this? i will give it a try. thanks!
loop = asyncio.get_event_loop()
loop.run_in_executor ...
yes exactly
Can you please check conversation lcj5DW9trl84GdA3eoBv? I keep receiving: Error sending user audio chunk: received 1008 (policy violation).
Already ran the scraper on a different loop.
Can you please check the error for the above conversation? Thanks!
figured out. i returned client tool in the format that 11labs websocket doesn't expect.
thank you!