Skip to content

Commit 348c8fa

Browse files
committed
Make systemPrompt and extraSystemPrompt published
1 parent 7e15e1e commit 348c8fa

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Core/Sources/ChatService/ChatService.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public final class ChatService: ObservableObject {
2020
let pluginController: ChatPluginController
2121
let contextController: DynamicContextController
2222
var cancellable = Set<AnyCancellable>()
23-
var systemPrompt = defaultSystemPrompt
24-
var extraSystemPrompt = ""
23+
@Published public internal(set) var systemPrompt = defaultSystemPrompt
24+
@Published public internal(set) var extraSystemPrompt = ""
2525

2626
public init<T: ChatGPTServiceType>(chatGPTService: T) {
2727
self.chatGPTService = chatGPTService
@@ -61,6 +61,11 @@ public final class ChatService: ObservableObject {
6161
await pluginController.cancel()
6262
await chatGPTService.clearHistory()
6363
}
64+
65+
public func resetPrompt() async {
66+
systemPrompt = defaultSystemPrompt
67+
extraSystemPrompt = ""
68+
}
6469

6570
public func deleteMessage(id: String) async {
6671
await chatGPTService.mutateHistory { messages in

0 commit comments

Comments
 (0)