Use MessageRole constants elsewhere
This commit is contained in:
parent
5615051637
commit
f206334e72
@ -322,7 +322,7 @@ var replyCmd = &cobra.Command{
|
||||
|
||||
userReply := Message{
|
||||
ConversationID: conversation.ID,
|
||||
Role: "user",
|
||||
Role: MessageRoleUser,
|
||||
OriginalContent: messageContents,
|
||||
}
|
||||
|
||||
@ -366,12 +366,12 @@ var newCmd = &cobra.Command{
|
||||
messages := []Message{
|
||||
{
|
||||
ConversationID: conversation.ID,
|
||||
Role: "system",
|
||||
Role: MessageRoleSystem,
|
||||
OriginalContent: SystemPrompt(),
|
||||
},
|
||||
{
|
||||
ConversationID: conversation.ID,
|
||||
Role: "user",
|
||||
Role: MessageRoleUser,
|
||||
OriginalContent: messageContents,
|
||||
},
|
||||
}
|
||||
@ -411,11 +411,11 @@ var promptCmd = &cobra.Command{
|
||||
|
||||
messages := []Message{
|
||||
{
|
||||
Role: "system",
|
||||
Role: MessageRoleSystem,
|
||||
OriginalContent: SystemPrompt(),
|
||||
},
|
||||
{
|
||||
Role: "user",
|
||||
Role: MessageRoleUser,
|
||||
OriginalContent: message,
|
||||
},
|
||||
}
|
||||
|
@ -89,11 +89,11 @@ func (m *Message) RenderTTY() {
|
||||
|
||||
var roleStyle color.Style
|
||||
switch m.Role {
|
||||
case "system":
|
||||
case MessageRoleSystem:
|
||||
roleStyle = color.Style{color.HiRed}
|
||||
case "user":
|
||||
case MessageRoleUser:
|
||||
roleStyle = color.Style{color.HiGreen}
|
||||
case "assistant":
|
||||
case MessageRoleAssistant:
|
||||
roleStyle = color.Style{color.HiBlue}
|
||||
default:
|
||||
roleStyle = color.Style{color.FgWhite}
|
||||
|
Loading…
Reference in New Issue
Block a user