https://github.com/zulip/python-zulip-api/tree/main/zulip/in... has a few bridges similar to what you're building that may be helpful references; the Zephyr one is the most sophisticated and the Matrix one is about to be rewritten (https://github.com/zulip/python-zulip-api/pull/765), so those may be useful resources.
https://todo.sr.ht/~nicoco/slidge/46
https://github.com/zulip/python-zulip-api/tree/main/zulip/in... has a few bridges similar to what you're building that may be helpful references; the Zephyr one is the most sophisticated and the Matrix one is about to be rewritten (https://github.com/zulip/python-zulip-api/pull/765), so those may be useful resources.