Files
Alem Tuzlak c91a9c9aff fix(showcase/langgraph-python): A2UI fixed-schema loop + propagate rename to shared tools and aimock
Two follow-up fixes layered on the previous internal-tool rename:

(1) `a2ui_fixed.py` — fixed-schema demo infinite loop on deploy. The
`display_flight` tool returns the raw `a2ui.render(...)` JSON descriptor
as its tool result. gpt-4o-mini reads that opaque blob, can't tell the
flight was rendered, and re-calls `display_flight` indefinitely (visible
on the deployed showcase as 6+ duplicate flight cards stacked under
repeated assistant text). Local was just lucky.

Hardened the docstring + system prompt to spell out: the JSON return
value is the surface descriptor, the card is already rendered, do NOT
call again, reply with one short confirmation and stop.

(2) Rename `render_a2ui` → `_design_a2ui_surface` in shared and
langgraph-python parity copies of `tools/generate_a2ui.py` (+
`tools/__init__.py` re-export `RENDER_A2UI_TOOL_SCHEMA` →
`DESIGN_A2UI_SURFACE_TOOL_SCHEMA`), and in `showcase/shared/typescript/
tools/generate-a2ui.ts`. These shared helpers were the source-of-truth
for the secondary-LLM tool name across integrations; renaming here keeps
parity with the langgraph-python agents already renamed in
`beautiful_chat.py` / `a2ui_dynamic.py`. Other framework integrations
keep their own `render_a2ui` for now (separate parity sweep).

(3) `showcase/aimock/feature-parity.json` — added a sibling fixture
matching `toolName: "_design_a2ui_surface"` for the beautiful-chat Sales
Dashboard pill so the langgraph-python e2e suite still hits a
deterministic mock on Railway. The original `render_a2ui` fixture is
kept above it so other integrations whose secondary LLM still requests
`render_a2ui` continue to match.

(4) Comment update in `beautiful-chat.spec.ts` to name the new internal
tool.
2026-05-08 18:49:53 +02:00

47 lines
1.1 KiB
Python

"""Barrel exports for all shared showcase tool implementations."""
from .types import (
SalesStage,
SalesTodo,
Flight,
WeatherResult,
)
from .get_weather import get_weather_impl
from .query_data import query_data_impl
from .sales_todos import (
INITIAL_TODOS,
manage_sales_todos_impl,
get_sales_todos_impl,
)
from .search_flights import search_flights_impl
from .generate_a2ui import (
DESIGN_A2UI_SURFACE_TOOL_SCHEMA,
generate_a2ui_impl,
build_a2ui_operations_from_tool_call,
)
from .schedule_meeting import schedule_meeting_impl
__all__ = [
# Types
"SalesStage",
"SalesTodo",
"Flight",
"WeatherResult",
# Weather
"get_weather_impl",
# Query data
"query_data_impl",
# Sales todos
"INITIAL_TODOS",
"manage_sales_todos_impl",
"get_sales_todos_impl",
# Flight search (fixed-schema A2UI)
"search_flights_impl",
# Dynamic A2UI
"DESIGN_A2UI_SURFACE_TOOL_SCHEMA",
"generate_a2ui_impl",
"build_a2ui_operations_from_tool_call",
# Schedule meeting (HITL)
"schedule_meeting_impl",
]