diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-03-02 12:19:50 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-03-02 12:19:50 +0300 |
| commit | 8458edf5a874903a108f361a4a4795a445254061 (patch) | |
| tree | 1f760754c9430b33b74044653916540b7fb332e5 /bot.go | |
| parent | 07b06bb0d32ce86b8aa1b8d6157eedca89c52152 (diff) | |
Enha: interrupt llm and tool both
Diffstat (limited to 'bot.go')
| -rw-r--r-- | bot.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -745,7 +745,7 @@ func sendMsgToLLM(body io.Reader) { } interrupt: if interruptResp { // read bytes, so it would not get into beginning of the next req - interruptResp = false + // interruptResp = false logger.Info("interrupted bot response", "chunk_counter", counter) streamDone <- true break @@ -799,6 +799,7 @@ func showSpinner() { } func chatRound(r *models.ChatRoundReq) error { + interruptResp = false botRespMode = true go showSpinner() updateStatusLine() @@ -964,6 +965,9 @@ out: } // Strip think blocks before parsing for tool calls respTextNoThink := thinkBlockRE.ReplaceAllString(respText.String(), "") + if interruptResp { + return nil + } if findCall(respTextNoThink, toolResp.String()) { return nil } |
