Skip to content

API Reference parrot.outputs.formats.infographic

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.outputs.formats.infographic

View source

Infographic Renderer for AI-Parrot.

Renders InfographicResponse structured output as JSON suitable for frontend consumption. The renderer validates the block structure and serializes it; the frontend handles all visual rendering.

Alias BaseRenderer

Re-exported from parrot.outputs.formats.base.BaseRenderer.

Attribute INFOGRAPHIC_SYSTEM_PROMPT

Class InfographicRenderer

Renderer for structured infographic output.

Validates and serializes InfographicResponse blocks as JSON. The frontend is responsible for visual rendering.

Method InfographicRenderer.render

Render infographic response as structured JSON.

render(response: Any, environment: str = 'default', **kwargs) -> Tuple[str, Optional[Any]]

Parameter Type Default Description
response Any AIMessage containing InfographicResponse data.
environment str 'default' Output environment ('default', 'html', 'terminal').
**kwargs {} Additional rendering options.

Returns: Tuple[str, Optional[Any]] — Tuple[str, Any]: (json_string, wrapped_content)

Alias InfographicResponse

Re-exported from parrot.models.infographic.InfographicResponse.

Alias OutputMode

Re-exported from parrot.models.outputs.OutputMode.

Function extract_infographic_data

Extract infographic data from the AIMessage response.

Module-level extraction shared by both infographic renderers.

Handles multiple scenarios:

  1. response.structured_output is an InfographicResponse
  2. response.output is an InfographicResponse
  3. response.output is a dict with blocks
  4. Raw dict/string fallback

extract_infographic_data(response: Any) -> dict

Parameter Type Default Description
response Any The AIMessage or raw data.

Returns: dict — Dict representation of the InfographicResponse.

Alias register_renderer

Re-exported from parrot.outputs.formats.register_renderer.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally