not sure why stderr to discard makes things funnier....
parent
30bd4311a5
commit
68b9010ed5
|
|
@ -302,7 +302,7 @@ func handleAPIChatBotGet(w http.ResponseWriter, r *http.Request) error {
|
|||
Messages string
|
||||
Prompt string
|
||||
}{
|
||||
Messages: string(messages),
|
||||
Messages: string(bytes.TrimPrefix(messages, prompt)),
|
||||
Prompt: string(prompt),
|
||||
})
|
||||
}
|
||||
|
|
@ -425,8 +425,8 @@ func chatBotGenerateAndFillInputF(ctx context.Context, cacheF, inputF, reversePr
|
|||
commands[1:]...,
|
||||
)
|
||||
command.Dir = Config.ChatBot.WD
|
||||
command.Stderr = io.Discard
|
||||
command.Stderr = log.Writer()
|
||||
command.Stderr = io.Discard
|
||||
|
||||
stdout, err := command.StdoutPipe()
|
||||
if err != nil {
|
||||
|
|
@ -467,6 +467,7 @@ func chatBotGenerateAndFillInputF(ctx context.Context, cacheF, inputF, reversePr
|
|||
return nil, err
|
||||
}
|
||||
|
||||
log.Printf("%s generated %q", reversePrompt, justNew)
|
||||
if !bytes.HasSuffix(append(priorContent, justNew...), []byte(reversePrompt)) {
|
||||
more, err := chatBotGenerateAndFillInputF(ctx, cacheF, inputF, reversePrompt, depth+1)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue