diff --git a/docs/features/thread-safety.mdx b/docs/features/thread-safety.mdx index 448242dcc..55833e284 100644 --- a/docs/features/thread-safety.mdx +++ b/docs/features/thread-safety.mdx @@ -578,15 +578,15 @@ async with BaseAutoGenerator(config_list=[{ "api_key": os.getenv("OPENAI_API_KEY"), "base_url": None, }]) as gen: - result = await gen._astructured_completion(MyModel, messages=[...]) + result = await gen._structured_completion_async(MyModel, messages=[...], is_async=True) ``` **Behaviour change in PR #1681**: the module-level functions `praisonai.auto._get_openai_client(api_key, base_url)` and the `_openai_clients` / `_openai_clients_lock` globals **have been removed**. If you imported them, switch to constructing an `OpenAI` client yourself or call `BaseAutoGenerator(...).\_get_openai_client()`. Each generator now owns exactly one client; the previous bug — an in-use client being evicted from a process-wide LRU and closed while other threads still held a reference — is no longer possible. -**Behaviour change in PR #1736**: `__del__` was removed and async support was added. New methods include `aclose`, `__aenter__`/`__aexit__`, and `_astructured_completion`. Use context managers or explicit cleanup instead of relying on destructors. +**Behaviour change in PR #1736**: `__del__` was removed and async support was added. New methods include `aclose`, `__aenter__`/`__aexit__`, and `_structured_completion_async` (originally added as `_astructured_completion`, renamed and consolidated on the live path — the shorter alias was removed as dead code in [PR #3991](https://github.com/MervinPraison/PraisonAI/pull/3991)). Use context managers or explicit cleanup instead of relying on destructors. -**Behaviour change in PR for #2963**: `BaseAutoGenerator` now owns a single `_core_client: OpenAIClient` (the core-owned client) instead of separate `_openai_client` / `_async_openai_client` attributes. The methods `_get_openai_client()` and `_get_async_openai_client()` were consolidated into `_get_core_client()`. The public surface (`close`, `aclose`, `__enter__`/`__exit__`, `__aenter__`/`__aexit__`, `_structured_completion`, `_astructured_completion`) is unchanged. If you called the previous private methods directly, switch to `_get_core_client()`. +**Behaviour change in PR for #2963**: `BaseAutoGenerator` now owns a single `_core_client: OpenAIClient` (the core-owned client) instead of separate `_openai_client` / `_async_openai_client` attributes. The methods `_get_openai_client()` and `_get_async_openai_client()` were consolidated into `_get_core_client()`. The public surface (`close`, `aclose`, `__enter__`/`__exit__`, `__aenter__`/`__aexit__`, `_structured_completion`, `_structured_completion_async`) is unchanged as of PR #2963. `_astructured_completion` was later removed as dead code in [PR #3991](https://github.com/MervinPraison/PraisonAI/pull/3991) — call `_structured_completion_async` instead. If you called the previous private methods directly, switch to `_get_core_client()`. ### Thread-safe Typer command discovery