mirror of
https://github.com/jie65535/JChatGPT.git
synced 2025-10-20 17:13:37 +08:00
Add Epic free games query.
Disable ip address query.
This commit is contained in:
23
src/main/kotlin/tools/EpicFreeGame.kt
Normal file
23
src/main/kotlin/tools/EpicFreeGame.kt
Normal file
@@ -0,0 +1,23 @@
|
||||
package top.jie65535.mirai.tools
|
||||
|
||||
import com.aallam.openai.api.chat.Tool
|
||||
import com.aallam.openai.api.core.Parameters
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.client.statement.*
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
|
||||
class EpicFreeGame : BaseAgent(
|
||||
tool = Tool.function(
|
||||
name = "getEpicFreeGames",
|
||||
description = "可查询Epic免费游戏",
|
||||
parameters = Parameters.Empty
|
||||
)
|
||||
) {
|
||||
// https://docs.60s-api.viki.moe/
|
||||
|
||||
override suspend fun execute(args: JsonObject?): String {
|
||||
// https://docs.60s-api.viki.moe/254044293e0
|
||||
val response = httpClient.get("http://60s-api.viki.moe/v2/epic")
|
||||
return response.bodyAsText()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user