Simplifying prompt newlines to use --- hrule and removed extra hrules#1156
Merged
jamesbraza merged 9 commits intomainfrom Oct 29, 2025
Merged
Simplifying prompt newlines to use --- hrule and removed extra hrules#1156jamesbraza merged 9 commits intomainfrom
--- hrule and removed extra hrules#1156jamesbraza merged 9 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR standardizes horizontal rule formatting in prompts by replacing ---- and ------------ with the standard Markdown --- hrule, reducing token usage and improving compatibility with Markdown renderers. Additionally, it adds (no text) placeholder when context text is empty to prevent model confusion.
Key changes:
- Standardized all horizontal rules to
---format - Added placeholder text for empty contexts
- Updated test assertions to match new separator format
Reviewed Changes
Copilot reviewed 5 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_paperqa.py |
Updated test assertion to expect --- separator instead of ---- |
tests/cassettes/test_partly_embedded_texts[True].yaml |
Test cassette updated with new prompt format and API version changes |
src/paperqa/settings.py |
Changed context section separator from ---- to --- |
src/paperqa/prompts.py |
Standardized all horizontal rules to --- and reorganized prompt templates |
src/paperqa/core.py |
Added (no text) placeholder for empty text and removed extra separator in table formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7120ced to
7895e53
Compare
7895e53 to
9491b9b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
---is a basic Markdown hrule (link), which is also enforced byprettierin actual.mdfiles.This PR cleans up our prompting a bunch:
(no text)if aContexthas empty stringtext, to avoid model confusion.---on table creationqa_promptAfter this PR, here is a
Contextcreation prompt involving a table: