fix(fact-checker-cli): return default system prompt when prompt file is missing - #84
Open
shoemoney wants to merge 1 commit into
Open
fix(fact-checker-cli): return default system prompt when prompt file is missing#84shoemoney wants to merge 1 commit into
shoemoney wants to merge 1 commit into
Conversation
…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.
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.
_load_system_promptindocs/examples/fact-checker-cli/fact_checker.pyreturnsNonewhen the prompt file is missing: the default prompt is only returned from inside the genericexceptbranch, so theFileNotFoundErrorpath prints a warning and falls through with no return value. The repo does not ship asystem_prompt.mdfor this example (the directory contains onlyREADME.mdx,fact_checker.py,requirements.txt), so the documented Quick Start command hits this path on every run and silently sends"system": nullto the API.This moves the fallback out of the
exceptblock so the default prompt is returned unconditionally whenever loading fails, matching the structure already used by_load_system_promptin the sibling exampledocs/examples/research-finder/research_finder.py.Verified locally: with no
system_prompt.mdpresent, the method returnedNonebefore and returns the non-empty default prompt string after.