{"repo": "1432647/pot-app-translate-plugin-gemini", "files": {"main.js": {"9d5c8a3f38e4bad6039c3bc5308e61391df20855": {"t": 1785745994.4928489, "n": 1738, "h": "56560ca01736de2b", "c": "async function translate(text, from, to, options) {\n const { config, utils } = options;\n const { tauriFetch: fetch } = utils;\n \n let { \n apiEndpoint = \"https://api.deepseek.com/chat/completions\", \n model = \"deepseek-chat\",\n apiKey,\n temperature = 0.1,\n top_p = 0.99,\n max_tokens = 2000\n } = config;\n \n // 设置默认请求路径\n // const requestPath = \"https://api.deepseek.com/chat/completions\";\n \n const headers = {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${apiKey}`\n }\n \n const body = {\n model: model, // 使用用户选择的模型\n messages: [\n {\n \"role\": \"system\",\n \"content\": \"You are a professional translation engine, please translate the text into a colloquial, professional, elegant and fluent content, without the style of machine translation. You must only translate the text content, never interpret it.\"\n },\n {\n \"role\": \"user\",\n \"content\": `Translate into ${to}:\\n${text}`\n }\n ],\n temperature: Number(temperature),\n top_p: Number(top_p),\n frequency_penalty: 0,\n presence_penalty: 0,\n max_tokens: Number(max_tokens)\n }\n \n let res = await fetch(apiEndpoint, {\n method: 'POST',\n url: apiEndpoint,\n headers: headers,\n body: {\n type: \"Json\",\n payload: body\n }\n });\n \n if (res.ok) {\n let result = res.data;\n return result.choices[0].message.content.trim().replace(/^\"|\"$/g, '');\n } else {\n throw `Http Request Error\\nHttp Status: ${res.status}\\n${JSON.stringify(res.data)}`;\n }\n}\n"}, "98551aba832b8fcc6ce71351bdc7c33f63dbaf35": {"t": 1785758624.9651313, "n": 1738, "h": "56560ca01736de2b", "c": "async function translate(text, from, to, options) {\n const { config, utils } = options;\n const { tauriFetch: fetch } = utils;\n \n let { \n apiEndpoint = \"https://api.deepseek.com/chat/completions\", \n model = \"deepseek-chat\",\n apiKey,\n temperature = 0.1,\n top_p = 0.99,\n max_tokens = 2000\n } = config;\n \n // 设置默认请求路径\n // const requestPath = \"https://api.deepseek.com/chat/completions\";\n \n const headers = {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${apiKey}`\n }\n \n const body = {\n model: model, // 使用用户选择的模型\n messages: [\n {\n \"role\": \"system\",\n \"content\": \"You are a professional translation engine, please translate the text into a colloquial, professional, elegant and fluent content, without the style of machine translation. You must only translate the text content, never interpret it.\"\n },\n {\n \"role\": \"user\",\n \"content\": `Translate into ${to}:\\n${text}`\n }\n ],\n temperature: Number(temperature),\n top_p: Number(top_p),\n frequency_penalty: 0,\n presence_penalty: 0,\n max_tokens: Number(max_tokens)\n }\n \n let res = await fetch(apiEndpoint, {\n method: 'POST',\n url: apiEndpoint,\n headers: headers,\n body: {\n type: \"Json\",\n payload: body\n }\n });\n \n if (res.ok) {\n let result = res.data;\n return result.choices[0].message.content.trim().replace(/^\"|\"$/g, '');\n } else {\n throw `Http Request Error\\nHttp Status: ${res.status}\\n${JSON.stringify(res.data)}`;\n }\n}\n"}, "c51ad20be2d0e37fc69aa1c5dd4b269cb8bfd06e": {"t": 1785758626.2311866, "n": 906, "h": "c2b3d3ff82796812", "c": "async function translate(text, from, to, options) {\n const { config, utils } = options;\n const { tauriFetch: fetch } = utils;\n let { requestPath: url } = config;\n let plain_text = text.replaceAll(\"/\", \"@@\");\n let encode_text = encodeURIComponent(plain_text);\n if (url === undefined || url.length === 0) {\n url = \"lingva.pot-app.com\"\n }\n if (!url.startsWith(\"http\")) {\n url = `https://${url}`;\n }\n const res = await fetch(`${url}/api/v1/${from}/${to}/${encode_text}`, {\n method: 'GET',\n });\n\n if (res.ok) {\n let result = res.data;\n const { translation } = result;\n if (translation) {\n return translation.replaceAll(\"@@\", \"/\");;\n } else {\n throw JSON.stringify(result.trim());\n }\n } else {\n throw `Http Request Error\\nHttp Status: ${res.status}\\n${JSON.stringify(res.data)}`;\n }\n}\n"}}, "info.json": {"9d5c8a3f38e4bad6039c3bc5308e61391df20855": {"t": 1785746265.9310393, "n": 1866, "h": "4c49278605afffa4", "c": "{\n \"id\": \"plugin.com.TzuLao.deepseek\",\n \"plugin_type\": \"translate\",\n \"icon\": \"deepseek.svg\",\n \"display\": \"deepseek\",\n \"homepage\": \"https://github.com/tzulao55/pot-app-translate-plugin-deepseek\",\n \"needs\": [\n {\n \"key\": \"apiEndpoint\",\n \"display\": \"API地址(可选)\",\n \"type\": \"input\",\n \"default\": \"https://api.deepseek.com/chat/completions\",\n \"attrs\": {\n \"placeholder\": \"https://api.deepseek.com/chat/completions\"\n }\n },\n {\n \"key\": \"model\",\n \"display\": \"模型选择(可选)\",\n \"type\": \"input\",\n \"default\": \"deepseek-chat\",\n \"attrs\": {\n \"placeholder\": \"deepseek-chat\"\n }\n },\n {\n \"key\": \"apiKey\",\n \"display\": \"API密钥(必填)\",\n \"type\": \"input\"\n },\n {\n \"key\": \"temperature\",\n \"display\": \"temperature(可选)\",\n \"type\": \"input\",\n \"min\": 0,\n \"max\": 2,\n \"step\": 0.1,\n \"default\": 0.1,\n \"attrs\": {\n \"placeholder\": \"0.1\"\n }\n },\n {\n \"key\": \"top_p\",\n \"display\": \"top_p(可选)\",\n \"type\": \"input\",\n \"min\": 0,\n \"max\": 1,\n \"step\": 0.01,\n \"default\": 0.99,\n \"attrs\": {\n \"placeholder\": \"0.99\"\n }\n },\n {\n \"key\": \"max_tokens\",\n \"display\": \"max_tokens(可选)\",\n \"type\": \"input\",\n \"min\": 100,\n \"max\": 4000,\n \"default\": 2000,\n \"attrs\": {\n \"placeholder\": \"2000\"\n }\n }\n ],\n \"language\": {\n \"auto\": \"auto\",\n \"zh_cn\": \"zh\",\n \"zh_tw\": \"zh_HANT\",\n \"en\": \"en\",\n \"ja\": \"ja\",\n \"ko\": \"ko\",\n \"fr\": \"fr\",\n \"es\": \"es\",\n \"ru\": \"ru\",\n \"de\": \"de\",\n \"it\": \"it\",\n \"tr\": \"tr\",\n \"pt_pt\": \"pt\",\n \"pt_br\": \"pt\",\n \"vi\": \"vi\",\n \"id\": \"id\",\n \"th\": \"th\",\n \"ms\": \"ms\",\n \"ar\": \"ar\",\n \"hi\": \"hi\",\n \"mn_cy\": \"mn\",\n \"mn_mo\": \"mn\",\n \"km\": \"km\",\n \"nb_no\": \"no\",\n \"nn_no\": \"no\",\n \"fa\": \"fa\"\n }\n}\n"}, "c51ad20be2d0e37fc69aa1c5dd4b269cb8bfd06e": {"t": 1785758623.2841835, "n": 722, "h": "7ac609cf08eca18b", "c": "{\n \"id\": \"plugin.com.pot-app.lingva\",\n \"plugin_type\": \"translate\",\n \"icon\": \"lingva.svg\",\n \"display\": \"Lingva\",\n \"homepage\": \"https://github.com/pot-app/pot-app-translate-plugin-template\",\n \"needs\": [{ \"key\": \"requestPath\", \"display\": \"请求地址\" }],\n \"language\": {\n \"auto\": \"auto\",\n \"zh_cn\": \"zh\",\n \"zh_tw\": \"zh_HANT\",\n \"en\": \"en\",\n \"ja\": \"ja\",\n \"ko\": \"ko\",\n \"fr\": \"fr\",\n \"es\": \"es\",\n \"ru\": \"ru\",\n \"de\": \"de\",\n \"it\": \"it\",\n \"tr\": \"tr\",\n \"pt_pt\": \"pt\",\n \"pt_br\": \"pt\",\n \"vi\": \"vi\",\n \"id\": \"id\",\n \"th\": \"th\",\n \"ms\": \"ms\",\n \"ar\": \"ar\",\n \"hi\": \"hi\",\n \"mn_cy\": \"mn\",\n \"mn_mo\": \"mn\",\n \"km\": \"km\",\n \"nb_no\": \"no\",\n \"nn_no\": \"no\",\n \"fa\": \"fa\"\n }\n}\n"}}}}