Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/azizali123_aegisos.json
T

1 line
8.4 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "azizali123/aegisos", "files": {"analyze_comments.py": {"dfb4a8d4811e5291d47927de72397f86058e1488": {"t": 1785745443.5510201, "n": 3836, "h": "e816801fb5b12a85", "c": "import os\nimport json\nimport requests\n\n# Çevre değişkenlerinden DeepSeek API anahtarını al\nDEEPSEEK_API_KEY = os.getenv(\"DEEPSEEK_API_KEY\")\n\ndef analyze_comment_with_deepseek(comment, api_key):\n \"\"\"Bir yorumu ve yazarını DeepSeek API ile analiz eder.\"\"\"\n if not api_key:\n return {\"error\": \"DeepSeek API anahtarı bulunamadı.\"}\n\n url = \"https://api.deepseek.com/chat/completions\"\n headers = {\n \"Authorization\": f\"Bearer {api_key}\",\n \"Content-Type\": \"application/json\"\n }\n\n # DeepSeek (ve OpenAI) API'lerinde 'system' ve 'user' rolleri ayrımı daha iyi sonuç verir\n system_prompt = \"\"\"\n Sen bir GitHub depo moderatörüsün. Benim projem 'Aegis OS', sıfırdan C diliyle yazılmış, \n donanıma doğrudan erişen (bare-metal) bir mikroçekirdek işletim sistemidir. \n\n Sana verilen kullanıcı yorumunu analiz et. Bu yorumun bir insan tarafından mı yoksa \n bir bot/spam aracı tarafından mı yazıldığını belirle. Cevabını kesinlikle JSON formatında ver.\n\n Değerlendirme Kriterleri:\n 1. Yorum \"AI agent skill\", \"Claude Code\", \"Firmware Analysis Tool\" gibi genel teknoloji terimleri içeriyorsa bottur.\n 2. Yorum koddaki bir dosyaya (örn: `kernel.c`), bir fonksiyona veya mimariye spesifik atıf yapıyorsa insandır.\n\n Lütfen çıktıyı yalnızca aşağıdaki JSON formatında ver:\n {\n \"is_bot\": true_veya_false,\n \"confidence_percent\": 0_ile_100_arasi_sayi,\n \"reason\": \"Kararının kısa gerekçesi\",\n \"action\": \"Spam veya Guvenli\"\n }\n \"\"\"\n\n user_content = f\"\"\"\n Analiz Edilecek Veri:\n - Kullanıcı Adı: {comment['user']['login']}\n - Yorum Metni: \"{comment['body']}\"\n \"\"\"\n\n # DeepSeek API Payload'u\n payload = {\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\"role\": \"system\", \"content\": system_prompt},\n {\"role\": \"user\", \"content\": user_content}\n ],\n \"response_format\": {\"type\": \"json_object\"}, # DeepSeek'i sadece JSON dönmeye zorlar\n \"temperature\": 0.1 # Daha net ve tutarlı kararlar alması için yaratıcılığı kısıyoruz\n }\n\n try:\n response = requests.post(url, headers=headers, json=payload)\n response.raise_for_status() # HTTP 200 harici bir kod dönerse hata fırlat\n \n response_data = response.json()\n content = response_data['choices'][0]['message']['content']\n \n return json.loads(content)\n except Exception as e:\n return {\"error\": f\"DeepSeek API hatası: {e}\"}\n\ndef main():\n print(\"AegisOS Bot Analiz Ajanı (DeepSeek) Tetiklendi!\")\n \n event_path = os.getenv(\"GITHUB_EVENT_PATH\")\n \n if not event_path or not os.path.exists(event_path):\n print(\"Hata: GITHUB_EVENT_PATH bulunamadı. Bu script GitHub Actions ortamında çalışmalıdır.\")\n return\n\n with open(event_path, \"r\") as f:\n event_data = json.load(f)\n\n comment = event_data.get(\"comment\")\n action = event_data.get(\"action\")\n\n if action == \"created\" and comment:\n username = comment['user']['login']\n print(f\"\\nYeni yorum yakalandı! Yazan: {username}\")\n \n if username == \"github-actions[bot]\":\n print(\"Bu yorum kendi botumuz tarafından yapıldı, analiz atlanıyor.\")\n return\n\n analysis = analyze_comment_with_deepseek(comment, DEEPSEEK_API_KEY)\n \n print(\"\\n--- ANALİZ SONUCU ---\")\n if \"error\" in analysis:\n print(f\"Hata: {analysis['error']}\")\n else:\n print(f\"Bot mu?: {'EVET' if analysis.get('is_bot') else 'HAYIR'}\")\n print(f\"Eminlik: %{analysis.get('confidence_percent')}\")\n print(f\"Gerekçe: {analysis.get('reason')}\")\n print(f\"Aksiyon Önerisi: {analysis.get('action')}\")\n else:\n print(\"Tetikleyici bir 'yeni yorum' (comment created) olayı değil.\")\n\nif __name__ == \"__main__\":\n main()\n"}, "2fa822e31d91154850bf8309b1a8f91c78ac7d35": {"t": 1785753289.0212412, "n": 3836, "h": "e816801fb5b12a85", "c": "import os\nimport json\nimport requests\n\n# Çevre değişkenlerinden DeepSeek API anahtarını al\nDEEPSEEK_API_KEY = os.getenv(\"DEEPSEEK_API_KEY\")\n\ndef analyze_comment_with_deepseek(comment, api_key):\n \"\"\"Bir yorumu ve yazarını DeepSeek API ile analiz eder.\"\"\"\n if not api_key:\n return {\"error\": \"DeepSeek API anahtarı bulunamadı.\"}\n\n url = \"https://api.deepseek.com/chat/completions\"\n headers = {\n \"Authorization\": f\"Bearer {api_key}\",\n \"Content-Type\": \"application/json\"\n }\n\n # DeepSeek (ve OpenAI) API'lerinde 'system' ve 'user' rolleri ayrımı daha iyi sonuç verir\n system_prompt = \"\"\"\n Sen bir GitHub depo moderatörüsün. Benim projem 'Aegis OS', sıfırdan C diliyle yazılmış, \n donanıma doğrudan erişen (bare-metal) bir mikroçekirdek işletim sistemidir. \n\n Sana verilen kullanıcı yorumunu analiz et. Bu yorumun bir insan tarafından mı yoksa \n bir bot/spam aracı tarafından mı yazıldığını belirle. Cevabını kesinlikle JSON formatında ver.\n\n Değerlendirme Kriterleri:\n 1. Yorum \"AI agent skill\", \"Claude Code\", \"Firmware Analysis Tool\" gibi genel teknoloji terimleri içeriyorsa bottur.\n 2. Yorum koddaki bir dosyaya (örn: `kernel.c`), bir fonksiyona veya mimariye spesifik atıf yapıyorsa insandır.\n\n Lütfen çıktıyı yalnızca aşağıdaki JSON formatında ver:\n {\n \"is_bot\": true_veya_false,\n \"confidence_percent\": 0_ile_100_arasi_sayi,\n \"reason\": \"Kararının kısa gerekçesi\",\n \"action\": \"Spam veya Guvenli\"\n }\n \"\"\"\n\n user_content = f\"\"\"\n Analiz Edilecek Veri:\n - Kullanıcı Adı: {comment['user']['login']}\n - Yorum Metni: \"{comment['body']}\"\n \"\"\"\n\n # DeepSeek API Payload'u\n payload = {\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\"role\": \"system\", \"content\": system_prompt},\n {\"role\": \"user\", \"content\": user_content}\n ],\n \"response_format\": {\"type\": \"json_object\"}, # DeepSeek'i sadece JSON dönmeye zorlar\n \"temperature\": 0.1 # Daha net ve tutarlı kararlar alması için yaratıcılığı kısıyoruz\n }\n\n try:\n response = requests.post(url, headers=headers, json=payload)\n response.raise_for_status() # HTTP 200 harici bir kod dönerse hata fırlat\n \n response_data = response.json()\n content = response_data['choices'][0]['message']['content']\n \n return json.loads(content)\n except Exception as e:\n return {\"error\": f\"DeepSeek API hatası: {e}\"}\n\ndef main():\n print(\"AegisOS Bot Analiz Ajanı (DeepSeek) Tetiklendi!\")\n \n event_path = os.getenv(\"GITHUB_EVENT_PATH\")\n \n if not event_path or not os.path.exists(event_path):\n print(\"Hata: GITHUB_EVENT_PATH bulunamadı. Bu script GitHub Actions ortamında çalışmalıdır.\")\n return\n\n with open(event_path, \"r\") as f:\n event_data = json.load(f)\n\n comment = event_data.get(\"comment\")\n action = event_data.get(\"action\")\n\n if action == \"created\" and comment:\n username = comment['user']['login']\n print(f\"\\nYeni yorum yakalandı! Yazan: {username}\")\n \n if username == \"github-actions[bot]\":\n print(\"Bu yorum kendi botumuz tarafından yapıldı, analiz atlanıyor.\")\n return\n\n analysis = analyze_comment_with_deepseek(comment, DEEPSEEK_API_KEY)\n \n print(\"\\n--- ANALİZ SONUCU ---\")\n if \"error\" in analysis:\n print(f\"Hata: {analysis['error']}\")\n else:\n print(f\"Bot mu?: {'EVET' if analysis.get('is_bot') else 'HAYIR'}\")\n print(f\"Eminlik: %{analysis.get('confidence_percent')}\")\n print(f\"Gerekçe: {analysis.get('reason')}\")\n print(f\"Aksiyon Önerisi: {analysis.get('action')}\")\n else:\n print(\"Tetikleyici bir 'yeni yorum' (comment created) olayı değil.\")\n\nif __name__ == \"__main__\":\n main()\n"}}}}