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