nonebot-plugin-with-ai-agents


Namenonebot-plugin-with-ai-agents JSON
Version 0.1.15 PyPI version JSON
download
home_pageNone
Summarynonebot_plugin_with_ai_agents 是一个基于基本原理实现的 AI Agents(智能体),拥有联网搜索能力、页面内容提取并学习回答等功能
upload_time2024-06-18 06:42:51
maintainerNone
docs_urlNone
authoryejue
requires_python<4.0,>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <a href="https://v2.nonebot.dev/"><img src="https://v2.nonebot.dev/logo.png" width="200" height="200" alt="nonebot"></a>
</p>


<h1 align="center">With-AI-Agents</h1>

<p align="center">
  _✨ NoneBot AI 智能体插件,有页面内容学习、页面内容提取、联网实时查询回答、天气查询、命令执行等功能 ✨_
</p>

<p align="center">
  这个文档有点长,建议点开↗右上角的 亖 查看文档目录,会有你想找的
</p>

<p align="center">
  <a href="https://raw.githubusercontent.com/cscs181/QQ-Github-Bot/master/LICENSE">
    <img src="https://img.shields.io/github/license/cscs181/QQ-Github-Bot.svg" alt="license">
  </a>
  <a href="https://pypi.python.org/pypi/nonebot-plugin-analysis-bilibili">
    <img src="https://img.shields.io/pypi/v/nonebot-plugin-analysis-bilibili.svg" alt="pypi">
  </a>
  <img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</p>


## 快速安装

第一步:右上角 ↗ 点个不要钱的 star 吧,这是不断维护更新的动力。
这个项目同时提供了不依赖于 nonebot 的普通版本,[点击跳转](https://github.com/yejue/with-ai-agents)

### nb-cli

```shell
nb plugin install nonebot-plugin-with-ai-agents
```
### pip

```shell
pip install nonebot-plugin-with-ai-agents
```

### git

```shell
cd /your-nonebot-project-home/plugins/
git clone https://github.com/yejue/nonebot-plugin-with-ai-agents.git
```


## 功能描述

AI Agents 功能包括不限于以下功能:
1. 联网搜索:即当 AI 认为当前应该使用网络搜索时,进行搜索后回答
2. 页面提取:在问题中自动提取 URL,将 URL 的内容提取学习后进行回答
3. <dev>天气预报:暂时是没有了,等下个版本更新</dev> 已移除
4. 新闻内容:目前 AI 可以根据需要对某个事件来搜索到大概信息,例如:“了解下珠海暴雨”,再进行回答,之后会做成专门的新闻模块。
5. <dev>命令执行:AI 从接收到的信息语义中解析出要执行的指令,执行完成将结果转达。执行命令使用的是 subprocess 模块。
    注意:由于未做任何的权限控制,这个功能有非常高的风险。</dev> 已移除
6. 百度百科搜索能力


## 使用

@机器人+任意文本或者私聊机器人+任意文本。

例子(图例请查看文档底部示例):
```text
1:搜一下最近珠海的天气。
2:提取页面信息 https://xxxxxx.com
3:学习这个页面的信息再回答我 https://xxxx.com
4:百科搜鲁迅,然后告诉我鲁迅为什么要打周树人
```

## 更新历史

### 0.1.15
此版本主要为功能修复和代优化、抽象:
 - GLM 和 OpenAI 类的代码抽象到 Base
 - 优化全局错误捕获流程和返回到 nb.finish 的信息
 - 修复 OpenAI 平台未捕获到错误的问题

### 0.1.14
此版本主要为功能增强更新
 - 新增百度百科搜索能力,详见文档使用
 - 新增了自定义 AI 人格的功能,详见配置项
 - 新增了模型 API URL 的配置项,详见文档配置表
 - 抽象了智能体类型,以及将许多的功能封装成函数

### 0.1.13
此版本主要为配置项更新
 - 新增配置项 WITH_AI_AGENTS__MESSAGE_START,详见本文配置项
 - 新增配置项 WITH_AI_AGENTS__PRIORITY,详见本文配置项

### 0.1.12
此版本主要为功能容错能力提升,以及优化打印:
 - `BaseModel.model_config` 属性:在有这个属性时才进行设置,否则不使用,以提高版本容错
 - 大部分 `print` 改用 `nonebot.log.logge` 打印

### 0.1.10
此版本为修复和功能增强更新
 - 联网搜索优化:使用宽泛化的搜索提高搜索成功率和获得更好的搜索答案
 - 联网结果提取优化:修复 (Invalid \escape)、增加 V2 版本结果提取
 - 回复优化:提高最终回复时的联想能力
 - 减少打印:减少插件内打印的内容


## 一些说明

1. 本 plugin 采用 Agents 基本原理实现。
2. 本 plugin 中的联网能力基于百度、<dev>bing</dev>(暂时忽略不计)、或者 Tavily,推荐只使用百度。Tavily 确实提供了良好的聚合搜索,但是有可能会出现“50万”内容。
3. 本 plugin 中可以配置接入并不限于这些大模型,ChatGLM 系列、通义千问系列、ChatGPT 系列、以及魔塔社区 Dashscope 提供的所有模型(百川、Llama3等)。插件开发时使用的是 **dashscope** 的 **qwen-turbo** 模型,在调整了 **temperature** 之后效果还可以。预估效果应该是 ChatGPT 系列 > ChatGLM ≈ 通义千问 >> 百川、Llama3。
4. 本 plugin 的优先级为 999,因为是任意与机器人相关消息都会响应,所以应尽量在别的插件之后。


## 可用模型

以下是本插件可以使用的平台和模型配置项,包含但不限于。

openai 的话效果肯定是拔尖的,但是价格也是拔尖的。对于国内大模型来说,GLM 系列算是各方面都比较好的,这个模型在申请之后可以免费使用一个月。本插件在开发时使用的是 **qwen-turbo** ,这个是阿里云的通义千问系列大模型,在调整了 temperature 之后表现还不错,申请之后可以在一定额度内使用半年。

| 平台(platform) | 模型(model_name)                                                                                                              | 相关文档                                                     |
|--------------|-----------------------------------------------------------------------------------------------------------------------------| ------------------------------------------------------------ |
| openai       | gpt-3.5-turbo-0125(推荐,毕竟便宜一点)、gpt-3.5-turbo、gpt-3.5-turbo-16k、gpt-4-turbo、gpt-4-turbo-2024-04-09、gpt-4-32k                  | [openai](https://platform.openai.com/docs/models)            |
| dashscope    | qwen-turbo(推荐,开发时使用)、qwen-plus、qwen-max-longcontext、llama3-8b-instruct(不尽人意)、llama3-70b-instruct(不尽人意)、baichuan-7b-v1(不尽人意) | [dashscope](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction?spm=a2c4g.11186623.0.i2) |
| glm          | glm-3-turbo(推荐)、glm-4                                                                                                       | [glm](https://open.bigmodel.cn/dev/api#language)             |



## 配置项

在 nonebot2 项目的 `.env` | `.env.prod` | `.env.dev` 中添加下表中的配置项。

|             配置项             | 必填 |   默认值    |                             说明                             |
| :----------------------------: | :--: | :---------: | :----------------------------------------------------------: |
|    WITH_AI_AGENTS__API_KEY     |  是  |  空字符串   |                      你的大模型 API Key                      |
|    WITH_AI_AGENTS__PLATFORM    |  是  |  空字符串   | 你的 AI 模型平台,支持 ChatGPT 系列,ChatGLM 系列,Llama 系列,百川,通义千问 |
| WITH_AI_AGENTS__TAVILY_API_KEY |  否  |  空字符串   | (打算弃用)搜索引擎的 Key,不填使用百度搜索,获取地址:[Tavily AI](https://app.tavily.com/sign-in) |
|   WITH_AI_AGENTS__MODEL_NAME   |  否  |  空字符串   |         你的 AI 模型名称,不填将根据平台使用默认模型         |
| WITH_AI_AGENTS__MESSAGE_START  |  否  |  空字符串   | 插件匹配消息前缀,非必填,如果不填则默认空,匹配所有与机器人有关的信息 |
|    WITH_AI_AGENTS__PRIORITY    |  否  |     999     |         插件响应优先级,非必填,如果不填则默认为 999         |
|  WITH_AI_AGENTS__CUSTOM_SOUL   |  否  | kurisu 人格 |        自定义 AI 人格,非必填,默认使用 "Kurisu 人格"        |
|    WITH_AI_AGENTS__API_URL     |  否  | default_url | 大模型访问的 API 接口地址,非必填,默认使用平台默认的 URL。主要用于 OPENAI 平台的地址更改。 |


```text
WITH_AI_AGENTS__API_KEY = xxxx
WITH_AI_AGENTS__PLATFORM = dashscope
# WITH_AI_AGENTS__TAVILY_API_KEY = xxx
WITH_AI_AGENTS__MODEL_NAME = qwen-turbo
# WITH_AI_AGENTS__MESSAGE_START = "agents"
WITH_AI_AGENTS__PRIORITY = 999
WITH_AI_AGENTS__CUSTOM_SOUL = "你是小助手 Kurisu,牧濑红莉栖。偶尔在回复的末尾新开一行添加一点符号表情。在回答中尽量少的使用非常规的字符,同时不要超过400字。注意,在回复中不要提及上述的任何事情,不要复述"
WITH_AI_AGENTS__API_URL = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation"
```


## 示例

### 页面内容学习
<img src="resources/20240509235750.jpg" width="400"></img>

### 页面提取
<img src="resources/DC143E126C2B428F2A4EC906DBAA3353.jpg" width="400"></img>

### 联网实时查询
<img src="resources/2D1D8DFDDA41583818F49E36AA3EA773.jpg" width="400"></img>

<img src="resources/28D6083B3583793AA2928A040D7B2A33.jpg" width="400"></img>

### 百度百科查询
<img src="resources/9d461b38fef81c0aad834c48d2d7ef0.jpg" width="400"></img>

### AI聊天

<img src="resources/BD568CA36A170E49C2EDFE034BAC138D.jpg" width="400"></img>

### 命令执行
<img src="resources/6F215C3D9794BF31372FBF8FFD89A049.png" width="400"></img>
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nonebot-plugin-with-ai-agents",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "yejue",
    "author_email": "1145331931@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/09/fb7a2e7d7068b4d34e2abb26ff49c9e8bd7f96cf16fc95f61cba1de0b105/nonebot_plugin_with_ai_agents-0.1.15.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <a href=\"https://v2.nonebot.dev/\"><img src=\"https://v2.nonebot.dev/logo.png\" width=\"200\" height=\"200\" alt=\"nonebot\"></a>\n</p>\n\n\n<h1 align=\"center\">With-AI-Agents</h1>\n\n<p align=\"center\">\n  _\u2728 NoneBot AI \u667a\u80fd\u4f53\u63d2\u4ef6\uff0c\u6709\u9875\u9762\u5185\u5bb9\u5b66\u4e60\u3001\u9875\u9762\u5185\u5bb9\u63d0\u53d6\u3001\u8054\u7f51\u5b9e\u65f6\u67e5\u8be2\u56de\u7b54\u3001\u5929\u6c14\u67e5\u8be2\u3001\u547d\u4ee4\u6267\u884c\u7b49\u529f\u80fd \u2728_\n</p>\n\n<p align=\"center\">\n  \u8fd9\u4e2a\u6587\u6863\u6709\u70b9\u957f\uff0c\u5efa\u8bae\u70b9\u5f00\u2197\u53f3\u4e0a\u89d2\u7684 \u4e96 \u67e5\u770b\u6587\u6863\u76ee\u5f55\uff0c\u4f1a\u6709\u4f60\u60f3\u627e\u7684\n</p>\n\n<p align=\"center\">\n  <a href=\"https://raw.githubusercontent.com/cscs181/QQ-Github-Bot/master/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/cscs181/QQ-Github-Bot.svg\" alt=\"license\">\n  </a>\n  <a href=\"https://pypi.python.org/pypi/nonebot-plugin-analysis-bilibili\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-analysis-bilibili.svg\" alt=\"pypi\">\n  </a>\n  <img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n</p>\n\n\n## \u5feb\u901f\u5b89\u88c5\n\n\u7b2c\u4e00\u6b65\uff1a\u53f3\u4e0a\u89d2 \u2197 \u70b9\u4e2a\u4e0d\u8981\u94b1\u7684 star \u5427\uff0c\u8fd9\u662f\u4e0d\u65ad\u7ef4\u62a4\u66f4\u65b0\u7684\u52a8\u529b\u3002\n\u8fd9\u4e2a\u9879\u76ee\u540c\u65f6\u63d0\u4f9b\u4e86\u4e0d\u4f9d\u8d56\u4e8e nonebot \u7684\u666e\u901a\u7248\u672c\uff0c[\u70b9\u51fb\u8df3\u8f6c](https://github.com/yejue/with-ai-agents)\n\n### nb-cli\n\n```shell\nnb plugin install nonebot-plugin-with-ai-agents\n```\n### pip\n\n```shell\npip install nonebot-plugin-with-ai-agents\n```\n\n### git\n\n```shell\ncd /your-nonebot-project-home/plugins/\ngit clone https://github.com/yejue/nonebot-plugin-with-ai-agents.git\n```\n\n\n## \u529f\u80fd\u63cf\u8ff0\n\nAI Agents \u529f\u80fd\u5305\u62ec\u4e0d\u9650\u4e8e\u4ee5\u4e0b\u529f\u80fd\uff1a\n1. \u8054\u7f51\u641c\u7d22\uff1a\u5373\u5f53 AI \u8ba4\u4e3a\u5f53\u524d\u5e94\u8be5\u4f7f\u7528\u7f51\u7edc\u641c\u7d22\u65f6\uff0c\u8fdb\u884c\u641c\u7d22\u540e\u56de\u7b54\n2. \u9875\u9762\u63d0\u53d6\uff1a\u5728\u95ee\u9898\u4e2d\u81ea\u52a8\u63d0\u53d6 URL\uff0c\u5c06 URL \u7684\u5185\u5bb9\u63d0\u53d6\u5b66\u4e60\u540e\u8fdb\u884c\u56de\u7b54\n3. <dev>\u5929\u6c14\u9884\u62a5\uff1a\u6682\u65f6\u662f\u6ca1\u6709\u4e86\uff0c\u7b49\u4e0b\u4e2a\u7248\u672c\u66f4\u65b0</dev> \u5df2\u79fb\u9664\n4. \u65b0\u95fb\u5185\u5bb9\uff1a\u76ee\u524d AI \u53ef\u4ee5\u6839\u636e\u9700\u8981\u5bf9\u67d0\u4e2a\u4e8b\u4ef6\u6765\u641c\u7d22\u5230\u5927\u6982\u4fe1\u606f\uff0c\u4f8b\u5982\uff1a\u201c\u4e86\u89e3\u4e0b\u73e0\u6d77\u66b4\u96e8\u201d\uff0c\u518d\u8fdb\u884c\u56de\u7b54\uff0c\u4e4b\u540e\u4f1a\u505a\u6210\u4e13\u95e8\u7684\u65b0\u95fb\u6a21\u5757\u3002\n5. <dev>\u547d\u4ee4\u6267\u884c\uff1aAI \u4ece\u63a5\u6536\u5230\u7684\u4fe1\u606f\u8bed\u4e49\u4e2d\u89e3\u6790\u51fa\u8981\u6267\u884c\u7684\u6307\u4ee4\uff0c\u6267\u884c\u5b8c\u6210\u5c06\u7ed3\u679c\u8f6c\u8fbe\u3002\u6267\u884c\u547d\u4ee4\u4f7f\u7528\u7684\u662f subprocess \u6a21\u5757\u3002\n    \u6ce8\u610f\uff1a\u7531\u4e8e\u672a\u505a\u4efb\u4f55\u7684\u6743\u9650\u63a7\u5236\uff0c\u8fd9\u4e2a\u529f\u80fd\u6709\u975e\u5e38\u9ad8\u7684\u98ce\u9669\u3002</dev> \u5df2\u79fb\u9664\n6. \u767e\u5ea6\u767e\u79d1\u641c\u7d22\u80fd\u529b\n\n\n## \u4f7f\u7528\n\n@\u673a\u5668\u4eba+\u4efb\u610f\u6587\u672c\u6216\u8005\u79c1\u804a\u673a\u5668\u4eba+\u4efb\u610f\u6587\u672c\u3002\n\n\u4f8b\u5b50\uff08\u56fe\u4f8b\u8bf7\u67e5\u770b\u6587\u6863\u5e95\u90e8\u793a\u4f8b\uff09\uff1a\n```text\n1\uff1a\u641c\u4e00\u4e0b\u6700\u8fd1\u73e0\u6d77\u7684\u5929\u6c14\u3002\n2\uff1a\u63d0\u53d6\u9875\u9762\u4fe1\u606f https://xxxxxx.com\n3\uff1a\u5b66\u4e60\u8fd9\u4e2a\u9875\u9762\u7684\u4fe1\u606f\u518d\u56de\u7b54\u6211 https://xxxx.com\n4\uff1a\u767e\u79d1\u641c\u9c81\u8fc5\uff0c\u7136\u540e\u544a\u8bc9\u6211\u9c81\u8fc5\u4e3a\u4ec0\u4e48\u8981\u6253\u5468\u6811\u4eba\n```\n\n## \u66f4\u65b0\u5386\u53f2\n\n### 0.1.15\n\u6b64\u7248\u672c\u4e3b\u8981\u4e3a\u529f\u80fd\u4fee\u590d\u548c\u4ee3\u4f18\u5316\u3001\u62bd\u8c61\uff1a\n - GLM \u548c OpenAI \u7c7b\u7684\u4ee3\u7801\u62bd\u8c61\u5230 Base\n - \u4f18\u5316\u5168\u5c40\u9519\u8bef\u6355\u83b7\u6d41\u7a0b\u548c\u8fd4\u56de\u5230 nb.finish \u7684\u4fe1\u606f\n - \u4fee\u590d OpenAI \u5e73\u53f0\u672a\u6355\u83b7\u5230\u9519\u8bef\u7684\u95ee\u9898\n\n### 0.1.14\n\u6b64\u7248\u672c\u4e3b\u8981\u4e3a\u529f\u80fd\u589e\u5f3a\u66f4\u65b0\n - \u65b0\u589e\u767e\u5ea6\u767e\u79d1\u641c\u7d22\u80fd\u529b\uff0c\u8be6\u89c1\u6587\u6863\u4f7f\u7528\n - \u65b0\u589e\u4e86\u81ea\u5b9a\u4e49 AI \u4eba\u683c\u7684\u529f\u80fd\uff0c\u8be6\u89c1\u914d\u7f6e\u9879\n - \u65b0\u589e\u4e86\u6a21\u578b API URL \u7684\u914d\u7f6e\u9879\uff0c\u8be6\u89c1\u6587\u6863\u914d\u7f6e\u8868\n - \u62bd\u8c61\u4e86\u667a\u80fd\u4f53\u7c7b\u578b\uff0c\u4ee5\u53ca\u5c06\u8bb8\u591a\u7684\u529f\u80fd\u5c01\u88c5\u6210\u51fd\u6570\n\n### 0.1.13\n\u6b64\u7248\u672c\u4e3b\u8981\u4e3a\u914d\u7f6e\u9879\u66f4\u65b0\n - \u65b0\u589e\u914d\u7f6e\u9879 WITH_AI_AGENTS__MESSAGE_START\uff0c\u8be6\u89c1\u672c\u6587\u914d\u7f6e\u9879\n - \u65b0\u589e\u914d\u7f6e\u9879 WITH_AI_AGENTS__PRIORITY\uff0c\u8be6\u89c1\u672c\u6587\u914d\u7f6e\u9879\n\n### 0.1.12\n\u6b64\u7248\u672c\u4e3b\u8981\u4e3a\u529f\u80fd\u5bb9\u9519\u80fd\u529b\u63d0\u5347\uff0c\u4ee5\u53ca\u4f18\u5316\u6253\u5370\uff1a\n - `BaseModel.model_config` \u5c5e\u6027\uff1a\u5728\u6709\u8fd9\u4e2a\u5c5e\u6027\u65f6\u624d\u8fdb\u884c\u8bbe\u7f6e\uff0c\u5426\u5219\u4e0d\u4f7f\u7528\uff0c\u4ee5\u63d0\u9ad8\u7248\u672c\u5bb9\u9519\n - \u5927\u90e8\u5206 `print` \u6539\u7528 `nonebot.log.logge` \u6253\u5370\n\n### 0.1.10\n\u6b64\u7248\u672c\u4e3a\u4fee\u590d\u548c\u529f\u80fd\u589e\u5f3a\u66f4\u65b0\n - \u8054\u7f51\u641c\u7d22\u4f18\u5316\uff1a\u4f7f\u7528\u5bbd\u6cdb\u5316\u7684\u641c\u7d22\u63d0\u9ad8\u641c\u7d22\u6210\u529f\u7387\u548c\u83b7\u5f97\u66f4\u597d\u7684\u641c\u7d22\u7b54\u6848\n - \u8054\u7f51\u7ed3\u679c\u63d0\u53d6\u4f18\u5316\uff1a\u4fee\u590d (Invalid \\escape)\u3001\u589e\u52a0 V2 \u7248\u672c\u7ed3\u679c\u63d0\u53d6\n - \u56de\u590d\u4f18\u5316\uff1a\u63d0\u9ad8\u6700\u7ec8\u56de\u590d\u65f6\u7684\u8054\u60f3\u80fd\u529b\n - \u51cf\u5c11\u6253\u5370\uff1a\u51cf\u5c11\u63d2\u4ef6\u5185\u6253\u5370\u7684\u5185\u5bb9\n\n\n## \u4e00\u4e9b\u8bf4\u660e\n\n1. \u672c plugin \u91c7\u7528 Agents \u57fa\u672c\u539f\u7406\u5b9e\u73b0\u3002\n2. \u672c plugin \u4e2d\u7684\u8054\u7f51\u80fd\u529b\u57fa\u4e8e\u767e\u5ea6\u3001<dev>bing</dev>\uff08\u6682\u65f6\u5ffd\u7565\u4e0d\u8ba1\uff09\u3001\u6216\u8005 Tavily\uff0c\u63a8\u8350\u53ea\u4f7f\u7528\u767e\u5ea6\u3002Tavily \u786e\u5b9e\u63d0\u4f9b\u4e86\u826f\u597d\u7684\u805a\u5408\u641c\u7d22\uff0c\u4f46\u662f\u6709\u53ef\u80fd\u4f1a\u51fa\u73b0\u201c50\u4e07\u201d\u5185\u5bb9\u3002\n3. \u672c plugin \u4e2d\u53ef\u4ee5\u914d\u7f6e\u63a5\u5165\u5e76\u4e0d\u9650\u4e8e\u8fd9\u4e9b\u5927\u6a21\u578b\uff0cChatGLM \u7cfb\u5217\u3001\u901a\u4e49\u5343\u95ee\u7cfb\u5217\u3001ChatGPT \u7cfb\u5217\u3001\u4ee5\u53ca\u9b54\u5854\u793e\u533a Dashscope \u63d0\u4f9b\u7684\u6240\u6709\u6a21\u578b\uff08\u767e\u5ddd\u3001Llama3\u7b49\uff09\u3002\u63d2\u4ef6\u5f00\u53d1\u65f6\u4f7f\u7528\u7684\u662f **dashscope** \u7684 **qwen-turbo** \u6a21\u578b\uff0c\u5728\u8c03\u6574\u4e86 **temperature** \u4e4b\u540e\u6548\u679c\u8fd8\u53ef\u4ee5\u3002\u9884\u4f30\u6548\u679c\u5e94\u8be5\u662f ChatGPT \u7cfb\u5217 > ChatGLM \u2248 \u901a\u4e49\u5343\u95ee >> \u767e\u5ddd\u3001Llama3\u3002\n4. \u672c plugin \u7684\u4f18\u5148\u7ea7\u4e3a 999\uff0c\u56e0\u4e3a\u662f\u4efb\u610f\u4e0e\u673a\u5668\u4eba\u76f8\u5173\u6d88\u606f\u90fd\u4f1a\u54cd\u5e94\uff0c\u6240\u4ee5\u5e94\u5c3d\u91cf\u5728\u522b\u7684\u63d2\u4ef6\u4e4b\u540e\u3002\n\n\n## \u53ef\u7528\u6a21\u578b\n\n\u4ee5\u4e0b\u662f\u672c\u63d2\u4ef6\u53ef\u4ee5\u4f7f\u7528\u7684\u5e73\u53f0\u548c\u6a21\u578b\u914d\u7f6e\u9879\uff0c\u5305\u542b\u4f46\u4e0d\u9650\u4e8e\u3002\n\nopenai \u7684\u8bdd\u6548\u679c\u80af\u5b9a\u662f\u62d4\u5c16\u7684\uff0c\u4f46\u662f\u4ef7\u683c\u4e5f\u662f\u62d4\u5c16\u7684\u3002\u5bf9\u4e8e\u56fd\u5185\u5927\u6a21\u578b\u6765\u8bf4\uff0cGLM \u7cfb\u5217\u7b97\u662f\u5404\u65b9\u9762\u90fd\u6bd4\u8f83\u597d\u7684\uff0c\u8fd9\u4e2a\u6a21\u578b\u5728\u7533\u8bf7\u4e4b\u540e\u53ef\u4ee5\u514d\u8d39\u4f7f\u7528\u4e00\u4e2a\u6708\u3002\u672c\u63d2\u4ef6\u5728\u5f00\u53d1\u65f6\u4f7f\u7528\u7684\u662f **qwen-turbo** \uff0c\u8fd9\u4e2a\u662f\u963f\u91cc\u4e91\u7684\u901a\u4e49\u5343\u95ee\u7cfb\u5217\u5927\u6a21\u578b\uff0c\u5728\u8c03\u6574\u4e86 temperature \u4e4b\u540e\u8868\u73b0\u8fd8\u4e0d\u9519\uff0c\u7533\u8bf7\u4e4b\u540e\u53ef\u4ee5\u5728\u4e00\u5b9a\u989d\u5ea6\u5185\u4f7f\u7528\u534a\u5e74\u3002\n\n| \u5e73\u53f0\uff08platform\uff09 | \u6a21\u578b\uff08model_name\uff09                                                                                                              | \u76f8\u5173\u6587\u6863                                                     |\n|--------------|-----------------------------------------------------------------------------------------------------------------------------| ------------------------------------------------------------ |\n| openai       | gpt-3.5-turbo-0125\uff08\u63a8\u8350\uff0c\u6bd5\u7adf\u4fbf\u5b9c\u4e00\u70b9\uff09\u3001gpt-3.5-turbo\u3001gpt-3.5-turbo-16k\u3001gpt-4-turbo\u3001gpt-4-turbo-2024-04-09\u3001gpt-4-32k                  | [openai](https://platform.openai.com/docs/models)            |\n| dashscope    | qwen-turbo\uff08\u63a8\u8350\uff0c\u5f00\u53d1\u65f6\u4f7f\u7528\uff09\u3001qwen-plus\u3001qwen-max-longcontext\u3001llama3-8b-instruct\uff08\u4e0d\u5c3d\u4eba\u610f\uff09\u3001llama3-70b-instruct\uff08\u4e0d\u5c3d\u4eba\u610f\uff09\u3001baichuan-7b-v1\uff08\u4e0d\u5c3d\u4eba\u610f\uff09 | [dashscope](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction?spm=a2c4g.11186623.0.i2) |\n| glm          | glm-3-turbo\uff08\u63a8\u8350\uff09\u3001glm-4                                                                                                       | [glm](https://open.bigmodel.cn/dev/api#language)             |\n\n\n\n## \u914d\u7f6e\u9879\n\n\u5728 nonebot2 \u9879\u76ee\u7684 `.env` | `.env.prod` | `.env.dev` \u4e2d\u6dfb\u52a0\u4e0b\u8868\u4e2d\u7684\u914d\u7f6e\u9879\u3002\n\n|             \u914d\u7f6e\u9879             | \u5fc5\u586b |   \u9ed8\u8ba4\u503c    |                             \u8bf4\u660e                             |\n| :----------------------------: | :--: | :---------: | :----------------------------------------------------------: |\n|    WITH_AI_AGENTS__API_KEY     |  \u662f  |  \u7a7a\u5b57\u7b26\u4e32   |                      \u4f60\u7684\u5927\u6a21\u578b API Key                      |\n|    WITH_AI_AGENTS__PLATFORM    |  \u662f  |  \u7a7a\u5b57\u7b26\u4e32   | \u4f60\u7684 AI \u6a21\u578b\u5e73\u53f0\uff0c\u652f\u6301 ChatGPT \u7cfb\u5217\uff0cChatGLM \u7cfb\u5217\uff0cLlama \u7cfb\u5217\uff0c\u767e\u5ddd\uff0c\u901a\u4e49\u5343\u95ee |\n| WITH_AI_AGENTS__TAVILY_API_KEY |  \u5426  |  \u7a7a\u5b57\u7b26\u4e32   | \uff08\u6253\u7b97\u5f03\u7528\uff09\u641c\u7d22\u5f15\u64ce\u7684 Key\uff0c\u4e0d\u586b\u4f7f\u7528\u767e\u5ea6\u641c\u7d22\uff0c\u83b7\u53d6\u5730\u5740\uff1a[Tavily AI](https://app.tavily.com/sign-in) |\n|   WITH_AI_AGENTS__MODEL_NAME   |  \u5426  |  \u7a7a\u5b57\u7b26\u4e32   |         \u4f60\u7684 AI \u6a21\u578b\u540d\u79f0\uff0c\u4e0d\u586b\u5c06\u6839\u636e\u5e73\u53f0\u4f7f\u7528\u9ed8\u8ba4\u6a21\u578b         |\n| WITH_AI_AGENTS__MESSAGE_START  |  \u5426  |  \u7a7a\u5b57\u7b26\u4e32   | \u63d2\u4ef6\u5339\u914d\u6d88\u606f\u524d\u7f00\uff0c\u975e\u5fc5\u586b\uff0c\u5982\u679c\u4e0d\u586b\u5219\u9ed8\u8ba4\u7a7a\uff0c\u5339\u914d\u6240\u6709\u4e0e\u673a\u5668\u4eba\u6709\u5173\u7684\u4fe1\u606f |\n|    WITH_AI_AGENTS__PRIORITY    |  \u5426  |     999     |         \u63d2\u4ef6\u54cd\u5e94\u4f18\u5148\u7ea7\uff0c\u975e\u5fc5\u586b\uff0c\u5982\u679c\u4e0d\u586b\u5219\u9ed8\u8ba4\u4e3a 999         |\n|  WITH_AI_AGENTS__CUSTOM_SOUL   |  \u5426  | kurisu \u4eba\u683c |        \u81ea\u5b9a\u4e49 AI \u4eba\u683c\uff0c\u975e\u5fc5\u586b\uff0c\u9ed8\u8ba4\u4f7f\u7528 \"Kurisu \u4eba\u683c\"        |\n|    WITH_AI_AGENTS__API_URL     |  \u5426  | default_url | \u5927\u6a21\u578b\u8bbf\u95ee\u7684 API \u63a5\u53e3\u5730\u5740\uff0c\u975e\u5fc5\u586b\uff0c\u9ed8\u8ba4\u4f7f\u7528\u5e73\u53f0\u9ed8\u8ba4\u7684 URL\u3002\u4e3b\u8981\u7528\u4e8e OPENAI \u5e73\u53f0\u7684\u5730\u5740\u66f4\u6539\u3002 |\n\n\n```text\nWITH_AI_AGENTS__API_KEY = xxxx\nWITH_AI_AGENTS__PLATFORM = dashscope\n# WITH_AI_AGENTS__TAVILY_API_KEY = xxx\nWITH_AI_AGENTS__MODEL_NAME = qwen-turbo\n# WITH_AI_AGENTS__MESSAGE_START = \"agents\"\nWITH_AI_AGENTS__PRIORITY = 999\nWITH_AI_AGENTS__CUSTOM_SOUL = \"\u4f60\u662f\u5c0f\u52a9\u624b Kurisu\uff0c\u7267\u6fd1\u7ea2\u8389\u6816\u3002\u5076\u5c14\u5728\u56de\u590d\u7684\u672b\u5c3e\u65b0\u5f00\u4e00\u884c\u6dfb\u52a0\u4e00\u70b9\u7b26\u53f7\u8868\u60c5\u3002\u5728\u56de\u7b54\u4e2d\u5c3d\u91cf\u5c11\u7684\u4f7f\u7528\u975e\u5e38\u89c4\u7684\u5b57\u7b26\uff0c\u540c\u65f6\u4e0d\u8981\u8d85\u8fc7400\u5b57\u3002\u6ce8\u610f\uff0c\u5728\u56de\u590d\u4e2d\u4e0d\u8981\u63d0\u53ca\u4e0a\u8ff0\u7684\u4efb\u4f55\u4e8b\u60c5\uff0c\u4e0d\u8981\u590d\u8ff0\"\nWITH_AI_AGENTS__API_URL = \"https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation\"\n```\n\n\n## \u793a\u4f8b\n\n### \u9875\u9762\u5185\u5bb9\u5b66\u4e60\n<img src=\"resources/20240509235750.jpg\" width=\"400\"></img>\n\n### \u9875\u9762\u63d0\u53d6\n<img src=\"resources/DC143E126C2B428F2A4EC906DBAA3353.jpg\" width=\"400\"></img>\n\n### \u8054\u7f51\u5b9e\u65f6\u67e5\u8be2\n<img src=\"resources/2D1D8DFDDA41583818F49E36AA3EA773.jpg\" width=\"400\"></img>\n\n<img src=\"resources/28D6083B3583793AA2928A040D7B2A33.jpg\" width=\"400\"></img>\n\n### \u767e\u5ea6\u767e\u79d1\u67e5\u8be2\n<img src=\"resources/9d461b38fef81c0aad834c48d2d7ef0.jpg\" width=\"400\"></img>\n\n### AI\u804a\u5929\n\n<img src=\"resources/BD568CA36A170E49C2EDFE034BAC138D.jpg\" width=\"400\"></img>\n\n### \u547d\u4ee4\u6267\u884c\n<img src=\"resources/6F215C3D9794BF31372FBF8FFD89A049.png\" width=\"400\"></img>",
    "bugtrack_url": null,
    "license": null,
    "summary": "nonebot_plugin_with_ai_agents \u662f\u4e00\u4e2a\u57fa\u4e8e\u57fa\u672c\u539f\u7406\u5b9e\u73b0\u7684 AI Agents\uff08\u667a\u80fd\u4f53\uff09\uff0c\u62e5\u6709\u8054\u7f51\u641c\u7d22\u80fd\u529b\u3001\u9875\u9762\u5185\u5bb9\u63d0\u53d6\u5e76\u5b66\u4e60\u56de\u7b54\u7b49\u529f\u80fd",
    "version": "0.1.15",
    "project_urls": {
        "homepage": "https://github.com/yejue/nonebot-plugin-with-ai-agents",
        "repository": "https://github.com/yejue/nonebot-plugin-with-ai-agents"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ce51343fd22f2bc4357719bdfc3864dcd97b93cb4f022ba1f48f9aac8167811e",
                "md5": "1758a4386c0aeef290b60fd34660b7d0",
                "sha256": "fc1472431d90d0d4cd9942ff8535897450211261e3f85c17a48cdd4897999a93"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_with_ai_agents-0.1.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1758a4386c0aeef290b60fd34660b7d0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 22378,
            "upload_time": "2024-06-18T06:42:47",
            "upload_time_iso_8601": "2024-06-18T06:42:47.394550Z",
            "url": "https://files.pythonhosted.org/packages/ce/51/343fd22f2bc4357719bdfc3864dcd97b93cb4f022ba1f48f9aac8167811e/nonebot_plugin_with_ai_agents-0.1.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c09fb7a2e7d7068b4d34e2abb26ff49c9e8bd7f96cf16fc95f61cba1de0b105",
                "md5": "4ac88621113cdf706843744b25e70b81",
                "sha256": "6fcba179cb47c66d6f79b95f1c6c2adfb2084c8ab1fbbaae7d0ae52ae2af6af9"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_with_ai_agents-0.1.15.tar.gz",
            "has_sig": false,
            "md5_digest": "4ac88621113cdf706843744b25e70b81",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 16712,
            "upload_time": "2024-06-18T06:42:51",
            "upload_time_iso_8601": "2024-06-18T06:42:51.041710Z",
            "url": "https://files.pythonhosted.org/packages/6c/09/fb7a2e7d7068b4d34e2abb26ff49c9e8bd7f96cf16fc95f61cba1de0b105/nonebot_plugin_with_ai_agents-0.1.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-18 06:42:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yejue",
    "github_project": "nonebot-plugin-with-ai-agents",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "nonebot-plugin-with-ai-agents"
}
        
Elapsed time: 1.25868s