Skip to content

Commit

Permalink
fixed output prompt format
Browse files Browse the repository at this point in the history
  • Loading branch information
emcf committed Apr 19, 2024
1 parent 3fdda82 commit 5d95089
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions thepipe_api/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def extract_from_file(file_path: str, source_type: str, verbose: bool = False, a
if 'error' in response:
raise ValueError(f"{response['error']}")
chunks = create_chunks_from_messages(response['messages'])
for c in chunks:
c.path = file_path
c.source_type = source_type
return chunks
try:
if source_type == SourceTypes.PDF:
Expand Down
2 changes: 1 addition & 1 deletion thepipe_api/thepipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def save_outputs(chunks: List[Chunk], verbose: bool = False, text_only: bool = F
if chunk is None:
continue
if chunk.text is not None:
text += f"""```\n{chunk.text}\n```\n\n"""
text += chunk.text
if (chunk.image is not None) and (not text_only):
if chunk.path is None:
clean_path = f"image"
Expand Down

0 comments on commit 5d95089

Please sign in to comment.