Skip to content

[AAASM-4590] 📝 (python-sdk-docs): Add missing imports + version-compat notes to quick-start tabs#254

Merged
Chisanan232 merged 6 commits into
masterfrom
v0.1.0/AAASM-4590/fix/quickstart_missing_imports
Jul 14, 2026
Merged

[AAASM-4590] 📝 (python-sdk-docs): Add missing imports + version-compat notes to quick-start tabs#254
Chisanan232 merged 6 commits into
masterfrom
v0.1.0/AAASM-4590/fix/quickstart_missing_imports

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

Description

Quick-start §3's 16 framework tabs never showed the SDK's import statement — every vendored quickstart_snippets/*.py had zero import/from lines, so a reader copy-pasting a tab got an immediate NameError. This PR:

  1. Adds the real import line(s) to all 16 vendored snippets, sourced verbatim from the matching ai-agent-assembly/examples source (python/<example>/src/main.py, origin/master), limited to the lines actually needed by each excerpt's body. docs/quick-start.md is regenerated via scripts/generate_quickstart_tabs.py — no hand-edits to the generated region.
  2. Adds a !!! note "Version compatibility" admonition beneath 8 of the 16 tabs (LangChain, LangChain (Research Agent), LangGraph, LlamaIndex, AutoGen, Haystack, Agno, smolagents) for frameworks with a real, citable import-path break in their own version history. The remaining 8 got no note — no verifiable break was found for them (Custom has no framework to break; CrewAI/Google ADK/Microsoft Agent Framework/OpenAI Agents SDK/Pydantic AI/Semantic Kernel/Strands Agents either had no evidence of a genuine import-path break or the evidence found was too narrow/unofficial to cite confidently).
  3. Extends scripts/generate_quickstart_tabs.py to support an optional version_compat_note field per manifest entry (a local, python-sdk-only addition — not part of the upstream examples manifest), so the notes stay 100% generator-driven.

Stacked on #253 (AAASM-4585) — this branch is based on that branch's tip since 3 of the 4 currently-truncated with ... as ctx: snippet bodies (Google ADK, Pydantic AI, Microsoft Agent Framework) live there, and this ticket's AC requires a clean ast.parse pass across all 16 files. Please merge #253 first.

Version-compat note sources (cited per framework)

Framework Break Source
LangChain / LangChain (Research Agent) langchain.agents/.chainslangchain_core/langchain_community/langchain_classic (0.1 → 0.3 → 1.0) LangChain v1 migration guide, v0.3 announcement; also verified in AAASM-4451
LangGraph langgraph.prebuilt.create_react_agentlangchain.agents.create_agent (1.0) LangGraph v1 migration guide
LlamaIndex monolithic llama_indexllama-index-core + per-provider packages (v0.10, Feb 2024) LlamaIndex v0.10 migration guide
AutoGen pyautogen/autogen.agentchatautogen-agentchat/autogen-core/autogen-ext (v0.2 → v0.4) AutoGen official migration guide
Haystack farm-haystackhaystack-ai, node imports flattened into haystack.components.* (1.x → 2.0) Haystack official migration guide
Agno phi.*agno.* (Phidata rename) Agno's official Phidata → Agno migration guide
smolagents HfApiModelInferenceClientModel (v1.14.0, Apr 2025; back-compat restored v1.24.0) smolagents releases

Known gap (tracked separately, not fixed here)

quickstart_snippets/smolagents-tool-policy.py has the same dangling-with-no-body truncation as the 3 files AAASM-4585 fixes, but was not in that ticket's scope. Filed as AAASM-4592 rather than fixed inline here, since this ticket's scope is imports-only and its AC states "no other content in these files changes." As a result, ast.parse succeeds on 15 of 16 updated files — smolagents-tool-policy.py still fails until AAASM-4592 lands (the import line added here is still correct; the pre-existing truncated body is the only blocker).

Type of Change

  • 📚 Documentation update

Breaking Changes

  • No

Related Issues

Testing

  • Manual testing performed — ast.parse on all 16 snippet files (15/16 pass; see "Known gap" above), python3 scripts/generate_quickstart_tabs.py --check (zero drift), mkdocs build --strict (clean), Playwright: clicked through Agno/LangChain/LlamaIndex/Google ADK tabs and confirmed the imports render and the two "Version compatibility" admonitions render as real styled callouts (screenshots taken locally).
  • No tests required (explain why) — docs-only change; this repo's CI pull_request.paths allow-list excludes docs/** and quickstart_snippets/** is not covered by unit tests (verified via python scripts/generate_quickstart_tabs.py --check instead).

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated if needed
  • All tests passing

…ft Agent Framework quickstart snippets

The 3 vendored snippets were truncated at `) as ctx:` with no `with`
body, making them syntactically invalid Python. Re-vendor each from its
upstream examples/python/<framework>/src/main.py so the `with` block has
a real body (the standard Agent/Gateway/Mode print block + policy rules)
and the try/finally each already opens is properly closed, matching the
adapter-cleanup pattern the real examples use.

Refs AAASM-4585
Byproduct of the vendored-snippet fix in the previous commit: running
scripts/generate_quickstart_tabs.py picks up the completed with-blocks
for Google ADK, Pydantic AI, and Microsoft Agent Framework so the
rendered doc no longer ends the tab mid-statement.

Refs AAASM-4585
Every vendored quickstart_snippets/*.py had zero import lines, so the
quick-start page's per-framework tabs never showed what to import,
leaving a copy-pasting reader with a NameError on init_assembly and
every framework-specific call. Import lines are sourced verbatim from
the matching ai-agent-assembly/examples source (origin/master), limited
to the lines actually needed by each excerpt's body.

Refs AAASM-4590
quickstart_snippets/manifest.json can now carry an optional
version_compat_note field per framework entry; render_tab() renders it
as a nested "Version compatibility" admonition beneath that
framework's code fence. Needed so AAASM-4590's compat notes stay
generator-driven (never a hand-edit of the generated region) for
frameworks with a real, citable import-path break in their version
history.

Refs AAASM-4590
…orks

Adds a "Version compatibility" admonition to the LangChain, LangChain
(Research Agent), LangGraph, LlamaIndex, AutoGen, Haystack, Agno, and
smolagents quick-start tabs — each backed by a real, citable official
migration guide, changelog, or release entry for a genuine import-path
break in that framework's version history (full sources in the PR
description). The remaining 8 frameworks got no note: no verifiable
break was found for them, and a wrong "helpful" note is worse than
none (per ticket AC).

docs/quick-start.md is regenerated output only — no hand-edits to the
generated region.

Refs AAASM-4590
Comment thread quickstart_snippets/autogen-tool-policy.py Fixed
Comment thread quickstart_snippets/crewai-research-crew.py Fixed
Comment thread quickstart_snippets/google-adk.py Fixed
Comment thread quickstart_snippets/langchain-research-agent.py Fixed
Comment thread quickstart_snippets/semantic-kernel-tool-policy.py Fixed
Comment thread quickstart_snippets/semantic-kernel-tool-policy.py Fixed
Comment thread quickstart_snippets/strands-agents-tool-policy.py Fixed
…tart snippets

governed_run, MOCK_TRAJECTORY, build_tools, NETWORK_ALLOWLIST,
governed_invoke, and PLUGIN_NAME were each imported but never referenced
by their shown excerpt body. Matches this ticket's own AC: only include
import lines actually used by the shown body.
@Chisanan232 Chisanan232 merged commit 7d3b0aa into master Jul 14, 2026
8 checks passed
@Chisanan232 Chisanan232 deleted the v0.1.0/AAASM-4590/fix/quickstart_missing_imports branch July 14, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant