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) {
4949 if ( isChatGPTModel ) {
5050 body . messages = [
5151 { role : "system" , content : prompt } ,
52- { role : "user" , content : query . text } ,
52+ { role : "user" , content : `" ${ query . text } "` } ,
5353 ] ;
5454 } else {
5555 body . prompt = `${ prompt } :\n\n"${ query . text } " =>` ;
@@ -95,14 +95,14 @@ function translate(query, completion) {
9595 } else {
9696 targetTxt = choices [ 0 ] . text . trim ( ) ;
9797 }
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 ) ;
105101 }
102+ if ( targetTxt . endsWith ( '"' ) ) {
103+ targetTxt = targetTxt . slice ( 0 , - 1 ) ;
104+ }
105+
106106 completion ( {
107107 result : {
108108 from : query . detectFrom ,
You can’t perform that action at this time.
0 commit comments