Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/chenqz-hub_hyperlipidemia-classifier.json
T

1 line
4.0 KiB
JSON

{"repo": "chenqz-hub/hyperlipidemia-classifier", "files": {"src/tests/testdeepseek.py": {"d8844d9a2c28e06ef755f587ac2bca9c9e45406d": {"t": 1785746419.5948024, "n": 1555, "h": "fb90c0a5ff9c24e0", "c": "import requests\nimport json\n\n# 定义请求头\nheaders = {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer sk-3ffe211cd19b4010a4f1e57c768a0220\"\n}\n\n# 定义请求体 - 为代码开发设置temperature=0.0\nbody = {\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful coding assistant. Provide concise and efficient code solutions.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Write a simple Python function to check if a number is prime.\"\n }\n ],\n \"temperature\": 0.0, # 推荐用于代码开发的温度值\n \"max_tokens\": 500 # 限制输出token数量以减少费用\n}\n\ntry:\n # 发送API请求\n response = requests.post(\n \"https://api.deepseek.com/v1/chat/completions\",\n headers=headers,\n json=body,\n timeout=30 # 添加超时设置\n )\n \n # 检查响应状态\n response.raise_for_status()\n \n # 打印响应\n result = response.json()\n print(json.dumps(result, indent=2, ensure_ascii=False))\n \n # 如果成功,提取并打印回答内容\n if \"choices\" in result and len(result[\"choices\"]) > 0:\n answer = result[\"choices\"][0][\"message\"][\"content\"]\n print(\"\\n回答内容:\")\n print(answer)\n \nexcept requests.exceptions.HTTPError as e:\n error_msg = \"HTTP错误:\"\n if response.status_code == 402:\n error_msg = \"账户余额不足。请前往DeepSeek网站充值。\"\n elif response.status_code == 429:\n error_msg = \"请求频率过高。请稍后再试。\"\n print(f\"{error_msg} {e}\")\n if hasattr(response, 'text'):\n print(f\"错误详情: {response.text}\")\n \nexcept Exception as e:\n print(f\"请求出错: {e}\")"}, "7f2550ea962a003fd8ca8dc4eb0cb42f4bb3002c": {"t": 1785763845.9915645, "n": 1555, "h": "fb90c0a5ff9c24e0", "c": "import requests\nimport json\n\n# 定义请求头\nheaders = {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer sk-3ffe211cd19b4010a4f1e57c768a0220\"\n}\n\n# 定义请求体 - 为代码开发设置temperature=0.0\nbody = {\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful coding assistant. Provide concise and efficient code solutions.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Write a simple Python function to check if a number is prime.\"\n }\n ],\n \"temperature\": 0.0, # 推荐用于代码开发的温度值\n \"max_tokens\": 500 # 限制输出token数量以减少费用\n}\n\ntry:\n # 发送API请求\n response = requests.post(\n \"https://api.deepseek.com/v1/chat/completions\",\n headers=headers,\n json=body,\n timeout=30 # 添加超时设置\n )\n \n # 检查响应状态\n response.raise_for_status()\n \n # 打印响应\n result = response.json()\n print(json.dumps(result, indent=2, ensure_ascii=False))\n \n # 如果成功,提取并打印回答内容\n if \"choices\" in result and len(result[\"choices\"]) > 0:\n answer = result[\"choices\"][0][\"message\"][\"content\"]\n print(\"\\n回答内容:\")\n print(answer)\n \nexcept requests.exceptions.HTTPError as e:\n error_msg = \"HTTP错误:\"\n if response.status_code == 402:\n error_msg = \"账户余额不足。请前往DeepSeek网站充值。\"\n elif response.status_code == 429:\n error_msg = \"请求频率过高。请稍后再试。\"\n print(f\"{error_msg} {e}\")\n if hasattr(response, 'text'):\n print(f\"错误详情: {response.text}\")\n \nexcept Exception as e:\n print(f\"请求出错: {e}\")"}}}}