Add WebSearch Agent

This commit is contained in:
2024-12-21 02:19:42 +08:00
parent 5cef899993
commit f91dbf8a6d
5 changed files with 146 additions and 17 deletions

View 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}"
}
}