File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1010 "appcast" : " https://raw.githubusercontent.com/yetone/bob-plugin-openai-polisher/main/appcast.json" ,
1111 "minBobVersion" : " 0.5.0" ,
1212 "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+ },
1320 {
1421 "identifier" : " api_keys" ,
1522 "type" : " text" ,
5764 ]
5865 }
5966 ]
60- }
67+ }
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ function translate(query, completion) {
2020 }
2121 switch ( query . detectFrom ) {
2222 case "zh-Hant" :
23+ prompt = "潤色此句" ;
24+ if ( detailedPolishingMode ) {
25+ prompt = `${ prompt } 。請列出修改項目,並簡述修改原因` ;
26+ }
27+ break ;
2328 case "zh-Hans" :
2429 prompt = "润色此句" ;
2530 if ( detailedPolishingMode ) {
@@ -73,8 +78,8 @@ function translate(query, completion) {
7378 const resp = await $http . request ( {
7479 method : "POST" ,
7580 url :
76- "https://api.openai.com/v1" +
77- ( isChatGPTModel ? "/chat/completions" : "/completions" ) ,
81+ $option . api_url +
82+ ( isChatGPTModel ? "/v1/ chat/completions" : "/v1 /completions" ) ,
7883 header,
7984 body,
8085 } ) ;
You can’t perform that action at this time.
0 commit comments