Skip to content

Commit

Permalink
Merge pull request #18 from 954478466/main
Browse files Browse the repository at this point in the history
feat: 自定义反代
  • Loading branch information
akl7777777 committed Jul 24, 2023
2 parents b33cd88 + 48429ae commit f7c2420
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions appcast.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"identifier": "com.akl.bob-plugin-akl-chatgpt-free-translate",
"versions": [
{
"version": "1.2.8",
"desc": "自定义反代",
"sha256": "941b0bd39e71fe144d050ed794c869370d790d74c633d006db93e2941a4a4450",
"url": "https://github.com/akl7777777/bob-plugin-akl-chatgpt-free-translate/releases/download/v1.2.8/bob-plugin-akl-chatgpt-free-translate_v1.2.8.bobplugin",
"minBobVersion": "0.5.0"
},
{
"version": "1.2.7",
"desc": "修复备用1被墙问题",
Expand Down
9 changes: 8 additions & 1 deletion src/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"identifier": "com.akl.bob-plugin-akl-chatgpt-free-translate",
"version": "1.2.7",
"version": "1.2.8",
"category": "translate",
"name": "Free ChatGPT",
"summary": "免秘钥免启动任何服务调用ChatGPT",
Expand Down Expand Up @@ -55,6 +55,13 @@
"title": "自定义prompt",
"desc": "模式选择自定义prompt时填写,GPT会按照你指定的prompt进行回复"
},
{
"identifier": "url",
"type": "text",
"defaultValue": "",
"title": "url",
"desc": "支持填写自己的反代地址(可以为空),记得下面线路选择填key的线路"
},
{
"identifier": "api_key",
"type": "text",
Expand Down
3 changes: 2 additions & 1 deletion src/sc2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const file = require("./file");
async function translate(query, source_lang, target_lang, translate_text, completion) {
try {
let api_key = $option.api_key;
let url = $option.url;
let mode = $option.mode;
let model = $option.model;
let prompt = $option.prompt;
Expand All @@ -31,7 +32,7 @@ async function translate(query, source_lang, target_lang, translate_text, comple
const L = Date.now();
const resp = await $http.request({
method: "POST",
url: random_safe('aHR0cHM6Ly9haS5mYWtlb3Blbi5jb20vdjEvY2hhdC9jb21wbGV0aW9ucw=='),
url: url || random_safe('aHR0cHM6Ly9haS5mYWtlb3Blbi5jb20vdjEvY2hhdC9jb21wbGV0aW9ucw=='),
body: {
messages: A,
model:model,
Expand Down

0 comments on commit f7c2420

Please sign in to comment.