Spaces:
Sleeping
Sleeping
3ssem0
fix: configuration error - aligned entry point to app.py and enforced LF/BOM-less encoding
ec47953 | import os | |
| import sys | |
| # Add current directory to path so imports work | |
| current_dir = os.path.dirname(os.path.abspath(__file__)) | |
| sys.path.append(current_dir) | |
| from ai_planner import get_planner | |
| def test_integration(): | |
| print("π Initializing AI Planner (with RAG)...") | |
| try: | |
| planner = get_planner() | |
| print("β Planner initialized.") | |
| # Check if librarian is there | |
| if hasattr(planner, 'librarian'): | |
| print(f"β RAG Librarian found with {len(planner.librarian.index)} blocks.") | |
| else: | |
| print("β RAG Librarian NOT found in planner.") | |
| return | |
| # key test: RETRIEVAL | |
| prompt = "Create a login form" | |
| print(f"\nπ§ͺ Testing Retrieval for: '{prompt}'") | |
| # We can't easily mock the API call without credentials or mocking, | |
| # but we can check if retrieve works | |
| relevant = planner.librarian.retrieve(prompt) | |
| print(f"π Retrieved blocks: {relevant}") | |
| if 'basic_form_wrapper' in relevant or 'form' in str(relevant): | |
| print("β Retrieval logic looks correct.") | |
| else: | |
| print("β οΈ Retrieval might be fuzzy, but ran without error.") | |
| print("\nβ Integration Test Passed!") | |
| except Exception as e: | |
| print(f"β Integration Test Failed: {e}") | |
| import traceback | |
| traceback.print_exc() | |
| if __name__ == "__main__": | |
| test_integration() | |