Files
LEANN/examples/main_cli_example.py
Andy Lee 46f6f76fc3 refactor: Unify examples interface with BaseRAGExample
- Create BaseRAGExample base class for all RAG examples
- Refactor 4 examples to use unified interface:
  - document_rag.py (replaces main_cli_example.py)
  - email_rag.py (replaces mail_reader_leann.py)
  - browser_rag.py (replaces google_history_reader_leann.py)
  - wechat_rag.py (replaces wechat_history_reader_leann.py)
- Maintain 100% parameter compatibility with original files
- Add interactive mode support for all examples
- Unify parameter names (--max-items replaces --max-emails/--max-entries)
- Update README.md with new examples usage
- Add PARAMETER_CONSISTENCY.md documenting all parameter mappings
- Keep main_cli_example.py for backward compatibility with migration notice

All default values, LeannBuilder parameters, and chunking settings
remain identical to ensure full compatibility with existing indexes.
2025-07-28 23:11:16 -07:00

33 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""
This script has been replaced by document_rag.py with a unified interface.
This file is kept for backward compatibility.
"""
import sys
import os
print("=" * 70)
print("NOTICE: This script has been replaced!")
print("=" * 70)
print("\nThe examples have been refactored with a unified interface.")
print("Please use the new script instead:\n")
print(" python examples/document_rag.py")
print("\nThe new script provides:")
print(" ✓ Consistent parameters across all examples")
print(" ✓ Better error handling")
print(" ✓ Interactive mode support")
print(" ✓ More customization options")
print("\nExample usage:")
print(' python examples/document_rag.py --query "What are the main techniques?"')
print(" python examples/document_rag.py # For interactive mode")
print("\nSee README.md for full documentation.")
print("=" * 70)
# If user passed arguments, show how to use them with new script
if len(sys.argv) > 1:
print("\nTo use your arguments with the new script:")
print(f" python examples/document_rag.py {' '.join(sys.argv[1:])}")
sys.exit(1)