Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions docs/examples/fact-checker-cli/fact_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ def _load_system_prompt(self, prompt_file: str) -> str:
print(f"Warning: Prompt file not found at {prompt_file}", file=sys.stderr)
except Exception as e:
print(f"Warning: Could not load system prompt from {prompt_file}: {e}", file=sys.stderr)
print("Using default system prompt.", file=sys.stderr)
return (
"You are a professional fact-checker with extensive research capabilities. "
"Your task is to evaluate claims or articles for factual accuracy. "
"Focus on identifying false, misleading, or unsubstantiated claims."
)

# Fallback default prompt if file loading fails
print("Using default system prompt.", file=sys.stderr)
return (
"You are a professional fact-checker with extensive research capabilities. "
"Your task is to evaluate claims or articles for factual accuracy. "
"Focus on identifying false, misleading, or unsubstantiated claims."
)

def check_claim(self, text: str, model: str = DEFAULT_MODEL, use_structured_output: bool = False) -> Dict[str, Any]:
"""
Expand Down