mirror of
https://github.com/jie65535/JChatGPT.git
synced 2025-12-15 18:41:36 +08:00
Add WebSearch Agent
This commit is contained in:
16
src/main/kotlin/tools/BaseAgent.kt
Normal file
16
src/main/kotlin/tools/BaseAgent.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
package top.jie65535.mirai.tools
|
||||
|
||||
import com.aallam.openai.api.chat.Tool
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
|
||||
abstract class BaseAgent(
|
||||
val tool: Tool
|
||||
) {
|
||||
open val isEnabled: Boolean = true
|
||||
|
||||
abstract suspend fun execute(args: JsonObject): String
|
||||
|
||||
override fun toString(): String {
|
||||
return "${tool.function.name}: ${tool.function.description}"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user