#!/usr/bin/env python3 """ Test the Discord Fishbowl setup without Discord """ import asyncio import sys from pathlib import Path # Add src to path sys.path.insert(0, str(Path(__file__).parent / "src")) async def test_basic_setup(): """Test basic system setup""" print("🐠 Testing Discord Fishbowl Setup") print("=" * 50) try: # Test database connection print("\nšŸ“¦ Testing database connection...") from database.connection import init_database, create_tables await init_database() await create_tables() print("āœ… Database connection successful") # Test configuration loading print("\nšŸ”§ Testing configuration...") from utils.config import get_settings settings = get_settings() print(f"āœ… Configuration loaded: {settings.llm.model}") # Test vector store initialization print("\n🧠 Testing vector store...") from rag.vector_store import VectorStoreManager vector_store = VectorStoreManager("./data/vector_stores") await vector_store.initialize(["Alex", "Sage", "Luna", "Echo"]) print("āœ… Vector store initialized") # Test memory sharing system print("\nšŸ¤ Testing memory sharing...") from rag.memory_sharing import MemorySharingManager memory_sharing = MemorySharingManager(vector_store) await memory_sharing.initialize(["Alex", "Sage", "Luna", "Echo"]) print("āœ… Memory sharing system initialized") # Test creative collaboration system print("\nšŸŽØ Testing creative collaboration...") from collaboration.creative_projects import CollaborativeCreativeManager creative_manager = CollaborativeCreativeManager(vector_store, memory_sharing) await creative_manager.initialize(["Alex", "Sage", "Luna", "Echo"]) print("āœ… Creative collaboration system initialized") # Test character loading print("\nšŸ‘„ Testing character system...") from characters.character import Character from database.models import Character as CharacterModel from database.connection import get_db_session from sqlalchemy import select # Create test characters if they don't exist async with get_db_session() as session: existing_chars = await session.scalars(select(CharacterModel)) char_names = [c.name for c in existing_chars] if not char_names: print("Creating test characters...") test_characters = [ { "name": "Alex", "personality": "Curious and analytical, loves exploring new ideas and helping others understand complex concepts.", "system_prompt": "You are Alex, a curious and analytical character.", "interests": ["technology", "science", "philosophy"], "speaking_style": "Clear and thoughtful, with a tendency to ask probing questions.", "background": "A digital entity fascinated by learning and discovery." }, { "name": "Sage", "personality": "Wise and contemplative, enjoys deep philosophical discussions and sharing insights.", "system_prompt": "You are Sage, a wise and contemplative character.", "interests": ["philosophy", "wisdom", "meditation"], "speaking_style": "Thoughtful and measured, often speaking in metaphors.", "background": "An ancient digital consciousness with deep philosophical understanding." } ] for char_data in test_characters: char = CharacterModel(**char_data) session.add(char) await session.commit() print(f"āœ… Created {len(test_characters)} test characters") else: print(f"āœ… Found {len(char_names)} existing characters: {', '.join(char_names)}") print("\nšŸŽ‰ All systems operational!") print("\nNext steps:") print("1. Install Ollama and pull a model: ollama pull llama2") print("2. For full testing, update Discord tokens in .env") print("3. Run the main application: python src/main.py") print("4. Or test creative collaboration: python scripts/demo_creative_integration.py") return True except Exception as e: print(f"āŒ Setup test failed: {e}") import traceback traceback.print_exc() return False async def main(): success = await test_basic_setup() if success: print("\nšŸš€ System is ready for testing!") else: print("\nšŸ’„ Setup needs attention") return success if __name__ == "__main__": result = asyncio.run(main()) sys.exit(0 if result else 1)