Skip to content

Commit 02ef3bb

Browse files
committed
Rename package ChatPlugins to ChatPlugin
1 parent 19f53cb commit 02ef3bb

File tree

10 files changed

+38
-6
lines changed

10 files changed

+38
-6
lines changed

Core/Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ let package = Package(
177177
.target(
178178
name: "ChatService",
179179
dependencies: [
180-
"ChatPlugins",
180+
"ChatPlugin",
181181
"ChatContextCollector",
182182
"OpenAIService",
183183
"Environment",
@@ -186,11 +186,12 @@ let package = Package(
186186
]
187187
),
188188
.target(
189-
name: "ChatPlugins",
189+
name: "ChatPlugin",
190190
dependencies: [
191191
"OpenAIService",
192192
"Environment",
193193
.product(name: "Terminal", package: "Tool"),
194+
.product(name: "PythonKit", package: "PythonKit"),
194195
]
195196
),
196197
.target(
File renamed without changes.
File renamed without changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import Environment
2+
import Foundation
3+
import OpenAIService
4+
import PythonKit
5+
6+
public actor SearchChatPlugin: ChatPlugin {
7+
public static var command: String { "search" }
8+
public nonisolated var name: String { "Search" }
9+
10+
let chatGPTService: any ChatGPTServiceType
11+
var isCancelled = false
12+
weak var delegate: ChatPluginDelegate?
13+
14+
public init(inside chatGPTService: any ChatGPTServiceType, delegate: ChatPluginDelegate) {
15+
self.chatGPTService = chatGPTService
16+
self.delegate = delegate
17+
}
18+
19+
public func send(content: String, originalMessage: String) async {
20+
21+
}
22+
23+
public func cancel() async {
24+
isCancelled = true
25+
}
26+
27+
public func stopResponding() async {
28+
isCancelled = true
29+
}
30+
}
31+
File renamed without changes.

Core/Sources/ChatService/ChatPluginController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ChatPlugins
1+
import ChatPlugin
22
import Combine
33
import Foundation
44
import OpenAIService
@@ -102,13 +102,13 @@ final class ChatPluginController {
102102
// MARK: - ChatPluginDelegate
103103

104104
extension ChatPluginController: ChatPluginDelegate {
105-
public func pluginDidStartResponding(_: ChatPlugins.ChatPlugin) {
105+
public func pluginDidStartResponding(_: ChatPlugin) {
106106
Task {
107107
await chatGPTService.markReceivingMessage(true)
108108
}
109109
}
110110

111-
public func pluginDidEndResponding(_: ChatPlugins.ChatPlugin) {
111+
public func pluginDidEndResponding(_: ChatPlugin) {
112112
Task {
113113
await chatGPTService.markReceivingMessage(false)
114114
}

Core/Sources/ChatService/ChatService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ChatContextCollector
2-
import ChatPlugins
2+
import ChatPlugin
33
import Combine
44
import Foundation
55
import OpenAIService
File renamed without changes.

0 commit comments

Comments
 (0)