mirror of
https://github.com/ddaodan/minechatgpt.git
synced 2026-06-21 21:45:28 +08:00
2.7
- 多语言支持 - 配置文件添加双语注释 - 新增负载均衡,可轮询或随机选择API key - 优化构建配置,插件体积减小 - 项目规范化
This commit is contained in:
135
readme.md
135
readme.md
@@ -1,10 +1,9 @@
|
||||
# MineChatGPT
|
||||

|
||||
   
|
||||
    
|
||||
[](https://modrinth.com/plugin/minechatgpt) [](https://www.spigotmc.org/resources/minechatgpt.118963/)  
|
||||
   [](https://modrinth.com/plugin/minechatgpt/versions) [](https://www.spigotmc.org/resources/minechatgpt.118963/)
|
||||
|
||||
在Minecraft中与ChatGPT交流
|
||||
理论支持全版本,欢迎测试
|
||||
|
||||
所有的代码都是ChatGPT写的哦
|
||||
|
||||
@@ -12,6 +11,7 @@
|
||||
- OpenAPI格式
|
||||
- 自定义模型
|
||||
- ChatGPT反代
|
||||
- 负载均衡
|
||||
- 指令补全
|
||||
- 上下文对话
|
||||
- 多角色
|
||||
@@ -20,98 +20,52 @@
|
||||
## 安装
|
||||
1. 下载插件,放在plugins文件夹中
|
||||
2. 重启服务器
|
||||
> 为兼容更多版本,插件没有规定Bukkit API version,因此在较高版本加载插件时,控制台可能会出现以下错误信息,这属于正常现象。
|
||||
> ```
|
||||
> [Server thread/WARN]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
|
||||
> [Server thread/WARN]: Legacy plugin MineChatGPT v1.0 does not specify an api-version.
|
||||
> ```
|
||||
3. 打开配置文件`config.yml`,修改以下两项设置:
|
||||
```yaml
|
||||
# API 相关设置
|
||||
api:
|
||||
# 你的 OpenAI API key,用于身份验证
|
||||
# 获取 API key 的方法:访问 https://platform.openai.com/account/api-keys 并创建一个新的 API key
|
||||
key: "sk-your_openai_api_key"
|
||||
# OpenAI API 的基础 URL,用于构建请求
|
||||
base_url: "https://api.openai.com/v1"
|
||||
```
|
||||
> 为兼容更多版本,插件没有规定Bukkit API version,因此在较高版本加载插件时,控制台可能会出现以下错误信息,这属于正常现象。
|
||||
> ```
|
||||
> [Server thread/WARN]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
|
||||
> [Server thread/WARN]: Legacy plugin MineChatGPT v1.0 does not specify an api-version.
|
||||
> ```
|
||||
3. 打开配置文件`config.yml`,修改以下设置:
|
||||
```yaml
|
||||
# ======================================================
|
||||
# API Configuration
|
||||
# API 设置
|
||||
# ======================================================
|
||||
api:
|
||||
# Your OpenAI API keys, used for authentication
|
||||
# To obtain an API key, visit https://platform.openai.com/account/api-keys and create a new API key
|
||||
# 你的 OpenAI API key,用于身份验证
|
||||
# 获取 API key 的方法:访问 https://platform.openai.com/account/api-keys 并创建一个新的 API key
|
||||
keys:
|
||||
- "sk-your_openai_api_key_1"
|
||||
# You can add multiple API keys below
|
||||
# 可以添加多个API key
|
||||
# - "sk-your_openai_api_key_2"
|
||||
# - "sk-your_openai_api_key_3"
|
||||
|
||||
# API key selection method: "round_robin" or "random"
|
||||
# Round Robin: Use each API key in turn
|
||||
# Random: Randomly select an API key
|
||||
# API key 选择方法:"round_robin"(轮询)或 "random"(随机)
|
||||
# 轮询:依次使用每个API key
|
||||
# 随机:随机选择一个API key
|
||||
selection_method: "round_robin"
|
||||
|
||||
# The base URL for the OpenAI API, used to construct requests
|
||||
# If you cannot access the official API, you can use a proxy service
|
||||
# OpenAI API 的基础 URL,用于构建请求
|
||||
# 如果你无法访问官方API,可以使用代理服务
|
||||
base_url: "https://api.openai.com/v1"
|
||||
```
|
||||
4. 在控制台中输入`/chatgpt reload`重新加载配置文件
|
||||
|
||||
## 截图
|
||||
- 服务端截图(Spigot 1.20.1)
|
||||

|
||||

|
||||
- 插件截图
|
||||

|
||||

|
||||
- 对话截图(使用FastGPT训练的自定义知识库)
|
||||

|
||||
## 配置文件`config.yml`
|
||||
```yaml
|
||||
# API 相关设置
|
||||
api:
|
||||
# 你的 OpenAI API key,用于身份验证
|
||||
# 获取 API key 的方法:访问 https://platform.openai.com/account/api-keys 并创建一个新的 API key
|
||||
key: "sk-your_openai_api_key"
|
||||
# OpenAI API 的基础 URL,用于构建请求
|
||||
base_url: "https://api.openai.com/v1"
|
||||
# 支持的模型列表
|
||||
models:
|
||||
# OpenAI ChatGPT
|
||||
- "gpt-3.5-turbo"
|
||||
- "gpt-3.5-turbo-instruct"
|
||||
- "gpt-4"
|
||||
- "gpt-4-turbo"
|
||||
- "gpt-4-turbo-preview"
|
||||
- "gpt-4o"
|
||||
- "gpt-4o-mini"
|
||||
# Google Gemini
|
||||
# - "gemini-pro"
|
||||
# - "gemini-1.5-pro"
|
||||
# Anthropic Claude
|
||||
# - "claude-3-opus"
|
||||
# - "claude-3-5-sonnet"
|
||||
# 以及更多...
|
||||
# 默认使用的模型
|
||||
default_model: "gpt-3.5-turbo"
|
||||
# 连续对话设置
|
||||
conversation:
|
||||
# 连续对话开关
|
||||
context_enabled: false
|
||||
# 最大历史记录保留数量
|
||||
max_history_size: 10
|
||||
# 角色设置
|
||||
characters:
|
||||
# 格式:
|
||||
# 角色名称: "角色提示词"
|
||||
ChatGPT: "You are a helpful assistant."
|
||||
# 消息相关设置
|
||||
messages:
|
||||
reload: "&a已重新加载配置文件!"
|
||||
clear: "&a对话历史已清空!"
|
||||
help: "&e===== MineChatGPT 帮助 ====="
|
||||
help_ask: "&e/chatgpt <text> - 向ChatGPT提问"
|
||||
help_reload: "&e/chatgpt reload - 重新加载配置文件"
|
||||
help_model: "&e/chatgpt model <model_name> - 切换至其他模型"
|
||||
help_modellist: "&e/chatgpt modellist - 可用的模型列表"
|
||||
help_context: "&e/chatgpt context - 切换连续对话模式"
|
||||
help_clear: "&e/chatgpt clear - 清空对话历史"
|
||||
help_character: "&e/chatgpt character [character_name] - 列出或切换角色"
|
||||
context_toggle: "&e连续对话模式已%s。"
|
||||
context_toggle_enabled: "&a开启"
|
||||
context_toggle_disabled: "&c关闭"
|
||||
current_model_info: "&e当前模型:%s,输入 /chatgpt model <model_name> 来切换模型。"
|
||||
model_switch: "&a已切换至模型 %s"
|
||||
chatgpt_error: "&c无法联系ChatGPT。"
|
||||
chatgpt_response: "&b%s: %s"
|
||||
question: "&b你: %s"
|
||||
character_switched: "&a已切换至角色: %s"
|
||||
available_characters: "&e可用的角色列表:"
|
||||
invalid_character: "&c无效的角色。使用 /chatgpt character 查看所有可用的角色。"
|
||||
invalid_model: "&c模型无效。使用 /chatgpt modellist 查看可用模型。"
|
||||
available_models: "&e可用模型列表:"
|
||||
no_permission: "&c你没有权限使用这个指令。需要的权限:%s"
|
||||
# 如果你不知道这是什么,请不要动
|
||||
debug: false
|
||||
```
|
||||

|
||||
|
||||
## 指令与权限
|
||||
|指令|权限|描述|
|
||||
@@ -142,7 +96,8 @@ debug: false
|
||||
### 提问后控制台有`connect timeout` `connect reset`等类似的提示
|
||||
检查`config.yml`中的`base_url`能否正常访问。如果你无法连接到OpenAI官方的API地址,可以考虑使用其他反代。
|
||||
### 我可以添加其他模型吗?
|
||||
可以,只要模型支持OpenAI的API,就可以使用。
|
||||
可以,只要模型支持OpenAI的API,就可以使用。
|
||||
不推荐使用推理模型,因为推理模型的响应时间较长,在没有流式响应的情况下,玩家会认为插件出现了问题。
|
||||
### 我没有ChatGPT的账号,可以用吗?
|
||||
可以,目前有很多代理网站,可以很轻松地使用,而且还支持其他模型,费用通常来说也会比官方便宜。如果你愿意,也可以使用我的代理,目前仅在我的QQ群:226385797中提供。
|
||||
### 是否会支持Folia
|
||||
|
||||
Reference in New Issue
Block a user