feat: adjust prompt for translation
This commit is contained in:
parent
899491e867
commit
ed46c2b274
2 changed files with 15 additions and 3 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package prompts
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func General() string {
|
||||
return "You are a helpful assistant."
|
||||
|
|
@ -8,7 +11,14 @@ func General() string {
|
|||
|
||||
func Translate(targetLang string) string {
|
||||
return fmt.Sprintf(
|
||||
"You are a helpful assistant. Your task is to help translate the following text to %s. You should not interpret the text. You should structure the translated text to look natural in native %s, while keeping the meaning unchanged.",
|
||||
targetLang, targetLang,
|
||||
strings.Join([]string{
|
||||
"You are a helpful assistant.",
|
||||
"Your task is to help translate the text sent by the user into %s.",
|
||||
"You should never interpret the user's text, but only translate it.",
|
||||
"You should structure the translated text to sound natural in native %s while keeping the meanings unchanged.",
|
||||
"If the user's text contains only a single word, please also add a brief explanation in %s, of the meaning of the original word.",
|
||||
"The first text to be translated is:",
|
||||
}, " \n"),
|
||||
targetLang, targetLang, targetLang,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue