From 2bd33a499f35db203d0f0bad86e1ff2259775484 Mon Sep 17 00:00:00 2001 From: Bryant Date: Tue, 14 Jul 2026 21:35:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20(python-sdk-docs):=20Fix=20t?= =?UTF-8?q?runcated=20Google=20ADK=20/=20Pydantic=20AI=20/=20Microsoft=20A?= =?UTF-8?q?gent=20Framework=20quickstart=20snippets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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//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 --- quickstart_snippets/google-adk.py | 12 ++++++++++++ .../microsoft-agent-framework-tool-policy.py | 13 +++++++++++++ quickstart_snippets/pydantic-ai.py | 12 ++++++++++++ 3 files changed, 37 insertions(+) diff --git a/quickstart_snippets/google-adk.py b/quickstart_snippets/google-adk.py index 1efd391b..7916986e 100644 --- a/quickstart_snippets/google-adk.py +++ b/quickstart_snippets/google-adk.py @@ -9,3 +9,15 @@ agent_id="google-adk-demo-agent", mode="sdk-only", ) as ctx: + print(f" Agent: {ctx.client.agent_id}") + print(f" Gateway: {ctx.client.gateway_url}") + print(f" Mode: {ctx.network_mode} (offline demo)") + print() + + print("Policy rules (local simulation of gateway policy):") + print(" DENY — delete_records, write_file (destructive operations)") + print(" PENDING — send_email (requires human approval)") + print(" ALLOW — everything else") + print() +finally: + ungovern_tool_class(DemoTool) diff --git a/quickstart_snippets/microsoft-agent-framework-tool-policy.py b/quickstart_snippets/microsoft-agent-framework-tool-policy.py index 6874538b..be38ed1c 100644 --- a/quickstart_snippets/microsoft-agent-framework-tool-policy.py +++ b/quickstart_snippets/microsoft-agent-framework-tool-policy.py @@ -18,3 +18,16 @@ agent_id="microsoft-agent-framework-demo-agent", mode="sdk-only", ) as ctx: + print(f" Agent: {ctx.client.agent_id}") + print(f" Gateway: {ctx.client.gateway_url}") + print(f" Mode: {ctx.network_mode} (offline demo)") + print() + + print("Policy rules (local simulation of gateway policy):") + print(" DENY — delete_records, write_file (destructive operations)") + print(" PENDING — send_email (requires human approval)") + print(" ALLOW — everything else") + print() +finally: + if adapter is not None: + adapter.unregister_hooks() diff --git a/quickstart_snippets/pydantic-ai.py b/quickstart_snippets/pydantic-ai.py index 20043aa5..859a6d36 100644 --- a/quickstart_snippets/pydantic-ai.py +++ b/quickstart_snippets/pydantic-ai.py @@ -9,3 +9,15 @@ agent_id="pydantic-ai-demo-agent", mode="sdk-only", ) as ctx: + print(f" Agent: {ctx.client.agent_id}") + print(f" Gateway: {ctx.client.gateway_url}") + print(f" Mode: {ctx.network_mode} (offline demo)") + print() + + print("Policy rules (local simulation of gateway policy):") + print(" DENY — delete_records, write_file (destructive operations)") + print(" PENDING — send_email (requires human approval)") + print(" ALLOW — everything else") + print() +finally: + adapter.unregister_hooks() From 72f53899ea29464036607ca16506e0d4a2e1b284 Mon Sep 17 00:00:00 2001 From: Bryant Date: Tue, 14 Jul 2026 21:36:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20(python-sdk-docs):=20Regener?= =?UTF-8?q?ate=20quick-start=20tabs=20from=20fixed=20snippets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- docs/quick-start.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/quick-start.md b/docs/quick-start.md index a9944c99..da34e7a9 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -211,6 +211,18 @@ with no API keys and no outbound network. agent_id="google-adk-demo-agent", mode="sdk-only", ) as ctx: + print(f" Agent: {ctx.client.agent_id}") + print(f" Gateway: {ctx.client.gateway_url}") + print(f" Mode: {ctx.network_mode} (offline demo)") + print() + + print("Policy rules (local simulation of gateway policy):") + print(" DENY — delete_records, write_file (destructive operations)") + print(" PENDING — send_email (requires human approval)") + print(" ALLOW — everything else") + print() + finally: + ungovern_tool_class(DemoTool) ``` === "Haystack" @@ -362,6 +374,19 @@ with no API keys and no outbound network. agent_id="microsoft-agent-framework-demo-agent", mode="sdk-only", ) as ctx: + print(f" Agent: {ctx.client.agent_id}") + print(f" Gateway: {ctx.client.gateway_url}") + print(f" Mode: {ctx.network_mode} (offline demo)") + print() + + print("Policy rules (local simulation of gateway policy):") + print(" DENY — delete_records, write_file (destructive operations)") + print(" PENDING — send_email (requires human approval)") + print(" ALLOW — everything else") + print() + finally: + if adapter is not None: + adapter.unregister_hooks() ``` === "OpenAI Agents SDK" @@ -396,6 +421,18 @@ with no API keys and no outbound network. agent_id="pydantic-ai-demo-agent", mode="sdk-only", ) as ctx: + print(f" Agent: {ctx.client.agent_id}") + print(f" Gateway: {ctx.client.gateway_url}") + print(f" Mode: {ctx.network_mode} (offline demo)") + print() + + print("Policy rules (local simulation of gateway policy):") + print(" DENY — delete_records, write_file (destructive operations)") + print(" PENDING — send_email (requires human approval)") + print(" ALLOW — everything else") + print() + finally: + adapter.unregister_hooks() ``` === "Semantic Kernel"