Files

1 line
9.7 KiB
JSON

{"repo": "ayoub-chebbi/deepveil", "files": {"ai.py": {"128a4787363ff8654d1c250565ec8235447f2247": {"t": 1785747509.261228, "n": 2268, "h": "61e7c4c8e3320ff3", "c": "import random\nimport threading\nfrom openai import OpenAI # Synchronous client\n\nclient = OpenAI(api_key=\"sk-cb791902d7b04a28bd708ff5b2cc3805\", base_url=\"https://api.deepseek.com\")\nresponse_queue = []\nresponse_lock = threading.Lock()\n\ndef get_deepseek_response_async(prompt):\n def fetch_response():\n try:\n response = client.chat.completions.create(\n model=\"deepseek-chat\",\n messages=[{\"role\": \"user\", \"content\": prompt}],\n max_tokens=100\n )\n with response_lock:\n response_queue.append(response.choices[0].message.content.strip())\n except Exception as e:\n with response_lock:\n response_queue.append(f\"Error: {e}\")\n \n threading.Thread(target=fetch_response, daemon=True).start()\n return \"Processing...\"\n\ndef suspect_ai(found_clues, suspect_visibility, language, points):\n if not found_clues:\n return suspect_visibility\n \n clue_count = len(found_clues)\n prompt = f\"Generate a short alibi for a suspect in a theft case based on {clue_count} clues found. Language: {language}. and make it only 8 words\"\n if points > 20 and random.random() < 0.3:\n prompt += \" Include a subtle red herring.\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n alibi = response_queue.pop(0)\n print(f\"AI Alibi: {alibi}\")\n text_to_speech(alibi, language)\n \n for i in range(min(clue_count, len(suspect_visibility))):\n if not suspect_visibility[i]:\n suspect_visibility[i] = True\n break\n \n return suspect_visibility\n\ndef get_smart_hint(found_clues, points, language):\n clue_count = len(found_clues)\n difficulty = \"easy\" if points < 15 else \"hard\"\n prompt = f\"Generate a short hint for a detective game with {clue_count} clues found so far. Difficulty: {difficulty}. Language: {language}. and make it only 8 words\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n return response_queue.pop(0)\n return response"}, "02281a352482837bcdcb6a390a60b7a00ace5545": {"t": 1785773680.296978, "n": 2268, "h": "61e7c4c8e3320ff3", "c": "import random\nimport threading\nfrom openai import OpenAI # Synchronous client\n\nclient = OpenAI(api_key=\"sk-cb791902d7b04a28bd708ff5b2cc3805\", base_url=\"https://api.deepseek.com\")\nresponse_queue = []\nresponse_lock = threading.Lock()\n\ndef get_deepseek_response_async(prompt):\n def fetch_response():\n try:\n response = client.chat.completions.create(\n model=\"deepseek-chat\",\n messages=[{\"role\": \"user\", \"content\": prompt}],\n max_tokens=100\n )\n with response_lock:\n response_queue.append(response.choices[0].message.content.strip())\n except Exception as e:\n with response_lock:\n response_queue.append(f\"Error: {e}\")\n \n threading.Thread(target=fetch_response, daemon=True).start()\n return \"Processing...\"\n\ndef suspect_ai(found_clues, suspect_visibility, language, points):\n if not found_clues:\n return suspect_visibility\n \n clue_count = len(found_clues)\n prompt = f\"Generate a short alibi for a suspect in a theft case based on {clue_count} clues found. Language: {language}. and make it only 8 words\"\n if points > 20 and random.random() < 0.3:\n prompt += \" Include a subtle red herring.\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n alibi = response_queue.pop(0)\n print(f\"AI Alibi: {alibi}\")\n text_to_speech(alibi, language)\n \n for i in range(min(clue_count, len(suspect_visibility))):\n if not suspect_visibility[i]:\n suspect_visibility[i] = True\n break\n \n return suspect_visibility\n\ndef get_smart_hint(found_clues, points, language):\n clue_count = len(found_clues)\n difficulty = \"easy\" if points < 15 else \"hard\"\n prompt = f\"Generate a short hint for a detective game with {clue_count} clues found so far. Difficulty: {difficulty}. Language: {language}. and make it only 8 words\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n return response_queue.pop(0)\n return response"}, "d755b1079bf038019301efb81f26b521fd0dda83": {"t": 1785773681.5421576, "n": 2218, "h": "472d535f32f0bd5e", "c": "import random\nimport threading\nfrom openai import OpenAI # Synchronous client\n\nclient = OpenAI(api_key=\"sk-cb791902d7b04a28bd708ff5b2cc3805\", base_url=\"https://api.deepseek.com\")\nresponse_queue = []\nresponse_lock = threading.Lock()\n\ndef get_deepseek_response_async(prompt):\n def fetch_response():\n try:\n response = client.chat.completions.create(\n model=\"deepseek-chat\",\n messages=[{\"role\": \"user\", \"content\": prompt}],\n max_tokens=100\n )\n with response_lock:\n response_queue.append(response.choices[0].message.content.strip())\n except Exception as e:\n with response_lock:\n response_queue.append(f\"Error: {e}\")\n \n threading.Thread(target=fetch_response, daemon=True).start()\n return \"Processing...\"\n\ndef suspect_ai(found_clues, suspect_visibility, language, points):\n if not found_clues:\n return suspect_visibility\n \n clue_count = len(found_clues)\n prompt = f\"Generate a short alibi for a suspect in a theft case based on {clue_count} clues found. Language: {language}.\"\n if points > 20 and random.random() < 0.3:\n prompt += \" Include a subtle red herring.\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n alibi = response_queue.pop(0)\n print(f\"AI Alibi: {alibi}\")\n text_to_speech(alibi, language)\n \n for i in range(min(clue_count, len(suspect_visibility))):\n if not suspect_visibility[i]:\n suspect_visibility[i] = True\n break\n \n return suspect_visibility\n\ndef get_smart_hint(found_clues, points, language):\n clue_count = len(found_clues)\n difficulty = \"easy\" if points < 15 else \"hard\"\n prompt = f\"Generate a short hint for a detective game with {clue_count} clues found so far. Difficulty: {difficulty}. Language: {language}.\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n return response_queue.pop(0)\n return response"}, "e7f65f4e78406fa06b64f7630ac59decbe890aa4": {"t": 1785773682.9892683, "n": 2260, "h": "7a9124ff6f87e336", "c": "import random\nimport threading\nfrom openai import AsyncOpenAI\n\nclient = AsyncOpenAI(api_key=\"sk-cb791902d7b04a28bd708ff5b2cc3805\", base_url=\"https://api.deepseek.com\")\nresponse_queue = []\nresponse_lock = threading.Lock()\n\ndef get_deepseek_response_async(prompt):\n async def fetch_response():\n try:\n response = await client.chat.completions.create(\n model=\"deepseek-chat\",\n messages=[{\"role\": \"user\", \"content\": prompt}],\n max_tokens=100\n )\n with response_lock:\n response_queue.append(response.choices[0].message.content.strip())\n except Exception as e:\n with response_lock:\n response_queue.append(f\"Error: {e}\")\n \n threading.Thread(target=lambda: client.loop.run_until_complete(fetch_response()), daemon=True).start()\n return \"Processing...\"\n\ndef suspect_ai(found_clues, suspect_visibility, language, points):\n if not found_clues:\n return suspect_visibility\n \n clue_count = len(found_clues)\n prompt = f\"Generate a short alibi for a suspect in a theft case based on {clue_count} clues found. Language: {language}.\"\n if points > 20 and random.random() < 0.3:\n prompt += \" Include a subtle red herring.\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n alibi = response_queue.pop(0)\n print(f\"AI Alibi: {alibi}\")\n text_to_speech(alibi, language)\n \n for i in range(min(clue_count, len(suspect_visibility))):\n if not suspect_visibility[i]:\n suspect_visibility[i] = True\n break\n \n return suspect_visibility\n\ndef get_smart_hint(found_clues, points, language):\n clue_count = len(found_clues)\n difficulty = \"easy\" if points < 15 else \"hard\"\n prompt = f\"Generate a short hint for a detective game with {clue_count} clues found so far. Difficulty: {difficulty}. Language: {language}.\"\n \n response = get_deepseek_response_async(prompt)\n if response == \"Processing...\":\n with response_lock:\n if response_queue:\n return response_queue.pop(0)\n return response"}}}}