{"id":17054548,"url":"https://github.com/lich0821/shadiaorobot","last_synced_at":"2025-10-07T11:06:13.859Z","repository":{"id":207936158,"uuid":"714631806","full_name":"lich0821/ShaDiaoRobot","owner":"lich0821","description":"WeChatFerry 群的沙雕机器人","archived":false,"fork":false,"pushed_at":"2023-11-19T14:10:01.000Z","size":10010,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-05T14:52:29.232Z","etag":null,"topics":["rasa","robot","wechat"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lich0821.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-05T12:56:38.000Z","updated_at":"2024-11-28T05:03:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba31039d-f2ac-4b32-a66f-4b5468e17578","html_url":"https://github.com/lich0821/ShaDiaoRobot","commit_stats":null,"previous_names":["lich0821/shadiaorobot"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lich0821/ShaDiaoRobot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FShaDiaoRobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FShaDiaoRobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FShaDiaoRobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FShaDiaoRobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lich0821","download_url":"https://codeload.github.com/lich0821/ShaDiaoRobot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lich0821%2FShaDiaoRobot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278762930,"owners_count":26041447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rasa","robot","wechat"],"created_at":"2024-10-14T10:15:03.977Z","updated_at":"2025-10-07T11:06:13.823Z","avatar_url":"https://github.com/lich0821.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 群主的沙雕机器人\n基于 [Rasa](https://github.com/rasaHQ/rasa) 的一个机器人示例。\n\n## 环境搭建\n### 安装 Python\n官方说支持 `3.7`，`3.8`，`3.9` 和 `3.10`，但 `3.7` 太旧了；`3.10` 又要求蛮多；建议 `3.8` 或者 `3.9`。\n\n### 创建虚拟环境\n```sh\npython -m venv .env\n\n# 激活虚拟环境\nsource .env/bin/activate\n```\n\n### 安装 RASA 开源版\n```sh\n# 更新 pip\npip install -U pip\n\n# 安装 RASA\npip install rasa\n```\n\n## 快速开始\n### 克隆项目\n```sh\ngit clone\n```\n\n### 安装依赖\n```sh\npip install -r requirements.txt\n```\n\n### 训练模型\n```sh\nrasa train\n# 训练时遇到网络报错的话，需要科学一下\n```\n\n### 运行 Action 服务\n#### 闲聊\n闲聊模型需要先训练。\n```sh\n# 切换到 actions 目录\ncd actions/\npython chitchat_helper.py -m train\n```\n\n如果没有 GPU，训练可能比较费劲，可以从 [release](https://github.com/lich0821/ShaDiaoRobot/releases/latest) 处下载训练好的模型（虽然也训练得不怎么样），解压到 `actions/chitchat/model_data`：\n```\nactions/chitchat/model_data\n├── checkpoint\n├── ckpt-10.data-00000-of-00001\n└── ckpt-10.index\n```\n\n\nTensorflow 的兼容性不行，注意版本：\n\u003e tensorflow                   2.12.0\n\u003e tensorflow-estimator         2.12.0\n\u003e tensorflow-hub               0.13.0\n\u003e tensorflow-io-gcs-filesystem 0.32.0\n\u003e tensorflow-text              2.12.0\n\n#### 天气\n去[知心天气](https://www.seniverse.com/)注册一个账号，可以免费使用天气接口。\n\n```sh\n# 设置 KEY\nexport WEATHER_KEY=your_key\n\nrasa run actions\n```\n\n### 启动 RASA API\n```sh\nrasa run --enable-api\n```\n\n### 验证\n* cURL\n```sh\ncurl --location 'http://localhost:5005/webhooks/rest/webhook' \\\n--data '{\n    \"sender\": \"user1\",\n    \"message\": \"明天北京天气怎么样？\"\n}'\n```\n\n* Python\n```py\nimport requests\n\nurl = \"http://localhost:5005/webhooks/rest/webhook\"\n\npayload = \"{\\n    \\\"sender\\\": \\\"user1\\\",\\n    \\\"message\\\": \\\"明天北京天气怎么样？\\\"\\n}\"\nheaders = {}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n```\n\n## 从零创建项目\n忽略一个 `SQLAlchemy` 告警：\n```sh\nexport SQLALCHEMY_SILENCE_UBER_WARNING=1\n```\n\n### 初始化项目\n```sh\nrasa init\n```\n\n```txt\nWelcome to Rasa! 🤖\n\nTo get started quickly, an initial project will be created.\nIf you need some help, check out the documentation at https://rasa.com/docs/rasa.\nNow let's start! 👇🏽\n\n? Please enter a path where the project will be created [default: current directory]\n? Directory 'RasaDemo' is not empty. Continue? Yes\n……\nCreated project directory at 'RasaDemo'.\nFinished creating project structure.\n? ? Do you want to train an initial model? 💪🏽 No\nNo problem 👍🏼. You can also train a model later by going to the project directory and running 'rasa train'.\n```\n\n这样就有一个示例项目；也可以选择训练跑跑。然后基示例项目改。\n\nOnce you've done the following, you can train your bot and try it out!\n\n* Add RulePolicy to your policies and ResponseSelector to your pipeline in config.yml\n* Add at least one rule for responding to FAQs/chitchat\n* Add examples for your FAQs/chitchat intents\n* Add responses for your FAQs/chitchat intents\n* Update the intents in your domain\n\n## 调试\n```sh\nrasa shell --debug\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flich0821%2Fshadiaorobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flich0821%2Fshadiaorobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flich0821%2Fshadiaorobot/lists"}