cssxsh / mirai-openai-plugin

Mirai Console OpenAI ChatBot 插件
GNU Affero General Public License v3.0
130 stars 14 forks source link

NoTransformationFoundException, server: cloudflare #26

Closed MikogoIT closed 1 year ago

MikogoIT commented 1 year ago
2023-03-30 10:23:23 W/MiraiOpenAiListener: MiraiOpenAiListener with GroupMessageEvent(group=809508660, senderName=透透羽宝, sender=1065005382, permission=MEMBER, message=[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913]chat)
io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class xyz.cssxsh.openai.ErrorInfoWrapper
with response from https://api.openai.com/v1/chat/completions:
status: 421 
response headers: 
cf-ray: 7afce3e92cf09fa9-SIN
, content-length: 573
, content-type: text/html
, date: Thu, 30 Mar 2023 02:23:23 GMT
, server: cloudflare

    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:93)
    at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invokeSuspend(OpenAiClient.kt:108)
    at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
    at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.validateResponse(HttpCallValidator.kt:47)
    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.access$validateResponse(HttpCallValidator.kt:40)
    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator$Companion$install$3.invokeSuspend(HttpCallValidator.kt:148)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
    at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

2023-03-30 10:23:23 V/Bot.2782268437: Group(809508660) <- [mirai:quote:[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913], content=chat]聊天已终止

更改API后问题仍然存在

WJHXD1B commented 1 year ago

Me,too

cssxsh commented 1 year ago

截图是坏文明

MikogoIT commented 1 year ago

大佬需要哪些信息,我给您复制

cssxsh commented 1 year ago

image

日志文件在 logs 下面

MikogoIT commented 1 year ago

image 是这个log吗(

cssxsh commented 1 year ago

我都说了不要截图了

MikogoIT commented 1 year ago

我都说了不要截图了 2023-03-30 10:23:23 W/MiraiOpenAiListener: MiraiOpenAiListener with GroupMessageEvent(group=809508660, senderName=透透羽宝, sender=1065005382, permission=MEMBER, message=[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913]chat) io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class xyz.cssxsh.openai.ErrorInfoWrapper with response from https://api.openai.com/v1/chat/completions: status: 421 response headers: cf-ray: 7afce3e92cf09fa9-SIN , content-length: 573 , content-type: text/html , date: Thu, 30 Mar 2023 02:23:23 GMT , server: cloudflare

at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:93)
at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invokeSuspend(OpenAiClient.kt:108)
at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
at mirai-openai-plugin-1.4.0.mirai2.jar//xyz.cssxsh.openai.OpenAiClient$http$1$4$1.invoke(OpenAiClient.kt)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.validateResponse(HttpCallValidator.kt:47)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator.access$validateResponse(HttpCallValidator.kt:40)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.client.plugins.HttpCallValidator$Companion$install$3.invokeSuspend(HttpCallValidator.kt:148)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
at mirai-openai-plugin-1.4.0.mirai2.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

2023-03-30 10:23:23 V/Bot.2782268437: Group(809508660) <- [mirai:quote:[mirai:source:ids=[825893], internalIds=[1323162258], from group 1065005382 to 809508660 at 1680142913], content=chat]聊天已终止

MikogoIT commented 1 year ago

大佬,“NoTransformationFoundException, server: cloudflare”这个是我的网络问题导致的吗?

cssxsh commented 1 year ago

https://github.com/cssxsh/mirai-openai-plugin/blob/dc5c28ceed2629ea23bdf3ca67100702a2f1bfd9/README.md?plain=1#L13-L15

看readme的更新

MikogoIT commented 1 year ago

ok可以了,但是似乎预设语境无法使用了