Metadata-Version: 2.5
Name: a4ui-agent
Version: 0.2.0
Summary: Agent-side A2UI chart producer for @haystackedai/a4react clients. Keep your agent (bedrock/agentcore/strands and your own biz logic are untouched); add a few lines where you already have the answer data and get a validated, drillable A2UI chart surface — richer than a hand-rolled chart. No a2ui-core wiring, catalog assembly, surface-message building or validation to write. Contract (catalogId + schemas) is baked, overridable.
Requires-Python: >=3.10
Requires-Dist: a2ui-core<0.3.0,>=0.2.0
Requires-Dist: pydantic>=2.7
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Description-Content-Type: text/markdown

# a4ui-agent

Agent-side **A2UI chart producer** for [`@haystackedai/a4react`](../A4React) clients.

This package does **not** wrap your runtime — bedrock, agentcore, strands and your own
business logic stay yours. It packages the one reusable, hard part: the A2UI **chart**
(richer than a hand-rolled one, validated against the shared catalog). You keep your agent
and add a few lines where you already build the response — mirroring how a React dev drops
in `useA4Chart` + `A4ChartView` without wrapping their server.

```python
from a4ui_agent import Chart, a2ui_frame

chart = Chart()                                   # once (baked contract)

# in your existing entrypoint, where YOUR pipeline already produced the data:
rows, columns, answer = my_pipeline(prompt)       # your biz logic, untouched
yield a2ui_frame(chart.surface(rows, columns, answer))

# the UI's chart-type toggle:
if action and action["name"] == "rechart":
    yield a2ui_frame(chart.rechart(action["context"]["plotType"]))
```

No `a2ui-core` wiring, catalog assembly, surface-message building or validation to write.
Dependencies are only `a2ui-core` + `pydantic` — nothing about your runtime. The contract
(catalogId + schemas) is baked and overridable.

See **../instruction_a4.md** (the `a4ui-agent` section) for the full DO list, the 2 insertion
points, drill/rechart handling, and the contract rules.
