MarkdownTextFilter

class pipecat.utils.text.markdown_text_filter.MarkdownTextFilter(params=None, **kwargs)[source]

Bases: BaseTextFilter

Removes Markdown formatting from text in TextFrames.

Converts Markdown to plain text while preserving the overall structure, including leading and trailing spaces. Handles special cases like asterisks and table formatting.

Parameters:

params (InputParams | None)

class InputParams(*, enable_text_filter=True, filter_code=False, filter_tables=False)[source]

Bases: BaseModel

Parameters:
  • enable_text_filter (bool | None)

  • filter_code (bool | None)

  • filter_tables (bool | None)

enable_text_filter: bool | None
filter_code: bool | None
filter_tables: bool | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

async update_settings(settings)[source]
Parameters:

settings (Mapping[str, Any])

async filter(text)[source]
Parameters:

text (str)

Return type:

str

async handle_interruption()[source]
async reset_interruption()[source]
remove_tables(text)[source]

Remove tables from the input text, handling cases where both start and end tags are in the same input.

Parameters:

text (str)

Return type:

str