mirror of
https://github.com/jie65535/JChatGPT.git
synced 2025-06-02 17:39:10 +08:00
Remove crazy KFC function
This commit is contained in:
parent
e387cdc1f0
commit
caedf97b25
@ -351,9 +351,6 @@ object JChatGPT : KotlinPlugin(
|
|||||||
|
|
||||||
// IP所在地查询
|
// IP所在地查询
|
||||||
IpAddressQuery(),
|
IpAddressQuery(),
|
||||||
|
|
||||||
// 疯狂星期四
|
|
||||||
CrazyKfc(),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
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.*
|
|
||||||
import java.time.DayOfWeek
|
|
||||||
import java.time.OffsetDateTime
|
|
||||||
|
|
||||||
class CrazyKfc : BaseAgent(
|
|
||||||
tool = Tool.function(
|
|
||||||
name = "crazyThursday",
|
|
||||||
description = "获取一条KFC疯狂星期四文案",
|
|
||||||
parameters = Parameters.Empty
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
/**
|
|
||||||
* 仅周四可用
|
|
||||||
*/
|
|
||||||
override val isEnabled: Boolean
|
|
||||||
get() = OffsetDateTime.now().dayOfWeek == DayOfWeek.THURSDAY
|
|
||||||
|
|
||||||
override suspend fun execute(args: JsonObject?): String {
|
|
||||||
val response = httpClient.get("https://api.52vmy.cn/api/wl/yan/kfc")
|
|
||||||
return response.bodyAsText()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user