Code Monkey home page Code Monkey logo

chatgpt-bot-dingding's Introduction

介绍

集成chatgpt与钉钉机器人, 效果图如下

image-20230209094645629

快速开始

需要准备的:

  1. 申请一个OpenAi API key, 从openai platform 生成

  2. 获取钉钉机器人token

    • 登录钉钉开放平台, 选择企业内部开发, 机器人

      xx

    • 当机器人创建成功后, 钉钉会自动生成一个调试群

      image-20230209101837743

    • 进入群里, 点击智能群助手, 下方会有一个ddd123的机器人, 点击, 获取webhook链接, 从链接里获取token

      https://oapi.dingtalk.com/robot/send?access_token=xxxx
      

部署服务

程序启动

  1. 安装依赖
pip3 install -r requirements.txt
  1. 启动程序, 将${openai_xx} 替换openai api key, ${dd_xx} 替换钉钉的token
API_KEY=${openai_xx} DD_TOKEN=${dd_xx} python3 main.py
  1. 服务监听的端口是8080

Docker启动

${openai_xx} 替换openai api key, ${dd_xx} 替换钉钉的token

docker run -p 8080:8080 -e API_KEY=${openai_xx} -e DD_TOKEN=${dd_xx} -d registry.cn-hangzhou.aliyuncs.com/public_mgg/chatgpt:latest

回到钉钉开放平台, 配置机器人

点击开发管理, 配置服务的地址, 将图下面的ip修改为实际部署机器的ip

step4

测试

在群内@机器人

chatgpt-bot-dingding's People

Contributors

mggger avatar cccraim 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.