We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fdf923 commit 4315827Copy full SHA for 4315827
Core/Sources/ChatService/ChatService.swift
@@ -89,6 +89,13 @@ public final class ChatService: ObservableObject {
89
await pluginController.stopResponding()
90
await chatGPTService.stopReceivingMessage()
91
isReceivingMessage = false
92
+
93
+ // if it's stopped before the function finishes, remove the function call.
94
+ await memory.mutateHistory { history in
95
+ if history.last?.role == .assistant && history.last?.functionCall != nil {
96
+ history.removeLast()
97
+ }
98
99
}
100
101
public func clearHistory() async {
0 commit comments