Skip to content

Commit

Permalink
add system role, so ChatGPT can act as someone
Browse files Browse the repository at this point in the history
  • Loading branch information
quantonganh committed Apr 12, 2023
1 parent f9f4787 commit 89a4ab8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Expand Up @@ -21,6 +21,7 @@ import (
)

const (
roleSystem = "system"
roleUser = "user"
roleAssistant = "assistant"

Expand Down Expand Up @@ -281,7 +282,12 @@ func main() {
fmt.Fprintln(textView, "[red::]You:[-]")
fmt.Fprintf(textView, "%s\n\n", content)

messages := make([]Message, 0)
messages := []Message{
{
Role: roleSystem,
Content: "You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible.",
},
}
if list.GetItemCount() > 0 && !isNewChat {
title, _ := list.GetItemText(list.GetCurrentItem())
if c, ok := m[title]; ok {
Expand Down

0 comments on commit 89a4ab8

Please sign in to comment.