From 2edefca509aa171ba7b59c1330a8fa31d16d53bd Mon Sep 17 00:00:00 2001 From: Emmett McFaralne Date: Fri, 19 Apr 2024 23:44:16 -0400 Subject: [PATCH] improved templating for extracted text --- setup.py | 2 +- thepipe_api/thepipe.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 84e99c0..b110cd6 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='thepipe_api', - version='0.2.7', + version='0.2.8', author='Emmett McFarlane', author_email='emmett@thepi.pe', description='Automate information extraction for multimodal LLMs.', diff --git a/thepipe_api/thepipe.py b/thepipe_api/thepipe.py index 28703e5..5c0ebf3 100644 --- a/thepipe_api/thepipe.py +++ b/thepipe_api/thepipe.py @@ -14,8 +14,10 @@ def save_outputs(chunks: List[Chunk], verbose: bool = False, text_only: bool = F for i, chunk in enumerate(chunks): if chunk is None: continue + if chunk.path is not None: + text += f'{chunk.path}:\n' if chunk.text is not None: - text += chunk.text + text += f'```\n{chunk.text}```\n\n' if (chunk.image is not None) and (not text_only): if chunk.path is None: clean_path = f"image"