Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom base URL for OpenAiService #2

Closed
wants to merge 1 commit into from

Conversation

ljcleo
Copy link

@ljcleo ljcleo commented Jul 31, 2023

According to TheoKanning/openai-java#234, it is possible to use a custom base URL (e.g. https://api.openai-proxy.com/) to replace OpenAI's official API (https://api.openai.com/). This can resolve certain issues like the one mentioned in #1.

P.S. there's a pull request for openai-java that could simplify the implementation, but it's not merged yet.

update openai-java version
include .vscode in gitignore
@982074664
Copy link

兄弟你这编译出来好像报错啊
(我看这个代理链接你应该是国内的吧)

@ljcleo
Copy link
Author

ljcleo commented Aug 4, 2023

具体报的什么错呢?我在本地编译运行没问题的

@982074664
Copy link

具体报的什么错呢?我在本地编译运行没问题的

log找不到了,大佬要不发一下你的?

@982074664
Copy link

[23:01:58 WARN]: Unexpected exception while parsing console command "craftgpt"
org.bukkit.command.CommandException: Cannot execute command 'craftgpt' in plugin CraftGPT v1.3 - plugin is disabled.
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:1020) ~[purpur-1.20.1.jar:git-Purpur-2016]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchServerCommand(CraftServer.java:983) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:541) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:488) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1421) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1192) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2016]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

@982074664
Copy link

[23:03:15 ERROR]: Error occurred while enabling CraftGPT v1.3 (Is it up to date?)
java.lang.NoClassDefFoundError: net/kyori/adventure/platform/bukkit/BukkitAudiences
at com.theaiguy_.craftgpt.CraftGPT.onEnable(CraftGPT.java:29) ~[unnamed.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.20.1.jar:git-Purpur-2016]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at com.rylinaux.plugman.util.PaperPluginUtil.load(PaperPluginUtil.java:411) ~[PlugManX.jar:?]
at com.rylinaux.plugman.util.PaperPluginUtil.load(PaperPluginUtil.java:364) ~[PlugManX.jar:?]
at com.rylinaux.plugman.util.PaperPluginUtil.reload(PaperPluginUtil.java:509) ~[PlugManX.jar:?]
at com.rylinaux.plugman.command.ReloadCommand.execute(ReloadCommand.java:125) ~[PlugManX.jar:?]
at com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:97) ~[PlugManX.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:1020) ~[purpur-1.20.1.jar:git-Purpur-2016]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchServerCommand(CraftServer.java:983) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:541) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:488) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1421) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1192) ~[purpur-1.20.1.jar:git-Purpur-2016]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2016]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.kyori.adventure.platform.bukkit.BukkitAudiences
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:185) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:152) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 22 more

@ljcleo
Copy link
Author

ljcleo commented Aug 10, 2023

Java 17 + 最新版 paper/purpur(不改配置)+ CraftGPT(不加其它插件)可以正常运行,检查一下是不是服务器配置问题或者有插件冲突

@982074664
Copy link

大佬私发一下你编译的吧
可能是我编译的有问题

@ljcleo
Copy link
Author

ljcleo commented Aug 30, 2023

大佬私发一下你编译的吧 可能是我编译的有问题

发布在这了:https://github.com/ljcleo/CraftGPT/releases/tag/v1.3

@TheAIguy-dev
Copy link
Owner

Sorry for such a long wait. The plugin was updated.
I saw some error messages in this pull request, so maybe you should create an issue if you still have it.
Now I probably will fix it faster 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants