Files

1 line
4.6 KiB
JSON

{"repo": "bls-2046/fuyo", "files": {"fuyo-backend/src/main/java/com/github/backend/service/impl/Impls/DeepseekServiceImpl.java": {"239730fb259e8db2a7f635ddef2fba749bd35ac2": {"t": 1785747147.929242, "n": 2054, "h": "6b98b897d438fda3", "c": "package com.github.backend.service.impl.Impls;\n\nimport com.github.backend.service.DeepseekService;\nimport com.github.backend.utils.Https;\nimport com.github.dto.deepseek.DeepseekChatRequest;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\nimport org.springframework.http.HttpHeaders;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class DeepseekServiceImpl implements DeepseekService {\n\n @Override\n public String deepseekChatRespo(DeepseekChatRequest deepseekChatRequest) {\n JSONObject requestBody = new JSONObject()\n .put(\"messages\", new JSONArray()\n .put(new JSONObject()\n .put(\"content\", \"You are a helpful assistant\")\n .put(\"role\", \"system\"))\n .put(new JSONObject()\n .put(\"content\", \"Hi\")\n .put(\"role\", \"user\")))\n .put(\"model\", \"deepseek-chat\")\n .put(\"frequency_penalty\", 0)\n .put(\"max_tokens\", 2048)\n .put(\"presence_penalty\", 0)\n .put(\"response_format\", new JSONObject()\n .put(\"type\", \"text\"))\n .put(\"stop\", JSONObject.NULL)\n .put(\"stream\", false)\n .put(\"stream_options\", JSONObject.NULL)\n .put(\"temperature\", 1)\n .put(\"top_p\", 1)\n .put(\"tools\", JSONObject.NULL)\n .put(\"tool_choice\", \"none\")\n .put(\"logprobs\", false)\n .put(\"top_logprobs\", JSONObject.NULL);\n\n HttpHeaders headers = new HttpHeaders();\n headers.add(\"Content-Type\", \"application/json\");\n headers.add(\"Accept\", \"application/json\");\n headers.add(\"Authorization\", \"Bearer sk-405a7c19361140ac83fcfac30187d0a3\");\n\n JSONObject response = Https.post(\n \"https://api.deepseek.com/chat/completions\",\n requestBody,\n headers\n );\n\n return \"\";\n }\n}\n"}, "a10061e6dfe8084bd9da316451f66895ebf64704": {"t": 1785770712.1266625, "n": 2054, "h": "6b98b897d438fda3", "c": "package com.github.backend.service.impl.Impls;\n\nimport com.github.backend.service.DeepseekService;\nimport com.github.backend.utils.Https;\nimport com.github.dto.deepseek.DeepseekChatRequest;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\nimport org.springframework.http.HttpHeaders;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class DeepseekServiceImpl implements DeepseekService {\n\n @Override\n public String deepseekChatRespo(DeepseekChatRequest deepseekChatRequest) {\n JSONObject requestBody = new JSONObject()\n .put(\"messages\", new JSONArray()\n .put(new JSONObject()\n .put(\"content\", \"You are a helpful assistant\")\n .put(\"role\", \"system\"))\n .put(new JSONObject()\n .put(\"content\", \"Hi\")\n .put(\"role\", \"user\")))\n .put(\"model\", \"deepseek-chat\")\n .put(\"frequency_penalty\", 0)\n .put(\"max_tokens\", 2048)\n .put(\"presence_penalty\", 0)\n .put(\"response_format\", new JSONObject()\n .put(\"type\", \"text\"))\n .put(\"stop\", JSONObject.NULL)\n .put(\"stream\", false)\n .put(\"stream_options\", JSONObject.NULL)\n .put(\"temperature\", 1)\n .put(\"top_p\", 1)\n .put(\"tools\", JSONObject.NULL)\n .put(\"tool_choice\", \"none\")\n .put(\"logprobs\", false)\n .put(\"top_logprobs\", JSONObject.NULL);\n\n HttpHeaders headers = new HttpHeaders();\n headers.add(\"Content-Type\", \"application/json\");\n headers.add(\"Accept\", \"application/json\");\n headers.add(\"Authorization\", \"Bearer sk-405a7c19361140ac83fcfac30187d0a3\");\n\n JSONObject response = Https.post(\n \"https://api.deepseek.com/chat/completions\",\n requestBody,\n headers\n );\n\n return \"\";\n }\n}\n"}}}}