nonebot-plugin-chatpdf


Namenonebot-plugin-chatpdf JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryA nonebot plugin for chatpdf
upload_time2024-08-28 18:33:53
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-chatpdf

</div>

# 介绍

- 本插件灵感来源于最近很火的 [chatpdf](https://www.chatpdf.com)。
- 将需要分析的论文/阅读材料上传到群文件,机器人可以对其进行存储分析,然后你可以向其提问有关文章内容、文章概要、对于文章的思考等问题
- 本插件参考和使用了项目 [Document_QA](https://github.com/fierceX/Document_QA) 中的核心代码
- 本插件可选使用OneAPI格式的第三方中转站也可以使用OpenAI官方接口,但是在速率限制的情况下本插件可能无法使用。

# 效果
使用方法以最新说明为主

![Alt](./img/img2.jpg)

# 安装

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

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

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

# 配置文件

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

```
oneapi_key = "sk-xxxxxxxxxx"  # (必填)OpenAI官方或者是支持OneAPI的大模型中转服务商提供的KEY
oneapi_url = "https://xxxxxxxxx"  # (可选)大模型中转服务商提供的中转地址,使用OpenAI官方服务不需要填写
oneapi_model = "gpt-4" # (可选)使用的语言大模型
```


# 使用方法

如果设置了nonebot全局触发前缀,需要在下面的命令前加上设置的前缀。

### 使用方式:上传需要分析的pdf文件到群文件中

- 分析pdf (使用该命令以上传pdf文件的方式启动chatpdf文章分析功能)
- 在一分钟内,上传需要分析的pdf文件到群文件中,分析完成后会返回成功信息
- askpdf (文章分析完成后,使用该命令后面接需要提问的关于文章的问题,机器人会给出答案)
- 删除所有pdf (删除所有缓存)
- 删除我的pdf (删除用户在本群的缓存)


# 注意事项

- 每次调用```分析pdf```命令时,都会清除调用者以前的分析缓存


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nonebot-plugin-chatpdf",
    "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/c2/b1/678dfa6d56e3f064db37df1c99a0d0630b80ea9b78d19eac07c8aedba563/nonebot_plugin_chatpdf-1.0.0.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-chatpdf\n\n</div>\n\n# \u4ecb\u7ecd\n\n- \u672c\u63d2\u4ef6\u7075\u611f\u6765\u6e90\u4e8e\u6700\u8fd1\u5f88\u706b\u7684 [chatpdf](https://www.chatpdf.com)\u3002\n- \u5c06\u9700\u8981\u5206\u6790\u7684\u8bba\u6587/\u9605\u8bfb\u6750\u6599\u4e0a\u4f20\u5230\u7fa4\u6587\u4ef6\uff0c\u673a\u5668\u4eba\u53ef\u4ee5\u5bf9\u5176\u8fdb\u884c\u5b58\u50a8\u5206\u6790\uff0c\u7136\u540e\u4f60\u53ef\u4ee5\u5411\u5176\u63d0\u95ee\u6709\u5173\u6587\u7ae0\u5185\u5bb9\u3001\u6587\u7ae0\u6982\u8981\u3001\u5bf9\u4e8e\u6587\u7ae0\u7684\u601d\u8003\u7b49\u95ee\u9898\n- \u672c\u63d2\u4ef6\u53c2\u8003\u548c\u4f7f\u7528\u4e86\u9879\u76ee [Document_QA](https://github.com/fierceX/Document_QA) \u4e2d\u7684\u6838\u5fc3\u4ee3\u7801\n- \u672c\u63d2\u4ef6\u53ef\u9009\u4f7f\u7528OneAPI\u683c\u5f0f\u7684\u7b2c\u4e09\u65b9\u4e2d\u8f6c\u7ad9\u4e5f\u53ef\u4ee5\u4f7f\u7528OpenAI\u5b98\u65b9\u63a5\u53e3\uff0c\u4f46\u662f\u5728\u901f\u7387\u9650\u5236\u7684\u60c5\u51b5\u4e0b\u672c\u63d2\u4ef6\u53ef\u80fd\u65e0\u6cd5\u4f7f\u7528\u3002\n\n# \u6548\u679c\n\u4f7f\u7528\u65b9\u6cd5\u4ee5\u6700\u65b0\u8bf4\u660e\u4e3a\u4e3b\n\n![Alt](./img/img2.jpg)\n\n# \u5b89\u88c5\n\n* \u624b\u52a8\u5b89\u88c5\n  ```\n  git clone https://github.com/Alpaca4610/nonebot_plugin_chatpdf.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-chatpdf\"]\n  ```\n* \u4f7f\u7528 pip\n  ```\n  pip install nonebot-plugin-chatgpt-chatpdf\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 = \"sk-xxxxxxxxxx\"  # \uff08\u5fc5\u586b\uff09OpenAI\u5b98\u65b9\u6216\u8005\u662f\u652f\u6301OneAPI\u7684\u5927\u6a21\u578b\u4e2d\u8f6c\u670d\u52a1\u5546\u63d0\u4f9b\u7684KEY\noneapi_url = \"https://xxxxxxxxx\"  # \uff08\u53ef\u9009\uff09\u5927\u6a21\u578b\u4e2d\u8f6c\u670d\u52a1\u5546\u63d0\u4f9b\u7684\u4e2d\u8f6c\u5730\u5740,\u4f7f\u7528OpenAI\u5b98\u65b9\u670d\u52a1\u4e0d\u9700\u8981\u586b\u5199\noneapi_model = \"gpt-4\" # \uff08\u53ef\u9009\uff09\u4f7f\u7528\u7684\u8bed\u8a00\u5927\u6a21\u578b\n```\n\n\n# \u4f7f\u7528\u65b9\u6cd5\n\n\u5982\u679c\u8bbe\u7f6e\u4e86nonebot\u5168\u5c40\u89e6\u53d1\u524d\u7f00\uff0c\u9700\u8981\u5728\u4e0b\u9762\u7684\u547d\u4ee4\u524d\u52a0\u4e0a\u8bbe\u7f6e\u7684\u524d\u7f00\u3002\n\n### \u4f7f\u7528\u65b9\u5f0f\uff1a\u4e0a\u4f20\u9700\u8981\u5206\u6790\u7684pdf\u6587\u4ef6\u5230\u7fa4\u6587\u4ef6\u4e2d\n\n- \u5206\u6790pdf (\u4f7f\u7528\u8be5\u547d\u4ee4\u4ee5\u4e0a\u4f20pdf\u6587\u4ef6\u7684\u65b9\u5f0f\u542f\u52a8chatpdf\u6587\u7ae0\u5206\u6790\u529f\u80fd)\n- \u5728\u4e00\u5206\u949f\u5185\uff0c\u4e0a\u4f20\u9700\u8981\u5206\u6790\u7684pdf\u6587\u4ef6\u5230\u7fa4\u6587\u4ef6\u4e2d\uff0c\u5206\u6790\u5b8c\u6210\u540e\u4f1a\u8fd4\u56de\u6210\u529f\u4fe1\u606f\n- askpdf (\u6587\u7ae0\u5206\u6790\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u8be5\u547d\u4ee4\u540e\u9762\u63a5\u9700\u8981\u63d0\u95ee\u7684\u5173\u4e8e\u6587\u7ae0\u7684\u95ee\u9898\uff0c\u673a\u5668\u4eba\u4f1a\u7ed9\u51fa\u7b54\u6848)\n- \u5220\u9664\u6240\u6709pdf (\u5220\u9664\u6240\u6709\u7f13\u5b58)\n- \u5220\u9664\u6211\u7684pdf \uff08\u5220\u9664\u7528\u6237\u5728\u672c\u7fa4\u7684\u7f13\u5b58\uff09\n\n\n# \u6ce8\u610f\u4e8b\u9879\n\n- \u6bcf\u6b21\u8c03\u7528```\u5206\u6790pdf```\u547d\u4ee4\u65f6\uff0c\u90fd\u4f1a\u6e05\u9664\u8c03\u7528\u8005\u4ee5\u524d\u7684\u5206\u6790\u7f13\u5b58\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A nonebot plugin for chatpdf",
    "version": "1.0.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c980ac28ba66ce13edfdd8a72e75e5941f4c109935840871451c36e0cf50238",
                "md5": "7d94f7aaac24c23d7a3d7371ca2f8a51",
                "sha256": "b842cbe2630085134dc85531edcea86ce9844a0b0522d0fdc5a99bbf1c29ff64"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_chatpdf-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d94f7aaac24c23d7a3d7371ca2f8a51",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 5829,
            "upload_time": "2024-08-28T18:33:52",
            "upload_time_iso_8601": "2024-08-28T18:33:52.047205Z",
            "url": "https://files.pythonhosted.org/packages/7c/98/0ac28ba66ce13edfdd8a72e75e5941f4c109935840871451c36e0cf50238/nonebot_plugin_chatpdf-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2b1678dfa6d56e3f064db37df1c99a0d0630b80ea9b78d19eac07c8aedba563",
                "md5": "f52aee26ae92808187e3a2c4ffab3c29",
                "sha256": "7938aeffc8c3784d1de8024bb605cb5aef75782be69981c74efff72c9587015d"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_chatpdf-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f52aee26ae92808187e3a2c4ffab3c29",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 5468,
            "upload_time": "2024-08-28T18:33:53",
            "upload_time_iso_8601": "2024-08-28T18:33:53.500625Z",
            "url": "https://files.pythonhosted.org/packages/c2/b1/678dfa6d56e3f064db37df1c99a0d0630b80ea9b78d19eac07c8aedba563/nonebot_plugin_chatpdf-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-28 18:33:53",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nonebot-plugin-chatpdf"
}
        
Elapsed time: 0.68398s