diff --git a/config.json b/config.json index f609e97..f4afcb9 100644 --- a/config.json +++ b/config.json @@ -1,14 +1,15 @@ { - "ollama_endpoint": "http://localhost:11434", - "ollama_model": "llama2", + "ollama_endpoint": "http://192.168.2.245:11434", + "ollama_model": "goekdenizguelmez/JOSIEFIED-Qwen3:8b", "silent_start": "20:00", "silent_end": "12:00", "min_interval": 3, "max_interval": 180, - "bark_api_url": "", - "bark_device_key": "", - "ntfy_api_url": "", - "ntfy_topic": "", + "bark_api_url": "https://bark.xorbitlab.xyz", + "bark_device_key": "GmFrzGegxFexhNXXXYdzm3", + "ntfy_api_url": "https://ntfy.xorbitlab.xyz", + "ntfy_topic": "tigeren_msg", "ntfy_access_token": "", "templates_dir": "templates" -} \ No newline at end of file +} + diff --git a/quick_test.py b/quick_test.py new file mode 100755 index 0000000..17bf91e --- /dev/null +++ b/quick_test.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +"""Quick test of the full notification pipeline.""" + +import asyncio +from config import Config +from template_manager import TemplateManager +from ollama_client import OllamaClient +from notification_client import NotificationClient + +async def test_full_pipeline(): + """Test the complete pipeline from template to notification.""" + config = Config() + + print("šŸš€ Testing full notification pipeline...") + + # Test template system + template_manager = TemplateManager() + prompt = template_manager.get_random_prompt() + print(f"šŸ“‹ Selected template: {prompt}") + + # Test Ollama response + async with OllamaClient(config) as ollama_client: + response = await ollama_client.generate_response(prompt) + if response: + print(f"šŸ¤– Ollama response: {response[:200]}...") + + # Test notification (will skip if no device key/topic) + async with NotificationClient(config) as notification_client: + success = await notification_client.send_notification(response) + if success: + print("āœ… Notification pipeline working!") + else: + print("āš ļø Notification sent to available services") + else: + print("āŒ Failed to get Ollama response") + +if __name__ == "__main__": + asyncio.run(test_full_pipeline()) \ No newline at end of file diff --git a/templates/additional_templates.json b/templates/additional_templates.json new file mode 100644 index 0000000..9c7953b --- /dev/null +++ b/templates/additional_templates.json @@ -0,0 +1,52 @@ +[ + { + "name": "Daily Wisdom", + "prompt": "Share a brief piece of wisdom or insight for {day}, {date} at {time}", + "description": "Daily philosophical or practical wisdom" + }, + { + "name": "Creative Prompt", + "prompt": "What's one creative thing you could do right now on this {weekday} {time_of_day}?", + "description": "Creative thinking and action prompts" + }, + { + "name": "Mindful Moment", + "prompt": "Take a moment to notice three things around you at {time} on {date}", + "description": "Mindfulness and awareness exercises" + }, + { + "name": "Gratitude Challenge", + "prompt": "Name one thing you're grateful for about this {time_of_day} on {month} {day_of_month}", + "description": "Gratitude practice with daily variations" + }, + { + "name": "Energy Check", + "prompt": "How's your energy level right now at {time}? What's one small adjustment you could make?", + "description": "Energy and wellness check-ins" + }, + { + "name": "Learning Question", + "prompt": "What's one thing you learned today or would like to learn this {weekday}?", + "description": "Continuous learning and curiosity prompts" + }, + { + "name": "Nature Connection", + "prompt": "What's the weather like today ({date}) and how does it make you feel?", + "description": "Connecting with natural rhythms and environment" + }, + { + "name": "Relationship Reflection", + "prompt": "Send a kind thought to someone at {time} today - who comes to mind and why?", + "description": "Social connection and relationship awareness" + }, + { + "name": "Future Self", + "prompt": "What would your future self thank you for doing today ({date}) at {time_of_day}?", + "description": "Long-term thinking and future planning" + }, + { + "name": "Micro-Adventure", + "prompt": "What's a tiny adventure you could have in the next hour starting from {time}?", + "description": "Encouraging small, spontaneous adventures" + } +] \ No newline at end of file diff --git a/templates/tech_templates.json b/templates/tech_templates.json new file mode 100644 index 0000000..feadd1a --- /dev/null +++ b/templates/tech_templates.json @@ -0,0 +1,22 @@ +[ + { + "name": "Code Reflection", + "prompt": "What coding concept or practice have you been thinking about lately? Share your thoughts for {date} {time}", + "description": "Developer-focused reflection prompts" + }, + { + "name": "Tech Curiosity", + "prompt": "What's one technology or tool you'd like to explore this {weekday}? What intrigues you about it?", + "description": "Technology curiosity and learning prompts" + }, + { + "name": "Problem Solving", + "prompt": "Describe a problem you're currently working on at {time} and one approach you might try", + "description": "Problem-solving and debugging mindset prompts" + }, + { + "name": "System Thinking", + "prompt": "Think about a system you interacted with today ({date}). How could it be improved?", + "description": "Systems thinking and improvement prompts" + } +] \ No newline at end of file diff --git a/test_connections.py b/test_connections.py new file mode 100755 index 0000000..03cf0ad --- /dev/null +++ b/test_connections.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +"""Test script to verify all service connections.""" + +import asyncio +import logging +from config import Config +from ollama_client import OllamaClient +from notification_client import NotificationClient + +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +async def test_all_services(): + """Test connections to all configured services.""" + config = Config() + + print("šŸ” Testing service connections...") + print(f"Current config: {config.ollama_endpoint}") + print(f"Bark URL: {config.bark_api_url}") + print(f"Ntfy URL: {config.ntfy_api_url}") + + # Test Ollama + print("\nšŸ¤– Testing Ollama connection...") + async with OllamaClient(config) as ollama_client: + ollama_ok = await ollama_client.check_health() + if ollama_ok: + print("āœ… Ollama service is accessible") + + # Test a small prompt + test_prompt = "Hello, this is a test." + response = await ollama_client.generate_response(test_prompt) + if response: + print(f"āœ… Ollama response: {response[:100]}...") + else: + print("āŒ Failed to get response from Ollama") + else: + print("āŒ Ollama service is not accessible") + + # Test notification services + print("\nšŸ“± Testing notification services...") + async with NotificationClient(config) as notification_client: + results = await notification_client.test_connections() + + print("Bark connection:", "āœ… Available" if results.get("bark") else "āŒ Not configured/available") + print("Ntfy connection:", "āœ… Available" if results.get("ntfy") else "āŒ Not configured/available") + + # If device key/topic not set, show guidance + if not config.bark_device_key: + print("šŸ’” Bark device key not set - configure with: ./config_cli.py --set-bark-key YOUR_DEVICE_KEY") + + if not config.ntfy_topic: + print("šŸ’” Ntfy topic not set - configure with: ./config_cli.py --set-ntfy-topic YOUR_TOPIC") + +if __name__ == "__main__": + asyncio.run(test_all_services()) \ No newline at end of file