Skip to content

Commit

Permalink
Fix loop counter when generating embeddings
Browse files Browse the repository at this point in the history
  • Loading branch information
wd-hopkins authored and Houndie committed Nov 25, 2024
1 parent c006029 commit 0a126f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agent/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (s *Service) generateCompletion(ctx context.Context, integrationID, apiToke
var messages []copilot.ChatMessage

// Create embeddings from user messages
for i := len(req.Messages) - 1; i >= 0; i++ {
for i := len(req.Messages) - 1; i >= 0; i-- {
msg := req.Messages[i]
if msg.Role != "user" {
continue
Expand Down

0 comments on commit 0a126f4

Please sign in to comment.