Skip to content

Commit c6b4468

Browse files
committed
Removed description_length template variable to have less hypers
1 parent b39b98a commit c6b4468

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,6 @@ will return much faster than the first query and we'll be certain the authors ma
937937
| `parsing.enrichment_llm_config` | `None` | Optional configuration for `enrichment_llm`. |
938938
| `parsing.enrichment_page_radius` | `1` | Page radius for context text in enrichment. |
939939
| `parsing.enrichment_prompt` | `image_enrichment_prompt_template` | Prompt template for enriching media. |
940-
| `parsing.enrichment_description_length` | `"about 150 words"` | Plain text stating the desired length of an enriched media's description. |
941940
| `prompt.summary` | `summary_prompt` | Template for summarizing text, must contain variables matching `summary_prompt`. |
942941
| `prompt.qa` | `qa_prompt` | Template for QA, must contain variables matching `qa_prompt`. |
943942
| `prompt.select` | `select_paper_prompt` | Template for selecting papers, must contain variables matching `select_paper_prompt`. |

src/paperqa/prompts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@
181181
" so only use aspects relevant to accompanying image or table."
182182
"\n\nHere's a few failure mode with possible resolutions:"
183183
"\n- The media was a logo or icon, so the text is unrelated."
184-
" In this case, describe the media as a logo or icon,"
184+
" In this case, briefly describe the media as a logo or icon,"
185185
" and do not mention other unrelated surrounding text."
186186
"\n- The media was display type, so the text is probably unrelated."
187187
" The display type can be spread over several lines."
188-
" In this case, describe the media as display type,"
188+
" In this case, briefly describe the media as display type,"
189189
" and do not mention other unrelated surrounding text."
190190
"\n- The media is a margin box or design element, so the text is unrelated."
191-
" In this case, describe the media as decorative,"
191+
" In this case, briefly describe the media as decorative,"
192192
" and do not mention other unrelated surrounding text."
193193
"\n- The media came from a bad PDF read, so it's garbled."
194194
" In this case, describe the media as garbled, state why it's considered garbled,"
@@ -197,6 +197,6 @@
197197
" In this case, make sure to only detail the subfigure or subtable,"
198198
" not the entire figure or table."
199199
" Do not mention other unrelated surrounding text."
200-
"\n\n{context_text}Describe the media ({description_length})," # Allow for empty context_text
200+
"\n\n{context_text}Describe the media," # Allow for empty context_text
201201
" or if uncertain on a description please state why:"
202202
)

src/paperqa/settings.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,6 @@ class ParsingSettings(BaseModel):
334334
default=media_enrichment_prompt_template,
335335
description="Prompt template for enriching media.",
336336
)
337-
enrichment_description_length: str = Field(
338-
default="about 150 words",
339-
description=(
340-
"Plain text stating the desired length of an enriched media's description."
341-
),
342-
)
343337

344338
@property
345339
def should_parse_and_enrich_media(self) -> tuple[bool, bool]:
@@ -1183,8 +1177,7 @@ async def enrich_single_media(
11831177
f"Here is the co-located text from {radius_msg}:\n\n{context_text}\n\n"
11841178
if context_text
11851179
else ""
1186-
),
1187-
description_length=self.parsing.enrichment_description_length,
1180+
)
11881181
)
11891182
result = await llm.call_single(
11901183
messages=[

0 commit comments

Comments
 (0)