Code Monkey home page Code Monkey logo

feishu-chatgpt's Introduction


在飞书上与ChatGPT随时对话

Feishu ChatGpt

👻 机器人功能

  • 支持私人对话
  • 支持群聊@机器人回复
  • 持续对话联系上下文
  • 超时自动结束对话
  • 用户主动开启新对话
  • 对接prompts,允许自定义交流场景
  • markdown格式回复,重点支持代码场景

🌟 项目特点

项目部署

有关飞书具体的配置文件说明,➡︎ 点击查看
git clone [email protected]:Leizhenpeng/feishu-chatGpt.git
cd feishu-chatGpt/code

# 配置config.yaml
mv config.example.yaml config.yaml
本地部署

如果你的服务器没有公网 IP,可以使用反向代理的方式

飞书的服务器在国内对ngrok的访问速度很慢,所以推荐使用一些国内的反向代理服务商

//测试部署
go run main.go
cpolar http 9000

//正式部署
nohup cpolar http 9000 -log=stdout &

//查看服务器状态
https://dashboard.cpolar.com/status

// 下线服务
ps -ef | grep cpolar
kill -9 PID

更多详细介绍,参考飞书上的小计算器: Go机器人来啦


serverless云函数(阿里云等)部署

安装severless工具

npm install @serverless-devs/s -g

一键部署

cd ..
s deploy

更多详细介绍,参考仅需1min,用Serverless部署基于 gin 的飞书机器人

docker部署
# 配置config.yaml
mv config.example.yaml config.yaml
# 构建运行
cd ..
docker build -t feishu-chatgpt:latest .
docker run -d --name feishu-chatgpt -p 9000:9000 feishu-chatgpt:latest

详细配置步骤

  • 获取 OpenAI 的 KEY
  • 创建 飞书 机器人
    1. 前往开发者平台创建应用,并获取到 APPID 和 Secret
    2. 前往应用功能-机器人, 创建机器人
    3. 从cpolar或者serverless获得公网地址,在飞书机器人后台的 事件订阅 板块填写。例如,
      • http://xxxx.r6.cpolar.top为cpolar暴露的公网地址
      • /webhook/event为统一的应用路由
      • 最终的回调地址为 http://xxxx.r6.cpolar.top/webhook/event
    4. 给订阅添加下列回调事件
      • im:message
      • im:message.group_at_msg(获取群组中所有消息)
      • im:message.group_at_msg:readonly(接收群聊中@机器人消息事件)
      • im:message.p2p_msg(获取用户发给机器人的单聊消息)
      • im:message.p2p_msg:readonly(读取用户发给机器人的单聊消息)
      • im:message:send_as_bot(获取用户在群组中@机器人的消息)
      • im:chat:readonly(获取群组信息)
      • im:chat(获取与更新群组信息)
  1. 发布版本,等待企业管理员审核通过

更多介绍,参考飞书上的小计算器: Go机器人来啦

相关阅读

更多交流

可以加入飞书群~

feishu-chatgpt's People

Contributors

leizhenpeng avatar dishone avatar hyoban avatar

Watchers

James Cloos 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.