Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
djthorpe committed Feb 2, 2025
1 parent 63b692b commit e559fb2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/llm/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ func (cmd *ChatCmd) Run(globals *Globals) error {
if !cmd.NoStream {
opts = append(opts, llm.WithStream(func(cc llm.Completion) {
if text := cc.Text(0); text != "" {
text = strings.ReplaceAll(text, "\n", " ")
fmt.Print("\r" + text)
count := strings.Count(text, "\n")
fmt.Print(strings.Repeat("\033[F", count) + strings.Repeat(" ", count) + "\r")
fmt.Print(text)
}
}))
}
Expand Down

0 comments on commit e559fb2

Please sign in to comment.