Skip to content

API Reference parrot.outputs.formats.text

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

parrot.outputs.formats.text

View source

Plain-text output renderer (OutputMode.TEXT).

Markdown-free conversational text for surfaces that render message text literally — most notably Microsoft Copilot consuming a Parrot agent over the A2A protocol, where markdown in an A2A TextPart shows up as raw **bold** and | pipe | tables.

Two levers fire from this single mode:

  • PLAIN_TEXT_SYSTEM_PROMPT is injected into the system prompt (formatter.get_system_prompt()) so the LLM is asked to answer in plain text in the first place.
  • :class:PlainTextRenderer post-processes the response through :func:markdown_to_plain, deterministically flattening any markdown the model (or a tool) still emitted.

Alias BaseRenderer

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

Alias OutputMode

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

Attribute PLAIN_TEXT_SYSTEM_PROMPT

Class PlainTextRenderer

Renderer for plain-text output — strips markdown from the reply.

Method PlainTextRenderer.render

Render response as markdown-free plain text.

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

Parameter Type Default Description
response Any
environment str 'default'
**kwargs {}

Returns: Tuple[str, Any]

Function markdown_to_plain

Deterministically convert markdown to readable plain text.

Handles fenced/inline code (content kept), bold/italic/strikethrough, ATX headings, blockquotes, horizontal rules, links/images (text (url)), bullet markers, and pipe tables (flattened to Label: value lines). Never raises — on any error the original text is returned unchanged.

markdown_to_plain(text: str) -> str

Parameter Type Default Description
text str Markdown (or mixed) text.

Returns: str — A plain-text rendering of text.

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