Skip to content

fix(fact-checker-cli): return default system prompt when prompt file is missing - #84

Open
shoemoney wants to merge 1 commit into
perplexityai:mainfrom
shoemoney:fix/fact-checker-default-prompt
Open

fix(fact-checker-cli): return default system prompt when prompt file is missing#84
shoemoney wants to merge 1 commit into
perplexityai:mainfrom
shoemoney:fix/fact-checker-default-prompt

Conversation

@shoemoney

Copy link
Copy Markdown

_load_system_prompt in docs/examples/fact-checker-cli/fact_checker.py returns None when the prompt file is missing: the default prompt is only returned from inside the generic except branch, so the FileNotFoundError path prints a warning and falls through with no return value. The repo does not ship a system_prompt.md for this example (the directory contains only README.mdx, fact_checker.py, requirements.txt), so the documented Quick Start command hits this path on every run and silently sends "system": null to the API.

This moves the fallback out of the except block so the default prompt is returned unconditionally whenever loading fails, matching the structure already used by _load_system_prompt in the sibling example docs/examples/research-finder/research_finder.py.

Verified locally: with no system_prompt.md present, the method returned None before and returns the non-empty default prompt string after.

…is missing

_load_system_prompt returned None when system_prompt.md was absent: the
default prompt was only returned from inside the generic except branch,
so the FileNotFoundError path fell through with no return value. The
repo ships no system_prompt.md, so the documented Quick Start sent a
null system prompt on every run.

Move the fallback out of the except block so it returns unconditionally
when loading fails, matching research_finder.py in the sibling example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant