nonebot-plugin-chatgpt-turbo


Namenonebot-plugin-chatgpt-turbo JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA nonebot plugin for oneapi and openai
upload_time2024-06-02 13:14:08
maintainerNone
docs_urlNone
authorAlpaca
requires_python<4.0,>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  <br>
  <p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>

<div align="center">

# nonebot-plugin-chatgpt-turbo
</div>

# 介绍
- 本插件适配OneAPI和OpenAI接口,可以在nonebot中调用OpenAI官方或是OneAPI(gpt系列模型,gemini-1.5-pro)接口的模型进行回复。
- 本插件具有上下文回复和多模态识别(识图)功能。
# 安装

* 手动安装
  ```
  git clone https://github.com/Alpaca4610/nonebot_plugin_chatgpt_turbo.git
  ```

  下载完成后在bot项目的pyproject.toml文件手动添加插件:

  ```
  plugin_dirs = ["xxxxxx","xxxxxx",......,"下载完成的插件路径/nonebot-plugin-gpt3.5-turbo"]
  ```
* 使用 pip
  ```
  pip install nonebot-plugin-chatgpt-turbo
  ```

# 配置文件

在Bot根目录下的.env文件中追加如下内容:

```
oneapi_key = ""  # OpenAI官方或者是支持OneAPI的大模型中转服务商提供的KEY
oneapi_model = "gpt-4o" # 使用的语言大模型,使用识图功能请填写合适的大模型名称
```

可选内容:
```
oneapi_url = ""  # (可选)大模型中转服务商提供的中转地址,使用OpenAI官方服务不需要填写
enable_private_chat = True   # 私聊开关,默认开启,改为False关闭
```

# 效果
![](demo.jpg)

# 使用方法

- @机器人发送问题时机器人不具有上下文回复的能力
- chat 使用该命令进行问答时,机器人具有上下文回复的能力
- clear 清除当前用户的聊天记录

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nonebot-plugin-chatgpt-turbo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Alpaca",
    "author_email": "alpaca@bupt.edu.cn",
    "download_url": "https://files.pythonhosted.org/packages/8c/bb/987c473f911a819a0b985817a0ea1ebdf24d79c0beb89f34aa9a221a0194/nonebot_plugin_chatgpt_turbo-1.0.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  <br>\n  <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot-plugin-chatgpt-turbo\n</div>\n\n# \u4ecb\u7ecd\n- \u672c\u63d2\u4ef6\u9002\u914dOneAPI\u548cOpenAI\u63a5\u53e3\uff0c\u53ef\u4ee5\u5728nonebot\u4e2d\u8c03\u7528OpenAI\u5b98\u65b9\u6216\u662fOneAPI(gpt\u7cfb\u5217\u6a21\u578b,gemini-1.5-pro)\u63a5\u53e3\u7684\u6a21\u578b\u8fdb\u884c\u56de\u590d\u3002\n- \u672c\u63d2\u4ef6\u5177\u6709\u4e0a\u4e0b\u6587\u56de\u590d\u548c\u591a\u6a21\u6001\u8bc6\u522b\uff08\u8bc6\u56fe\uff09\u529f\u80fd\u3002\n# \u5b89\u88c5\n\n* \u624b\u52a8\u5b89\u88c5\n  ```\n  git clone https://github.com/Alpaca4610/nonebot_plugin_chatgpt_turbo.git\n  ```\n\n  \u4e0b\u8f7d\u5b8c\u6210\u540e\u5728bot\u9879\u76ee\u7684pyproject.toml\u6587\u4ef6\u624b\u52a8\u6dfb\u52a0\u63d2\u4ef6\uff1a\n\n  ```\n  plugin_dirs = [\"xxxxxx\",\"xxxxxx\",......,\"\u4e0b\u8f7d\u5b8c\u6210\u7684\u63d2\u4ef6\u8def\u5f84/nonebot-plugin-gpt3.5-turbo\"]\n  ```\n* \u4f7f\u7528 pip\n  ```\n  pip install nonebot-plugin-chatgpt-turbo\n  ```\n\n# \u914d\u7f6e\u6587\u4ef6\n\n\u5728Bot\u6839\u76ee\u5f55\u4e0b\u7684.env\u6587\u4ef6\u4e2d\u8ffd\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a\n\n```\noneapi_key = \"\"  # OpenAI\u5b98\u65b9\u6216\u8005\u662f\u652f\u6301OneAPI\u7684\u5927\u6a21\u578b\u4e2d\u8f6c\u670d\u52a1\u5546\u63d0\u4f9b\u7684KEY\noneapi_model = \"gpt-4o\" # \u4f7f\u7528\u7684\u8bed\u8a00\u5927\u6a21\u578b\uff0c\u4f7f\u7528\u8bc6\u56fe\u529f\u80fd\u8bf7\u586b\u5199\u5408\u9002\u7684\u5927\u6a21\u578b\u540d\u79f0\n```\n\n\u53ef\u9009\u5185\u5bb9\uff1a\n```\noneapi_url = \"\"  # \uff08\u53ef\u9009\uff09\u5927\u6a21\u578b\u4e2d\u8f6c\u670d\u52a1\u5546\u63d0\u4f9b\u7684\u4e2d\u8f6c\u5730\u5740\uff0c\u4f7f\u7528OpenAI\u5b98\u65b9\u670d\u52a1\u4e0d\u9700\u8981\u586b\u5199\nenable_private_chat = True   # \u79c1\u804a\u5f00\u5173\uff0c\u9ed8\u8ba4\u5f00\u542f\uff0c\u6539\u4e3aFalse\u5173\u95ed\n```\n\n# \u6548\u679c\n![](demo.jpg)\n\n# \u4f7f\u7528\u65b9\u6cd5\n\n- @\u673a\u5668\u4eba\u53d1\u9001\u95ee\u9898\u65f6\u673a\u5668\u4eba\u4e0d\u5177\u6709\u4e0a\u4e0b\u6587\u56de\u590d\u7684\u80fd\u529b\n- chat \u4f7f\u7528\u8be5\u547d\u4ee4\u8fdb\u884c\u95ee\u7b54\u65f6\uff0c\u673a\u5668\u4eba\u5177\u6709\u4e0a\u4e0b\u6587\u56de\u590d\u7684\u80fd\u529b\n- clear \u6e05\u9664\u5f53\u524d\u7528\u6237\u7684\u804a\u5929\u8bb0\u5f55\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A nonebot plugin for oneapi and openai",
    "version": "1.0.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8538871a6d8abb06f4895e961dbdb6ea59485260db9b084b89ac241fec24067",
                "md5": "1b06e2f2ae2564ab6b9e81a496f84950",
                "sha256": "864dd7ee9320100015b999fd1cf99acafb9ad8f45cd3d547711d56aaed8bc47a"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_chatgpt_turbo-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b06e2f2ae2564ab6b9e81a496f84950",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 4743,
            "upload_time": "2024-06-02T13:14:06",
            "upload_time_iso_8601": "2024-06-02T13:14:06.506509Z",
            "url": "https://files.pythonhosted.org/packages/d8/53/8871a6d8abb06f4895e961dbdb6ea59485260db9b084b89ac241fec24067/nonebot_plugin_chatgpt_turbo-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8cbb987c473f911a819a0b985817a0ea1ebdf24d79c0beb89f34aa9a221a0194",
                "md5": "e439accae571d05eb3920e8e53c0471f",
                "sha256": "0b5d8144f9efc49ec7e4a5d1fb69f3e18664e59974575eae7b6b5b648275a8fa"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_chatgpt_turbo-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e439accae571d05eb3920e8e53c0471f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 4095,
            "upload_time": "2024-06-02T13:14:08",
            "upload_time_iso_8601": "2024-06-02T13:14:08.415842Z",
            "url": "https://files.pythonhosted.org/packages/8c/bb/987c473f911a819a0b985817a0ea1ebdf24d79c0beb89f34aa9a221a0194/nonebot_plugin_chatgpt_turbo-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-02 13:14:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nonebot-plugin-chatgpt-turbo"
}
        
Elapsed time: 0.62208s