Skip to content

Remove dangling code blocks from prefix

What does this merge request do and why?

This MR adds a remove_incomplete_block function that removes any dangling code blocks from the start of the truncated prefix, as long as this wouldn't remove too much of the original text (_MAX_CODE_BLOCK_TRIM_PERCENT).

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.

Closes #281 (closed)

Edited by Andras Herczeg

Merge request reports