Skip to main content
The user runs generation with a custom adapter registry so tenants or tests stay isolated. Inject a custom adapter registry when you need tenant isolation, parallel test safety, or per-run plugin overrides.

Quick Start

1

Simple Usage

Use the process-default registry for normal applications:
2

With Configuration

Inject a custom registry for tenant isolation or testing:

How It Works

All plugin registries expose Registry.default() or get_default_registry() unless noted. When a SandboxConfig’s sandbox_type is unknown to the built-in list, SandboxManager now resolves it through praisonai.sandbox._registry automatically — no manual registry.resolve() call is needed for typical use.

Common Patterns

Multi-tenant isolation

Test isolation

AutoGenerator with custom registry

After construction, AutoGenerator retains the resolved adapter as self._adapter (mirroring AgentsGenerator.framework_adapter), and self.framework is derived from adapter.name — the authoritative name, not the raw constructor argument. This is a stable observable side effect; the underscore prefix marks it private-by-convention, so treat the attribute name itself as an implementation detail.

Injecting a tool-timeout executor

Like adapter_registry=, the tool_timeout_executor= constructor parameter lets you supply a shared thread-pool instead of letting each AgentsGenerator lazily create its own.
The injected executor is treated as borrowedgen.close() and exiting the with block will not shut it down. You stay responsible for shared_pool.shutdown().

Best Practices

Accept registries as parameters rather than calling defaults inside helpers:
Registry operations are thread-safe, but adapter instances may not be. Prefer one registry per worker or test case.
Custom registries add complexity. Reach for DI only when you need tenant overrides, test isolation, or sandboxed experimental adapters.

Framework Adapter Plugins

Extend PraisonAI with custom execution frameworks

Bot Platform Plugins

Add custom messaging platforms via entry points