mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-07 22:33:57 -05:00
Currently, an import statement like `from backend.blocks.basic import AgentInputBlock` will initialize `backend.blocks` and thereby load all other blocks. This has quite high potential to cause circular import issues, and it's bad for performance in cases where we don't want to load all blocks (yet). The same goes for `backend.integrations.webhooks`. ### Changes 🏗️ - Change `__init__.py` of `backend.blocks` and `backend.integrations.webhooks` to cached loader functions rather than init-time code - Change type of `BlockWebhookConfig.provider` to `ProviderName` <!-- test edit to check that this doesn't break anything --> ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Set up and use an agent with a webhook-triggered block --------- Co-authored-by: Zamil Majdy <zamil.majdy@agpt.co>