diff options
| author | Grail Finder <wohilas@gmail.com> | 2025-12-31 15:04:45 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2025-12-31 15:04:45 +0300 |
| commit | 03e1f5dc6dc12a0128dcff3f2a0b8cb128bf04a8 (patch) | |
| tree | 3fae87d5adf740c8117d12eb53db42c0fd8bb7f0 | |
| parent | 88bf281dd9e52d85caaccb628520034783be7f98 (diff) | |
Fix: mistral wants tool call id to be len 9
| -rw-r--r-- | bot.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -873,7 +873,8 @@ func findCall(msg, toolCall string, tv *tview.TextView) { // we got here => last msg recognized as a tool call (correct or not) // make sure it has ToolCallID if chatBody.Messages[len(chatBody.Messages)-1].ToolCallID == "" { - chatBody.Messages[len(chatBody.Messages)-1].ToolCallID = randString(6) + // Tool call IDs should be alphanumeric strings with length 9! + chatBody.Messages[len(chatBody.Messages)-1].ToolCallID = randString(9) } // Ensure lastToolCall.ID is set, fallback to assistant message's ToolCallID if lastToolCall.ID == "" { |
