feat: add translate command

This commit is contained in:
Yiyang Kang 2023-03-08 02:28:26 +08:00
parent eecbaf18b3
commit 899491e867
Signed by: kkyy
GPG key ID: 80FD317ECAF06CC3
9 changed files with 236 additions and 9 deletions

14
openai/prompts/prompts.go Normal file
View file

@ -0,0 +1,14 @@
package prompts
import "fmt"
func General() string {
return "You are a helpful assistant."
}
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,
)
}