Skip to content
Prev Previous commit
Next Next commit
Removed extra spaces from CITATION_KEY_CONSTRAINTS
  • Loading branch information
jamesbraza committed Oct 27, 2025
commit 02b12968bc141b16af41e9a7a7f5dfe04aa4c024
24 changes: 12 additions & 12 deletions src/paperqa/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
)

CITATION_KEY_CONSTRAINTS = (
"## Valid citation examples, only use comma/space delimited parentheticals: \n"
"- (pqac-d79ef6fa, pqac-0f650d59) \n"
"- (pqac-d79ef6fa) \n"
"## Invalid citation examples: \n"
"- (pqac-d79ef6fa and pqac-0f650d59) \n"
"- (pqac-d79ef6fa;pqac-0f650d59) \n"
"- (pqac-d79ef6fa-pqac-0f650d59) \n"
"- pqac-d79ef6fa and pqac-0f650d59 \n"
"- Example's work (pqac-d79ef6fa) \n"
"- (pages pqac-d79ef6fa) \n"
"## Valid citation examples, only use comma/space delimited parentheticals:\n"
"- (pqac-d79ef6fa, pqac-0f650d59)\n"
"- (pqac-d79ef6fa)\n"
"## Invalid citation examples:\n"
"- (pqac-d79ef6fa and pqac-0f650d59)\n"
"- (pqac-d79ef6fa;pqac-0f650d59)\n"
"- (pqac-d79ef6fa-pqac-0f650d59)\n"
"- pqac-d79ef6fa and pqac-0f650d59\n"
"- Example's work (pqac-d79ef6fa)\n"
"- (pages pqac-d79ef6fa)"
)

qa_prompt = (
Expand All @@ -57,8 +57,8 @@
f'"{CANNOT_ANSWER_PHRASE}." '
"For each part of your answer, indicate which sources most support "
"it via citation keys at the end of sentences, like {example_citation}. "
"Only cite from the context above and only use the citation keys from the context. "
f"{CITATION_KEY_CONSTRAINTS}"
"Only cite from the context above and only use the citation keys from the context."
f"\n\n{CITATION_KEY_CONSTRAINTS}\n\n"
"Do not concatenate citation keys, just use them as is. "
"Write in the style of a scientific article, with concise sentences and "
"coherent paragraphs. This answer will be used directly, "
Expand Down