Skip to content

AgentMarkdown

Sub classes

Name Children Inherits
StreamingMarkdown
acptui.ui.widgets.blocks
Markdown that streams appended text, starting only after its initial content is shown.

    Base classes

    Name Children Inherits
    Markdown
    textual.widgets._markdown

    ⋔ Inheritance diagram

    graph TD
      316396534["markdown.AgentMarkdown"]
      2840140467["_markdown.Markdown"]
      4188532303["widget.Widget"]
      3946681048["dom.DOMNode"]
      53685856["message_pump.MessagePump"]
      2751680898["builtins.object"]
      2840140467 --> 316396534
      4188532303 --> 2840140467
      3946681048 --> 4188532303
      53685856 --> 3946681048
      2751680898 --> 53685856

    🛈 DocStrings

    Bases: Markdown

    Markdown written by the agent.

    Raw HTML is shown literally; links are not opened here: the click bubbles up as :class:~textual.widgets.Markdown.LinkClicked to the app, which shows the target and asks before handing anything but http(s) to the system.

    Source code in src/acptui/ui/markdown.py
    class AgentMarkdown(Markdown):
        """Markdown written by the agent.
    
        Raw HTML is shown literally; links are not opened here: the click bubbles up as
        :class:`~textual.widgets.Markdown.LinkClicked` to the app, which shows the target
        and asks before handing anything but ``http(s)`` to the system.
        """
    
        def __init__(
            self,
            markdown: str = "",
            *,
            id: str | None = None,  # noqa: A002 - Textual's name
            classes: str | None = None,
        ) -> None:
            super().__init__(
                markdown, id=id, classes=classes, parser_factory=agent_parser, open_links=False
            )
    

    :fa-brands-github: Show source on GitHub