Summary
PraisonAI PR #3991 (merged 2026-08-16, closes #3990) removed the dead private method BaseAutoGenerator._astructured_completion from src/praisonai/praisonai/auto.py. The method had zero call sites in the SDK — but docs/features/thread-safety.mdx still teaches users to call it directly in a copy-paste code example, and mentions it in two behaviour-change notes. The code example will now raise AttributeError on any current install.
This is a small, well-scoped fix — one file, three edits.
Upstream source of truth:
Edits required — all in docs/features/thread-safety.mdx
Edit 1 · Fix the broken async code example
Current (broken — method no longer exists):
# Async context manager
async with BaseAutoGenerator(config_list=[{
"model": "gpt-4o-mini",
"api_key": os.getenv("OPENAI_API_KEY"),
"base_url": None,
}]) as gen:
result = await gen._astructured_completion(MyModel, messages=[...])
Replace the last line with the live async path (verified against src/praisonai/praisonai/auto.py:718-732 on main):
result = await gen._structured_completion_async(MyModel, messages=[...], is_async=True)
_structured_completion_async(..., is_async=True) is what _astructured_completion internally delegated to. Issue #3990 explicitly states its behaviour is "fully covered by _structured_completion_async(is_async=True)".
Edit 2 · Remove the stale reference in the PR #1736 warning
Current:
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.
Update to:
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). Use context managers or explicit cleanup instead of relying on destructors.
Edit 3 · Remove the stale reference in the PR #2963 warning
Current:
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.
Update to (drop the stale name from the surface list; keep the sentence's meaning intact):
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 — call _structured_completion_async instead.
Why this matters
docs/features/thread-safety.mdx is a "power user" page, and the example lives under the deliberate heading "For power users building generators directly". Any user who copies it will hit AttributeError: 'BaseAutoGenerator' object has no attribute '_astructured_completion' on the very next release.
- The two behaviour-change notes are documentation of intent — leaving a removed symbol in the "new methods" and "public surface" lists misleads maintainers about what the API actually is today.
- Both fixes are additive text-only edits in a single existing page; no new page, no
docs.json change, no diagram rework.
Placement checklist (per repo AGENTS.md)
Out of scope
Filed by the docs-triage scheduled routine on 2026-08-16, triggered by the pull_request.closed webhook for PraisonAI PR #3991. Verified against upstream diff at head SHA 33d8aaf5cb7c605a09e0013c7f2020e947303257.
Summary
PraisonAI PR #3991 (merged 2026-08-16, closes #3990) removed the dead private method
BaseAutoGenerator._astructured_completionfromsrc/praisonai/praisonai/auto.py. The method had zero call sites in the SDK — butdocs/features/thread-safety.mdxstill teaches users to call it directly in a copy-paste code example, and mentions it in two behaviour-change notes. The code example will now raiseAttributeErroron any current install.This is a small, well-scoped fix — one file, three edits.
Upstream source of truth:
_astructured_completionin wrapperauto.py(unreferenced duplicate of async completion path) PraisonAI#399033d8aaf5cb7c605a09e0013c7f2020e947303257src/praisonai/praisonai/auto.py:697-716removed (verified against the PR diff)Edits required — all in
docs/features/thread-safety.mdxEdit 1 · Fix the broken async code example
Current (broken — method no longer exists):
Replace the last line with the live async path (verified against
src/praisonai/praisonai/auto.py:718-732onmain):_structured_completion_async(..., is_async=True)is what_astructured_completioninternally delegated to. Issue #3990 explicitly states its behaviour is "fully covered by_structured_completion_async(is_async=True)".Edit 2 · Remove the stale reference in the PR #1736 warning
Current:
Update to:
Edit 3 · Remove the stale reference in the PR #2963 warning
Current:
Update to (drop the stale name from the surface list; keep the sentence's meaning intact):
Why this matters
docs/features/thread-safety.mdxis a "power user" page, and the example lives under the deliberate heading "For power users building generators directly". Any user who copies it will hitAttributeError: 'BaseAutoGenerator' object has no attribute '_astructured_completion'on the very next release.docs.jsonchange, no diagram rework.Placement checklist (per repo AGENTS.md)
docs/features/thread-safety.mdx— do not migrate the page or split it.docs/concepts/(human-approved only).docs/sdk/reference/**— those regenerate from source.src/praisonai/praisonai/auto.pyat head SHA33d8aaf5cb7c605a09e0013c7f2020e947303257before pushing.Out of scope
_get_core_client()guidance remain correct after PR #3991._astructured_completionneeds updating.Filed by the docs-triage scheduled routine on 2026-08-16, triggered by the
pull_request.closedwebhook for PraisonAI PR #3991. Verified against upstream diff at head SHA33d8aaf5cb7c605a09e0013c7f2020e947303257.