Giter VIP home page Giter VIP logo

chatopera / chatopera.feishu Goto Github PK

View Code? Open in Web Editor NEW
44.0 4.0 10.0 1.53 MB

通过 Feishu 开放平台和 Chatopera 机器人平台上线智能对话机器人服务, 聊天机器人,飞书,lark

Home Page: https://open.feishu.cn/

License: Other

Shell 16.17% Python 30.40% JavaScript 50.07% MAXScript 2.65% Dockerfile 0.71%
feishu chatbot bot chatopera dialog machine-learning ai nlp nlu python3

chatopera.feishu's Introduction

使用 Chatopera 和飞书集成 BOT 应用有两种形式:

Chatopera 飞书应用

开始使用:https://chatopera.feishu.cn/docs/doccnnLcv5AuenV1HHSvgVWbJmd

image_20230213151245

Chatopera 飞书 Custom App

https://github.com/chatopera/chatopera.feishu

通过 Feishu 开放平台和 Chatopera 机器人平台上线企业聊天机器人服务。

  • Feishu:高效率的协作办公软件
  • Chatopera 机器人平台:定制智能对话机器人的开发者平台,低代码或无代码方式开发 BOT 对话

掌握 BOT 应用开发

Feishu 开发者快速入门 Custom App BOT 服务开发!

Feishu(飞书) 聊天机器人应用(1/3)- 开发快速入门

Feishu(飞书) 聊天机器人应用(2/3)- 定制对话,实现知识库、信息查询、意图识别、多轮对话

Feishu(飞书) 聊天机器人应用(3/3)- DevOps机器人助手,管理 GitLab Issues,BOT 开源示例程序

示例程序

集成 GitLab 实现项目的 Issue 管理。

功能 -

帮助
list projects
create issue 项目 标题
close issue 项目 #序号
reopen issue 项目 #序号
示例:
   list projects
   create issue cskefu 优化春松客服 ME 渠道管理创建表单
   close issue cskefu #1120
   reopen issue cskefu #1120
详细介绍(超链接)

该示例程序的上线过程,请详细阅读下文获得。

快速开始

以下【Feishu Bot 应用】是指飞书开发者平台上的 Custom App,并且 Capability 为 【bot】。

创建 Feishu Bot 应用

根据文档创建 Feishu Custom App https://open.feishu.cn/document/uQjL04CN/ukzM04SOzQjL5MDN

在左侧导航栏,进入【Credentials & Basic Info】,得到 App IDApp Secret

开启 Bot 功能:在 Features 中设置 【Using Bot】为开启状态。

进入【Event Subscriptions】,获得 Verification Token

创建 Chatopera Bot 应用

登录 Chatopera 云服务 https://bot.chatopera.com,创建【机器人】。

进入机器人设置页面,得到 Client IdSecret

以上提到了两个“Bot 应用”,实际上是一个对话机器人应用的两个部分:"Feishu Bot 应用" 是渠道,"Chatopera Bot 应用"是自然语言对话管理;前者是“嘴”,后者是“脑”。

编辑配置文件

我们以 Python 语言为例,进入 Python 程序源文件目录app

复制配置文件示例。

cd feishu/app
cp sample.env .env
vi .env # 使用文本编辑器编辑 .env 文件

参数对应列表

KEY VALUE DESCRIPTION
APP_ID App ID Feishu Custom App Credentials & Basic Info 页
APP_SECRET App Secret Feishu Custom App Credentials & Basic Info 页
APP_VERIFICATION_TOKEN Verification Token Feishu Custom App Event Subscriptions 页
CHATOPERA_CLIENT_ID Client Id Chatopera 聊天机器人设置页
CHATOPERA_SECRET Secret Chatopera 聊天机器人设置页

安装依赖

  • 前提条件 Python3, pip

安装 Python 依赖

cd feishu/app
pip install -r requirements.txt

启动服务

cd feishu/app
./serve.sh

服务默认使用 8000 端口,可以在 .env 中增加环境变量 PORT=YOUR_PORT 自定义。

配置 HTTPs 服务,接入飞书要求使用 https server URL,测试目的建议使用 ngrok

ngrok http 8000

如上,得到 https URL 地址:https://xxx.ngrok.io

ngrok 下载和注册:https://dashboard.ngrok.com/。

配置 Feishu Custom App 消息事件订阅

再次进入 Feishu Custom App Event Subscriptions 页面,编辑 Request URL 的值。

将刚刚获得的 https URL 地址填写上,保存。

发布上线机器人

1)设置权限 进入飞书 Custom App 管理控制台,打开【Permissions】页面,发布新版本,并且选择权限如下。

2)发布到企业内部使用

进入飞书 Custom App 管理控制台,打开【Version Management & Release】页面。

创建新版本,并提交,此时因为企业内部审核,会自动通过。

在飞书客户端,Workspace 中搜索并激活机器人。

进入对话界面。

使用 Docker 方式运行程序

构建 Docker 镜像

cd 根目录/feishu
./admin/build.sh

运行服务

cd 根目录
cp sample.env .env # 修改 .env 文件,配置变量
docker-compose up -d

开发

修改程序,增加功能

建议安装 Node.js 和 npm,然后可使用下面脚本自动重启。

cd feishu/app
# liveload script, auto restart app when modifications happens
./dev.sh

每次重启后,可能会延迟 20s 生效,因为每次重启会和 Feishu 中间重新做安全校验。

增加对话能力

接下来,根据文档定制您的 BOT 对话能力,管理对话,是 Chatopera 机器人平台最核心的功能。

本项目提供面向 DevOps 的助手机器人,和 GitLab 集成,参考 README.md

Powered by Chatopera 机器人平台

获得帮助与支持

Chatopera 文档中心

Create Tickets

References

Create a custom app on Feish

Develop a bot app on Feishu

Chatopera 云服务入门

Chatopera 云服务 Deep Dive

聊天机器人对话模板:招聘机器人、天气查询、活动通知、寒暄等

开源许可协议

Copyright 2021 北京华夏春松科技有限公司

Apache License Version 2.0

chatoper banner

chatopera.feishu's People

Contributors

hailiang-wang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.