diff --git a/Chat.go b/Chat.go index fe68a0a..97fe8d9 100644 --- a/Chat.go +++ b/Chat.go @@ -177,12 +177,12 @@ func generateChatHTML(c *fiber.Ctx) string { } } - out, err := messageUserPlaceholderTmpl.Execute(pongo2.Context{}) - if err != nil { - fmt.Println("Error executing message user placeholder template") - panic(err) - } - htmlString += out + // out, err := messagesPlaceholderTmpl.Execute(pongo2.Context{}) + // if err != nil { + // fmt.Println("Error executing message user placeholder template") + // panic(err) + // } + // htmlString += out htmlString += "" diff --git a/Request.go b/Request.go index 80d2e22..864b2c4 100644 --- a/Request.go +++ b/Request.go @@ -93,6 +93,8 @@ func GeneratePlaceholderHTML(c *fiber.Ctx, message string, selectedLLMIds []stri messageOut, _ := botTmpl.Execute(pongo2.Context{"IsPlaceholder": true, "SelectedLLMs": selectedLLMs, "ConversationAreaId": position + 1}) out += messageOut + // defer sendEvent("hide-placeholder", "") + return out } diff --git a/main.go b/main.go index 19c1eff..152df8f 100644 --- a/main.go +++ b/main.go @@ -16,20 +16,20 @@ import ( ) var ( - userTmpl *pongo2.Template - botTmpl *pongo2.Template - selectBtnTmpl *pongo2.Template - modelPopoverTmpl *pongo2.Template - usagePopoverTmpl *pongo2.Template - settingPopoverTmpl *pongo2.Template - messageEditTmpl *pongo2.Template - conversationPopoverTmpl *pongo2.Template - welcomeChatTmpl *pongo2.Template - chatInputTmpl *pongo2.Template - explainLLMconvChatTmpl *pongo2.Template - messageUserPlaceholderTmpl *pongo2.Template - clients = make(map[chan SSE]bool) - mu sync.Mutex + userTmpl *pongo2.Template + botTmpl *pongo2.Template + selectBtnTmpl *pongo2.Template + modelPopoverTmpl *pongo2.Template + usagePopoverTmpl *pongo2.Template + settingPopoverTmpl *pongo2.Template + messageEditTmpl *pongo2.Template + conversationPopoverTmpl *pongo2.Template + welcomeChatTmpl *pongo2.Template + chatInputTmpl *pongo2.Template + explainLLMconvChatTmpl *pongo2.Template + messagesPlaceholderTmpl *pongo2.Template + clients = make(map[chan SSE]bool) + mu sync.Mutex ) // SSE event structure @@ -63,7 +63,7 @@ func main() { welcomeChatTmpl = pongo2.Must(pongo2.FromFile("views/partials/welcome-chat.html")) chatInputTmpl = pongo2.Must(pongo2.FromFile("views/partials/chat-input.html")) explainLLMconvChatTmpl = pongo2.Must(pongo2.FromFile("views/partials/explain-llm-conv-chat.html")) - messageUserPlaceholderTmpl = pongo2.Must(pongo2.FromFile("views/partials/message-user-placeholder.html")) + messagesPlaceholderTmpl = pongo2.Must(pongo2.FromFile("views/partials/messages-placeholder.html")) // Import HTML using django engine/template engine := django.New("./views", ".html") diff --git a/views/partials/chat-input.html b/views/partials/chat-input.html index c1771a0..ceedca4 100644 --- a/views/partials/chat-input.html +++ b/views/partials/chat-input.html @@ -27,7 +27,7 @@