Skip to content

Commit

Permalink
preserve spaces in ai response
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Feb 4, 2025
1 parent 306d4b9 commit d563277
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions blockchain/blox.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"io"
"net/http"
"strings"
"sync"

"github.com/functionland/go-fula/wap/pkg/wifi"
Expand Down Expand Up @@ -639,8 +638,6 @@ func (bl *FxBlockchain) handleChatWithAI(ctx context.Context, from peer.ID, w ht
return // Channel closed
}

chunk = strings.TrimSpace(chunk) // Remove leading/trailing whitespace

if chunk == "" { // Skip empty chunks
continue
}
Expand Down Expand Up @@ -669,8 +666,6 @@ func (bl *FxBlockchain) handleChatWithAI(ctx context.Context, from peer.ID, w ht
newContent += choice.Delta.Content
}

newContent = strings.TrimSpace(newContent) // Remove whitespace

response := wifi.ChatWithAIResponse{
Status: true,
Msg: newContent,
Expand Down

0 comments on commit d563277

Please sign in to comment.