Skip to content

Commit

Permalink
update the output style for message history in hive chat
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed Jan 2, 2025
1 parent 2c96873 commit 31e33a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions handlers/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (ch *ChatHandler) CreateChat(w http.ResponseWriter, r *http.Request) {
})
return
}

chat := &db.Chat{
ID: xid.New().String(),
WorkspaceID: request.WorkspaceID,
Expand Down Expand Up @@ -221,7 +221,8 @@ func (ch *ChatHandler) SendMessage(w http.ResponseWriter, r *http.Request) {
messageHistory := make([]map[string]string, len(recentHistory))
for i, msg := range recentHistory {
messageHistory[i] = map[string]string{
string(msg.Role): msg.Message,
"role": string(msg.Role),
"content": msg.Message,
}
}

Expand Down

0 comments on commit 31e33a1

Please sign in to comment.