File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ function translate(query, completion) {
49
49
if ( isChatGPTModel ) {
50
50
body . messages = [
51
51
{ role : "system" , content : prompt } ,
52
- { role : "user" , content : query . text } ,
52
+ { role : "user" , content : `" ${ query . text } "` } ,
53
53
] ;
54
54
} else {
55
55
body . prompt = `${ prompt } :\n\n"${ query . text } " =>` ;
@@ -95,14 +95,14 @@ function translate(query, completion) {
95
95
} else {
96
96
targetTxt = choices [ 0 ] . text . trim ( ) ;
97
97
}
98
- if ( ! isChatGPTModel ) {
99
- if ( targetTxt . startsWith ( '"' ) ) {
100
- targetTxt = targetTxt . slice ( 1 ) ;
101
- }
102
- if ( targetTxt . endsWith ( '"' ) ) {
103
- targetTxt = targetTxt . slice ( 0 , - 1 ) ;
104
- }
98
+
99
+ if ( targetTxt . startsWith ( '"' ) ) {
100
+ targetTxt = targetTxt . slice ( 1 ) ;
105
101
}
102
+ if ( targetTxt . endsWith ( '"' ) ) {
103
+ targetTxt = targetTxt . slice ( 0 , - 1 ) ;
104
+ }
105
+
106
106
completion ( {
107
107
result : {
108
108
from : query . detectFrom ,
You can’t perform that action at this time.
0 commit comments