File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 10
10
"appcast" : " https://raw.githubusercontent.com/yetone/bob-plugin-openai-polisher/main/appcast.json" ,
11
11
"minBobVersion" : " 0.5.0" ,
12
12
"options" : [
13
+ {
14
+ "identifier" : " api_url" ,
15
+ "type" : " text" ,
16
+ "title" : " API URL" ,
17
+ "defaultValue" : " https://api.openai.com" ,
18
+ "desc" : " 如果您的网络环境需要代理才能访问 OpenAI API, 可在这里修改为反代 API 的地址 默认为 https://api.openai.com"
19
+ },
13
20
{
14
21
"identifier" : " api_keys" ,
15
22
"type" : " text" ,
57
64
]
58
65
}
59
66
]
60
- }
67
+ }
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ function translate(query, completion) {
20
20
}
21
21
switch ( query . detectFrom ) {
22
22
case "zh-Hant" :
23
+ prompt = "潤色此句" ;
24
+ if ( detailedPolishingMode ) {
25
+ prompt = `${ prompt } 。請列出修改項目,並簡述修改原因` ;
26
+ }
27
+ break ;
23
28
case "zh-Hans" :
24
29
prompt = "润色此句" ;
25
30
if ( detailedPolishingMode ) {
@@ -73,8 +78,8 @@ function translate(query, completion) {
73
78
const resp = await $http . request ( {
74
79
method : "POST" ,
75
80
url :
76
- "https://api.openai.com/v1" +
77
- ( isChatGPTModel ? "/chat/completions" : "/completions" ) ,
81
+ $option . api_url +
82
+ ( isChatGPTModel ? "/v1/ chat/completions" : "/v1 /completions" ) ,
78
83
header,
79
84
body,
80
85
} ) ;
You can’t perform that action at this time.
0 commit comments