在ChatGpt引领的AI浪潮下,一大批优秀的AI应用应运而生,其中不泛一些在某些行业或领域中探索AI技术或应用落地的案例。不得不说,AI正在重塑各个行业。众所周知,Rasa是一个非常优秀的,用于构建开源AI助手的框架,它允许开发人员创建自然语言对话系统,包括聊天机器人、语音助手和智能助手。本文介绍的是一个基于Rasa和Langchain之上,通过将LLM的能力赋予Rasa建立的聊天机器人平台。
关于LangChain,之前有写过一篇文章,感兴趣的可以自取饮用:LangChain 完整指南:使用大语言模型构建强大的应用程序
下文译自github,它的github地址为:https://github.com/paulpierre/RasaGPT
💬 RasaGpt是一个建立在Rasa[1]和Langchain[2]之上的没有显示界面的LMM聊天机器人平台。它是一个Rasa和Telegram这种利用像Langchain这样的LMM库进行索引、检索和上下文注入的样板及参考实现。
•📚 资源: https://rasagpt.dev•🧑💻 Github链接: https://github.com/paulpierre/RasaGPT•🧙 作者: @paulpierre[3]
RasaGPT Youtube 视频
用他们自己的话来说:
💬 Rasa是一个开源(Python)机器学习框架,用于自动化基于文本和语音的对话:NLU,对话管理,连接到Slack,Facebook等 - 创建聊天机器人和语音助手。
用我的话来说:
这个文本讨论了一个名为Rasa[5]的聊天机器人框架。它是一个流行的框架,具有内置的NLU(自然语言理解)ML(机器学习)管道,但这些管道已经过时,需要重新设计以适应LLM(语言模型)的世界。其中使用了以下技术术语:
•聊天机器人框架:一种软件工具,用于构建和部署聊天机器人。•NLU(自然语言理解):一种人工智能技术,用于将自然语言文本转换为机器可理解的形式。•ML(机器学习):一种人工智能技术,用于训练机器学习算法以识别模式和做出预测。•管道:指将多个步骤或过程连接在一起的方法,通常用于自动化流程。在这种情况下,管道指NLU ML管道,它是用于处理自然语言的一系列算法和技术的集合。•过时:指已经过时或不再适用的技术或方法。•重新设计:指重新设计或重新构思现有的技术或方法,以使其更加适应新的需求或环境。•LLM(语言模型):一种深度学习技术,用于生成自然语言文本。在这种情况下,作者认为Rasa需要重新设计以适应LLM的世界。
RasaGpt开箱即用。很多实现细节都已经处理好了,你不需要自己动手,包括:
•使用FastAPI创建你自己的专有bot端点,包括文档上传和“训练”流程。•如何将Langchain/LlamaIndex和Rasa集成。•与LLM库的库冲突和元数据传递。•支持在MacOS上运行Rasa的Docker化。•通过ngrok实现与聊天机器人的反向代理。•使用你自己的定制模式的pgvector,而不是使用Langchain高度偏见的PGVector类。•在Rasa和你自己的后端/应用程序之间添加多租户(Rasa本身不支持此功能)、会话和元数据。
这个背景故事很熟悉。一个朋友来找我帮忙解决问题。我在 Google和Github上搜索了一个与 Rasa 集成的LLM 的优秀参考实现,但是一无所获。我认为这是一个满足我的好奇心的绝佳机会,2 天之后,我有一个概念验证,一周之后,这就是我想到的。
⚠️ 使用时须谨慎: 这远非生产代码,充满提示注入和一般安全漏洞。我只希望有人会发现这很有用😊
开始使用很容易,只需要确认满足以下依赖项。
⚠️⚠️⚠️ 注意非 macOS 用户: 如果您正在使用 Linux 或 Windows,您需要将图片名称从
khalosa/rasa-aarch64:3.5.2
更改为rasa/rasa:latest
,具体操作在 docker-compose.yml 的第64行[6] 和 此处操作的 actions Dockerfile 的第1行[7]。
# 获取代码
git clone https://github.com/paulpierre/RasaGPT.git
cd RasaGPT
## 设置.env文件
cp .env-example .env
# 编辑您的.env文件并添加所有必要的凭证
make install
# 输入 "make" 来查看更多选项
make
•LLM 使用 Langchain 对任意语料库进行“学习”•通过 FastAPI[8] 上传文档并进行“训练”•支持文档版本控制,上传时自动执行“重新训练”•可通过 FastAPI[9] 和 SQLModel[10] 自定义异步端点和数据库模型•机器人可确定是否需要人工干预•机器人可根据用户问题和响应自动生成标签•包含完整的 API 文档,包括 Swagger[11] 和 Redoc[12]•包含 PGAdmin[13],以便您浏览数据库•自动在启动时生成 Ngrok[14] 端点,因此始终可以通过 https://t.me/yourbotname
访问您的机器人•利用 Postgres 自带的功能和 pgvector[15] 实现嵌入式相似度搜索•包含 虚拟数据[16],供您进行测试和实验•无限多的用例,包括帮助台、客户支持、测验、电子学习、地下城与巨龙等
•基于 Rasa[17] 构建,这是聊天平台开源的黄金标准•支持 MacOS M1/M2,使用 Docker (标准 Rasa 镜像 不支持 MacOS 架构[18])•支持 Telegram,可轻松集成 Slack、Whatsapp、Line、SMS 等•利用 Huggingface 的 NLU 模型(如 BERT)或使用 Keras、Tensorflow 等库/框架来设置复杂的对话流水线,OpenAI GPT 作为备用方案
•利用Langchain扩展语言、记忆等能力•模式支持多租户、会话和数据存储•自定义代理人个性•保存所有聊天记录,并使用所有互动创建嵌入,未来可形成检索策略•自动从知识库语料库和客户反馈中生成嵌入
•Python3.9•Docker和Docker Compose (Docker Desktop for Mac OS[19])•Open AI API密钥[20]•Telegram bot 凭据[21]•Ngrok 认证令牌[22]•Make (Mac OS[23]/ Windows[24])•SQLModel
git clone https://github.com/paulpierre/RasaGPT.git
cd RasaGPT
cp .env-example .env
# 编辑 .env 文件以及所有凭据
在任何时候,只需输入 make
即可显示选项列表,主要用于调试:
使用根目录中的 Makefile
是开始的最简单的方法。它将按正确的顺序安装和运行所有 RasaGPT 服务。
make install
# 这将自动安装并运行 RasaGPT
# 安装完成后,重新运行只需运行
make run
如果您想专注于在API上进行开发,则可以使用单独的Makefile
。这将为您创建本地虚拟环境。
# 假设您已经在RasaGpt目录中
cd app/api
make install
# 这将自动安装和运行RasaGPT
# 安装完成后,要再次运行,只需运行
make run
同样,输入make
以查看完整的命令列表
安装应该由自动化完成,应该如下所示:
👉 完整的安装记录:https://app.warp.dev/block/vflua6Eue29EPk8EVvW8Kd
Docker的安装过程大致分为以下步骤:
1.检查是否有.env
文件可用2.使用[pgvector
](https://github.com/pgvector/pgvector)初始化数据库3.数据库模型创建数据库模式4.训练Rasa模型,使其准备好运行5.使用Rasa设置ngrok,以便Telegram具有回复您的API服务器的Webhook6.设置Rasa actions服务器,以便Rasa可以与RasaGPT API进行通信7.使用seed.py
将数据库填充有虚拟数据
您可以通过访问👉 https://t.me/yourbotsname 来开始与您的机器人聊天
你可以访问👉 https://localhost:9999/ 来查看所有日志,它会实时显示所有docker容器的日志。
Dozzle
访问👉 https://localhost:8888/docs 可以查看API端点文档。
在此页面上,您可以创建和更新实体,以及将文档上传到知识库中。
Swagger Docs
这个机器人只是一个概念验证,尚未针对检索进行优化。它目前使用1000字符长度分块进行索引和基本欧几里得距离进行检索,质量常常高低不一。
你可以在 RESULTS.MD[25] 文件中查看机器人的示例结果。总体而言,我估计索引优化和LLM配置更改可以将输出质量提高70%以上。
👉 点击这里查看在RESULTS.MD中演示数据的问答结果[26]
REST API很简单,可以访问文档 👉 http://localhost:8888/docs
以下实体具有基本的CRUD操作,并返回JSON格式数据
可以将其视为多租户世界中作为客户的公司。默认情况下,提供了一系列虚拟组织的列表。
Screenshot 20230505 at 84528 AMpng
[
{
"id": 1,
"uuid": "d2a642e6-c81a-4a43-83e2-22cee3562452",
"display_name": "Pepe Corp.",
"namespace": "pepe",
"bot_url": null,
"created_at": "2023-05-05T10:42:45.933976",
"updated_at": "2023-05-05T10:42:45.933979"
},
{
"id": 2,
"uuid": "7d574f88-6c0b-4c1f-9368-367956b0e90f",
"display_name": "Umbrella Corp",
"namespace": "acme",
"bot_url": null,
"created_at": "2023-05-05T10:43:03.555484",
"updated_at": "2023-05-05T10:43:03.555488"
},
{
"id": 3,
"uuid": "65105a15-2ef0-4898-ac7a-8eafee0b283d",
"display_name": "Cyberdine Systems",
"namespace": "cyberdine",
"bot_url": null,
"created_at": "2023-05-05T10:43:04.175424",
"updated_at": "2023-05-05T10:43:04.175428"
},
{
"id": 4,
"uuid": "b7fb966d-7845-4581-a537-818da62645b5",
"display_name": "Bluth Companies",
"namespace": "bluth",
"bot_url": null,
"created_at": "2023-05-05T10:43:04.697801",
"updated_at": "2023-05-05T10:43:04.697804"
},
{
"id": 5,
"uuid": "9283d017-b24b-4ecd-bf35-808b45e258cf",
"display_name": "Evil Corp",
"namespace": "evil",
"bot_url": null,
"created_at": "2023-05-05T10:43:05.102546",
"updated_at": "2023-05-05T10:43:05.102549"
}
]
可以将其视为属于公司的产品。您可以查看属于组织的项目列表,如下所示:
orgprojectspng
[
{
"id": 1,
"documents": [
{
"id": 1,
"uuid": "92604623-e37c-4935-bf08-0e9efa8b62f7",
"display_name": "project-pepetamine.md",
"node_count": 3
}
],
"document_count": 1,
"uuid": "44a4b60b-9280-4b21-a676-00612be9aa87",
"display_name": "Pepetamine",
"created_at": "2023-05-05T10:42:46.060930",
"updated_at": "2023-05-05T10:42:46.060934"
},
{
"id": 2,
"documents": [
{
"id": 2,
"uuid": "b408595a-3426-4011-9b9b-8e260b244f74",
"display_name": "project-frogonil.md",
"node_count": 3
}
],
"document_count": 1,
"uuid": "5ba6b812-de37-451d-83a3-8ccccadabd69",
"display_name": "Frogonil",
"created_at": "2023-05-05T10:42:48.043936",
"updated_at": "2023-05-05T10:42:48.043940"
},
{
"id": 3,
"documents": [
{
"id": 3,
"uuid": "b99d373a-3317-4699-a89e-90897ba00db6",
"display_name": "project-kekzal.md",
"node_count": 3
}
],
"document_count": 1,
"uuid": "1be4360c-f06e-4494-bf20-e7c73a56f003",
"display_name": "Kekzal",
"created_at": "2023-05-05T10:42:49.092675",
"updated_at": "2023-05-05T10:42:49.092678"
},
{
"id": 4,
"documents": [
{
"id": 4,
"uuid": "94da307b-5993-4ddd-a852-3d8c12f95f3f",
"display_name": "project-memetrex.md",
"node_count": 3
}
],
"document_count": 1,
"uuid": "1fd7e772-365c-451b-a7eb-4d529b0927f0",
"display_name": "Memetrex",
"created_at": "2023-05-05T10:42:50.184817",
"updated_at": "2023-05-05T10:42:50.184821"
},
{
"id": 5,
"documents": [
{
"id": 5,
"uuid": "6deff180-3e3e-4b09-ae5a-6502d031914a",
"display_name": "project-pepetrak.md",
"node_count": 4
}
],
"document_count": 1,
"uuid": "a389eb58-b504-48b4-9bc3-d3c93d2fbeaa",
"display_name": "PepeTrak",
"created_at": "2023-05-05T10:42:51.293352",
"updated_at": "2023-05-05T10:42:51.293355"
},
{
"id": 6,
"documents": [
{
"id": 6,
"uuid": "2e3c2155-cafa-4c6b-b7cc-02bb5156715b",
"display_name": "project-memegen.md",
"node_count": 5
}
],
"document_count": 1,
"uuid": "cec4154f-5d73-41a5-a764-eaf62fc3db2c",
"display_name": "MemeGen",
"created_at": "2023-05-05T10:42:52.562037",
"updated_at": "2023-05-05T10:42:52.562040"
},
{
"id": 7,
"documents": [
{
"id": 7,
"uuid": "baabcb6f-e14c-4d59-a019-ce29973b9f5c",
"display_name": "project-neurokek.md",
"node_count": 5
}
],
"document_count": 1,
"uuid": "4a1a0542-e314-4ae7-9961-720c2d092f04",
"display_name": "Neuro-kek",
"created_at": "2023-05-05T10:42:53.689537",
"updated_at": "2023-05-05T10:42:53.689539"
},
{
"id": 8,
"documents": [
{
"id": 8,
"uuid": "5be007ec-5c89-4bc4-8bfd-448a3659c03c",
"display_name": "org-about_the_company.md",
"node_count": 5
},
{
"id": 9,
"uuid": "c2b3fb39-18c0-4f3e-9c21-749b86942cba",
"display_name": "org-board_of_directors.md",
"node_count": 3
},
{
"id": 10,
"uuid": "41aa81a9-13a9-4527-a439-c2ac0215593f",
"display_name": "org-company_story.md",
"node_count": 4
},
{
"id": 11,
"uuid": "91c59eb8-8c05-4f1f-b09d-fcd9b44b5a20",
"display_name": "org-corporate_philosophy.md",
"node_count": 4
},
{
"id": 12,
"uuid": "631fc3a9-7f5f-4415-8283-78ff582be483",
"display_name": "org-customer_support.md",
"node_count": 3
},
{
"id": 13,
"uuid": "d4c3d3db-6f24-433e-b2aa-52a70a0af976",
"display_name": "org-earnings_fy2023.md",
"node_count": 5
},
{
"id": 14,
"uuid": "08dd478b-414b-46c4-95c0-4d96e2089e90",
"display_name": "org-management_team.md",
"node_count": 3
}
],
"document_count": 7,
"uuid": "1d2849b4-2715-4dcf-aa68-090a221942ba",
"display_name": "Pepe Corp. (company)",
"created_at": "2023-05-05T10:42:55.258902",
"updated_at": "2023-05-05T10:42:55.258904"
}
]
这可以被视为与产品相关的工件,例如FAQ页面或包含财务报表收益的PDF。您可以像这样查看与组织的项目相关联的所有文档:
documentspng
{
"id": 1,
"uuid": "44a4b60b-9280-4b21-a676-00612be9aa87",
"organization": {
"id": 1,
"uuid": "d2a642e6-c81a-4a43-83e2-22cee3562452",
"display_name": "Pepe Corp.",
"bot_url": null,
"status": 2,
"created_at": "2023-05-05T10:42:45.933976",
"updated_at": "2023-05-05T10:42:45.933979",
"namespace": "pepe"
},
"document_count": 1,
"documents": [
{
"id": 1,
"uuid": "92604623-e37c-4935-bf08-0e9efa8b62f7",
"organization_id": 1,
"project_id": 1,
"display_name": "project-pepetamine.md",
"url": "",
"data": "# Pepetamine\n\nProduct Name: Pepetamine\n\nPurpose: Increases cognitive focus just like the Limitless movie\n\n**How to Use**\n\nPepetamine is available in the form of rare Pepe-coated tablets. The recommended dosage is one tablet per day, taken orally with a glass of water, preferably while browsing your favorite meme forum for maximum cognitive enhancement. For optimal results, take Pepetamine 30 minutes before engaging in mentally demanding tasks, such as decoding ancient Pepe hieroglyphics or creating your next viral meme masterpiece.\n\n**Side Effects**\n\nSome potential side effects of Pepetamine may include:\n\n1. Uncontrollable laughter and a sudden appreciation for dank memes\n2. An inexplicable desire to collect rare Pepes\n3. Enhanced meme creation skills, potentially leading to internet fame\n4. Temporary green skin pigmentation, resembling the legendary Pepe himself\n5. Spontaneously speaking in \"feels good man\" language\n\nWhile most side effects are generally harmless, consult your memologist if side effects persist or become bothersome.\n\n**Precautions**\n\nBefore taking Pepetamine, please consider the following precautions:\n\n1. Do not use Pepetamine if you have a known allergy to rare Pepes or dank memes.\n2. Pepetamine may not be suitable for individuals with a history of humor deficiency or meme intolerance.\n3. Exercise caution when driving or operating heavy machinery, as Pepetamine may cause sudden fits of laughter or intense meme ideation.\n\n**Interactions**\n\nPepetamine may interact with other substances, including:\n\n1. Normie supplements: Combining Pepetamine with normie supplements may result in meme conflicts and a decreased sense of humor.\n2. Caffeine: The combination of Pepetamine and caffeine may cause an overload of energy, resulting in hyperactive meme creation and potential internet overload.\n\nConsult your memologist if you are taking any other medications or substances to ensure compatibility with Pepetamine.\n\n**Overdose**\n\nIn case of an overdose, symptoms may include:\n\n1. Uncontrollable meme creation\n2. Delusions of grandeur as the ultimate meme lord\n3. Time warps into the world of Pepe\n\nIf you suspect an overdose, contact your local meme emergency service or visit the nearest meme treatment facility. Remember, the key to enjoying Pepetamine is to use it responsibly, and always keep in mind the wise words of our legendary Pepe: \"Feels good man.\"",
"hash": "fdee6da2b5441080dd78e7850d3d2e1403bae71b9e0526b9dcae4c0782d95a78",
"version": 1,
"status": 2,
"created_at": "2023-05-05T10:42:46.755428",
"updated_at": "2023-05-05T10:42:46.755431"
}
],
"display_name": "Pepetamine",
"created_at": "2023-05-05T10:42:46.060930",
"updated_at": "2023-05-05T10:42:46.060934"
}
尽管节点在API中没有暴露,但节点是文档的一部分,其嵌入被生成。节点用于检索搜索以及上下文注入。节点属于文档。
用户代表与机器人交流的人。用户不一定属于组织或产品,但这种关系在下面的ChatSession中得到了捕捉。
虽然不通过API暴露,但这表示用户和机器人之间的问答会话。每个会话对象都可以通过自动生成的session_id
灵活地标识。ChatSession包含可用于训练和优化的丰富元数据。ChatSessions通过/chat
端点实际上与组织相关联(出于多租户安全目的)
1.Rasa处理与通信渠道的集成,在这种情况下是Telegram。•它特别处理目标Webhook用户反馈应经过的提交。在我们的情况下,它是通过/webhooks/{channel}/ webhook
提交到我们的FastAPI服务器的。2.Rasa有两个组件,一个是核心的Rasa应用程序,另一个是运行的Rasa操作服务器。3.必须通过几个yaml文件进行配置(已完成):•config.yml - 包含NLU流水线和策略配置。重要的是设置FallbackClassifier阈值。•credentials.yml - 包含我们Webhook和Telegram凭据的路径。这将通过helper服务“rasa-credentials”通过app/rasa-credentials/main.py进行更新。•domain.yml - 这包含聊天入口逻辑配置,如意图和对意图采取的操作。在这里,我们添加了action_gpt_fallback动作,这将触发我们的操作服务器。•endpoints.yml - 这是我们为Rasa设置自定义动作终点的地方,以触发我们的回退。•nlu.yml - 这是我们设置intent out_of_scope的地方。•rules.yml - 我们为该意图设置了一个规则,它应该触发操作action_gpt_fallback。•actions.py - 这是我们通过ActionGPTFallback类定义和表达操作的地方。方法名称返回我们为上面的意图定义的操作。4.必须训练Rasa的NLU模型,这可以通过CLI使用rasa train完成。当您运行make install时自动完成此操作。5.Rasa的核心必须在训练后通过rasa run运行。6.Rasa的操作服务器必须分别使用rasa run actions运行。
1.Rasa会自动使用你在 credentials.yml[27] 文件中设置的回调webhook,自动更新Telegram Bot API。2.默认情况下,这是静态的。因为我们正在本地运行,我们利用了 Ngrok[28] 生成一个公开访问的URL,并进行反向隧道进入我们的Docker容器。3.rasa-credentials
服务会为您处理此过程。Ngrok作为服务运行,一旦准备就绪,rasa-credentials
就会调用本地ngrok API获取隧道URL,并更新 credentials.yml
文件,然后为您重新启动Rasa。4.Telegram将要发送消息的webhook将是我们的FastAPI服务器。为什么选择这个而不是Rasa?因为我们想灵活地捕获元数据,Rasa使这变得非常困难,而且将其集中到API服务器上是理想的。5.FastAPI服务器将其转发到Rasa webhook。6.Rasa然后会根据用户意图确定采取何种行动。由于为了进行此演示,意图已经被减弱了,所以它将进入运行在actions.py
的回退动作。7.自定义动作将捕获元数据,并将来自FastAPI的响应转发给用户。
pgvector
是Postgres的一个插件,安装后可以存储和计算向量数据类型。我们开发了自己的实现,是因为Langchain的PGVector类不够灵活,无法适应我们的架构,我们需要更高的灵活性。
1.在Postgres中,默认情况下,如果数据库尚未初始化,则容器路径/docker-entry-initdb.d
中的任何文件都会运行。在postgres Dockerfile[29]中,我们复制create_db.sh
[30]文件,该文件创建我们数据库的db和user。2.在Makefile[31]中的models.py[32]处于API容器中运行该命令,该命令创建来自这个模型的表。3.enable_vector
方法[33]在数据库中启用pgvector扩展。
1.将培训数据加载到数据库中。2.如果索引不存在[34],则对数据进行索引,将其存储在名为index.json
的文件中。3.LlamaIndex使用基本的GPTSimpleVectorIndex
[35]来查找相关数据,并将其注入到提示中。4.通过提示来确保对话的焦点。
1.用户将在 Telegram 聊天,并且消息将经过现有意图[36]的筛选。2.如果它检测到没有意图匹配,而是匹配了out_of_scope
,基于 rules.yml[37]将会触发action_gpt_fallback
动作。3.ActionGPTFallback函数[38]将会调用FastAPI API服务器[39]。4.API使用LlamaIndex找到相关的索引内容,并将其注入到发送给OpenAI进行推理的提示中。5.提示包含对话保护框架,包括:•请求以JSON形式返回数据•基于用户的问题创建分类标记•如果没有上下文匹配,则返回一个布尔值,以将会话升级到人类
• 编写测试 😅• 实现LlamaIndex优化• 实施聊天记录• 实现查询路由抽象[40],以了解使用哪种搜索策略(一次性与少量)• 探索其他索引方法,如树索引、关键字索引• 添加聊天记录以进行快速回忆和上下文设置• 添加次要对抗性代理(Dual pattern model[41])并尝试以下潜在功能:• 确定问题是否已经得到了回答,如果没有,重新优化搜索策略• 确保注入提示没有发生• 通过探索来增加基础相似性搜索:• 根据历史查询定期生成“假”文档嵌入,并通过HyDE pattern[42]连接到实际文档• 根据文档定期生成“假”用户查询,并将其与实际文档相关联,以便用户输入搜索和“假”查询可以更好地匹配
通常情况下,只需访问 👉 http://localhost:9999/ 即可检查您的 Docker 容器日志。
始终检查您与 ngrok 和 Telegram 的 Webhook 是否匹配。只需执行以下操作:
curl -sS "https://api.telegram.org/bot<your-bot-secret-token>/getWebhookInfo" | json_pp
上述命令应返回此内容:
{
"ok": true,
"result": {
"url": "https://b280-04-115-40-112.ngrok-free.app/webhooks/telegram/webhook",
"has_custom_certificate": false,
"pending_update_count": 0,
"max_connections": 40,
"ip_address": "1.2.3.4"
}
}
.. 其中应该与您的 credentials.yml
文件中的 URL 匹配,或访问 Ngrok 管理 UI 👉 http://localhost:4040/status
ngrokadminpng
看起来它是匹配的。如果不是,请通过运行以下命令重启所有内容:
make restart
•欢迎拉取请求•请通过 Github 提交问题,我将尽力解决它们•如果您想联系我,请随时通过 @paulpierre
[43]在 Twitter 上与我联系
thumbsup 恭喜,所有你的基地都属于我们了!拜拜
版权所有 (c) 2023 Paul Pierre。特此免费授权任何获得此软件及其相关文档文件(“软件”)的人,无限制地处理该软件,包括但不限于使用,复制,修改,合并,出版,分发,再次许可和/或出售该软件的副本,并允许获得软件的人员这样做,但须符合以下条件:在所有副本或实质部分的软件中必须包含以上版权声明和本许可声明。本软件按“原样”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途的适用性和非侵权性。在任何情况下,作者或版权持有人都不对任何索赔、损害或其他责任承担任何责任,无论是合同、侵权或其他方面的行为,因使用该软件或与该软件的使用或其他交易有关而导致的或与之相关的任何索赔、损害、其他责任或后果。
[1]
Rasa: https://github.com/RasaHQ/rasa
[2]
Langchain: https://github.com/hwchase17/langchain
[3]
@paulpierre: https://twitter.com/paulpierre
[4]
RasaGPT Youtube 视频
: https://youtu.be/GAPnQ0qf1-E
[5]
Rasa: https://rasa.com/
[6]
docker-compose.yml 的第64行: https://github.com/paulpierre/RasaGPT/blob/0463274ee3174580f2099501e0f8c58238987f9b/docker-compose.yml#L64
[7]
此处操作的 actions Dockerfile 的第1行: https://github.com/paulpierre/RasaGPT/blob/0463274ee3174580f2099501e0f8c58238987f9b/app/rasa/actions/Dockerfile#L1
[8]
FastAPI: https://fastapi.tiangolo.com/
[9]
FastAPI: https://fastapi.tiangolo.com/
[10]
SQLModel: https://sqlmodel.tiangolo.com/
[11]
Swagger: https://github.com/swagger-api/swagger-ui
[12]
Redoc: https://redocly.github.io/redoc/
[13]
PGAdmin: https://github.com/pgadmin-org/pgadmin4
[14]
Ngrok: ngrok.com/docs
[15]
pgvector: https://github.com/pgvector/pgvector
[16]
虚拟数据: https://github.com/paulpierre/RasaGPT/tree/main/app/api/data/training_data
[17]
Rasa: https://rasa.com/docs/rasa/
[18]
不支持 MacOS 架构: https://github.com/khalo-sa/rasa-apple-silicon
[19]
Docker Desktop for Mac OS: https://www.docker.com/products/docker-desktop/
[20]
API密钥: https://platform.openai.com/account/api-keys
[21]
bot 凭据: https://core.telegram.org/bots#how-do-i-create-a-bot
[22]
认证令牌: https://dashboard.ngrok.com/tunnels/authtokens
[23]
Mac OS: https://formulae.brew.sh/formula/make
[24]
Windows: https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows
[25]
RESULTS.MD: https://github.com/paulpierre/RasaGPT/blob/main/RESULTS.md
[26]
在RESULTS.MD中演示数据的问答结果: https://github.com/paulpierre/RasaGPT/blob/main/RESULTS.md
[27]
credentials.yml: https://github.com/paulpierre/RasaGPT/blob/main/app/rasa/credentials.yml
[28]
Ngrok: https://ngrok.com/
[29]
postgres Dockerfile: https://github.com/paulpierre/RasaGPT/blob/main/app/db/Dockerfile
[30]
create_db.sh
: https://github.com/paulpierre/RasaGPT/blob/main/app/db/create_db.sh
[31]
Makefile: https://github.com/paulpierre/RasaGPT/blob/main/Makefile
[32]
models.py: https://github.com/paulpierre/RasaGPT/blob/main/app/api/models.py
[33]
enable_vector
方法: https://github.com/paulpierre/RasaGPT/blob/dca9be4cd6fe4c9daaff1564267cdb5327a384a5/app/api/models.py#L266
[34]
如果索引不存在: https://github.com/paulpierre/RasaGPT/blob/dca9be4cd6fe4c9daaff1564267cdb5327a384a5/app/api/main.py#L49
[35]
GPTSimpleVectorIndex
: https://github.com/paulpierre/RasaGPT/blob/dca9be4cd6fe4c9daaff1564267cdb5327a384a5/app/api/main.py#L58
[36]
现有意图: https://github.com/paulpierre/RasaGPT/blob/main/app/rasa/data/nlu.yml
[37]
基于 rules.yml: https://github.com/paulpierre/RasaGPT/blob/main/app/rasa/data/rules.yml
[38]
ActionGPTFallback函数: https://github.com/paulpierre/RasaGPT/blob/main/app/rasa/actions/actions.py
[39]
FastAPI API服务器: https://github.com/paulpierre/RasaGPT/blob/main/app/api/main.py
[40]
查询路由抽象: https://medium.com/@jerryjliu98/unifying-llm-powered-qa-techniques-with-routing-abstractions-438e2499a0d0
[41]
Dual pattern model: https://simonwillison.net/2023/Apr/25/dual-llm-pattern/
[42]
HyDE pattern: https://wfhbrian.com/revolutionizing-search-how-hypothetical-document-embeddings-hyde-can-save-time-and-increase-productivity/
[43]
@paulpierre
: https://twitter.com/paulpierre
[44]
: https://star-history.com/#paulpierre/RasaGPT&Date