prise en charge des outils + weather
This commit is contained in:
1 parent
a36f1231cd
commit
0a6ffab050
14 files changed
+623
-113
No files matched your search
@@ -2,7 +2,6 @@ package handlers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -102,12 +101,11 @@ func (h *ChatHandler) NewChatMessage(c *echo.Context) error {
|
||||
|
||||
for {
|
||||
chunk := <-chunkChan
|
||||
slog.Info("Chunk", "role", chunk.Role, "content", chunk.Content, "reasoning", chunk.Reasoning)
|
||||
enc.Encode(chunk)
|
||||
http.NewResponseController(c.Response()).Flush()
|
||||
if chunk.Done {
|
||||
return nil
|
||||
}
|
||||
enc.Encode(chunk)
|
||||
http.NewResponseController(c.Response()).Flush()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -130,6 +128,7 @@ func (h *ChatHandler) Get(c *echo.Context) error {
|
||||
teamID := c.Param("space")
|
||||
chatID := c.Param("id")
|
||||
chatWithMessages, err := h.chatService.GetChatWithMessages(userID, teamID, chatID)
|
||||
|
||||
if err != nil {
|
||||
c.Logger().Error("error getting chat with messages", "error", err)
|
||||
return echo.NewHTTPError(http.StatusBadRequest, "error getting chat")
|
||||
|
||||
Reference in new issue
Block a user