Git Product home page Git Product logo

wechatbot's Introduction

WeChatBot

WeChatBot是一款基于ItChat-UOS的微信聊天机器人,可以将你的微信小号快速接入OpenAI。

  • 支持OpenAI的多个Api-Key轮询使用
  • 支持OpenAI的Function call
  • 支持OpenAI的Whisper语音识别
  • 支持OpenAI的DALL-E-3画图

注意!!!

  • 使用该项目微信账号有被封禁的风险,请使用小号登陆。
  • 建议不要给太多人高频率使用,可能会导致账号被封禁。

部署

Docker

docker run -d --name wechatbot \
-e TZ=Asia/Shanghai \
-e OPENAI_API_URL=https://your.proxy.domain.com/v1 \
-e OPENAI_API_KEYS=sk-xxxxxxxxxxxxxxxxxxxxxxxx,sk-xxxxxxxxxxxxxxxxxxxxxxxx \
devcxl/wechatbot:latest

docker-compose

version: '3.9'
services:
    wechatbot:
        image: devcxl/wechatbot:latest
        container_name: wechatbot
        environment:
            - TZ=Asia/Shanghai
            - OPENAI_API_URL=https://your.proxy.domain.com/v1
            - OPENAI_API_KEYS=sk-xxxxxxxxxxxxxxxxxxxxxxxx,sk-xxxxxxxxxxxxxxxxxxxxxxxx
        volumes:
            - ${PWD}/data/:/data
        restart: unless-stopped

登陆微信

查看wechatbot的日志

docker logs wechatbot --tail 200 -f

扫码登陆即可。

注意!!!

  • 无法登陆的情况建议给小号绑上银行卡再试。

环境变量

环境变量 必需 默认值 作用
OPENAI_API_URL No https://api.openai.com/v1 设置OpenAI的接口
OPENAI_API_KEYS Yes None 设置OpenAI的多个APIKey,使用,分割
MODEL No gpt-3.5-turbo 设置对话使用的模型(建议使用带Function Call功能的模型)
DEFAULT_PROMPT No You are a helpful assistant. 设置默认提示词
HISTORY No 15 设置历史消息数
DATA_DIR No /data 设置数据文件夹位置
OPENAI_PROXY Yes None 设置请求OpenAI的HTTP/HTTPS代理,(eg: http://127.0.0.1:8889)
使用该代理下载DALL-E-3生成的图片
OPENAI_DALL-E3_CACHE No True 设置缓存DALL-E-3画图的结果,pormpt不变,生成的图不变
PLUGIN_WEATHER_KEY No None 高德地图的APIKey
PLUGIN_EMAIL_SMTP_SERVER No None smtp服务器地址
PLUGIN_EMAIL_SMTP_PORT No None smtp服务器端口
PLUGIN_EMAIL_ADDRESS No None 邮箱发信地址
PLUGIN_EMAIL_PASSWORD No None 邮箱smtp密码

聊天指令

指令 功能 私聊 群聊 示例
/clear 清理与GPT的聊天上下文 Yes No /clear
/prompt 设置当前聊天的提示词 Yes No /prompt 请你充当一个专业的心理医生,请根据以下症状判断我的病症
/imagine 使用DALL-E-3画图 Yes No /imagine 一只沙漠中的骆驼狂奔到了亚马逊雨林。真实风格,哈苏镜头

FunctionCall插件

名称 需要配置的环境变量 功能 使用示例
get_current_weather PLUGIN_WEATHER_KEY 获取给定位置未来几天内的天气 明天上海天气怎么样,适合穿什么衣服
get_current_time None 获取当前时间 现在距离明天晚上八点还有多长时间
send_email PLUGIN_EMAIL_SMTP_SERVER,
PLUGIN_EMAIL_SMTP_PORT,
PLUGIN_EMAIL_ADDRESS,
PLUGIN_EMAIL_PASSWORD
向指定的邮箱发送邮件 [email protected]发封正式的商务邮件说我病了,明天的会议安排到下周一。
web_search None 获取网页搜索的前10条 帮我搜一下祖师爷赏饭是什么梗

贡献FunctionCall插件

fork本项目,仿照在function包下weather_function.py创建自己想实现的功能开发即可

然后在function包下的__init__.py中仿照WeatherFunction进行注册

更新README.md中你开发的FunctionCall插件所需要的环境变量等信息

最后向本项目提交PR即可

相关项目

免责声明

  • 本工具仅供学习和技术研究使用,不得用于任何商业或非法行为,否则后果自负。
  • 本工具的作者不对本工具的安全性、完整性、可靠性、有效性、正确性或适用性做任何明示或暗示的保证,也不对本工具的使用或滥用造成的任何直接或间接的损失、责任、索赔、要求或诉讼承担任何责任。
  • 本工具的作者保留随时修改、更新、删除或终止本工具的权利,无需事先通知或承担任何义务。
  • 本工具的使用者应遵守相关法律法规,尊重微信的版权和隐私,不得侵犯微信或其他第三方的合法权益,不得从事任何违法或不道德的行为。
  • 本工具的使用者在下载、安装、运行或使用本工具时,即表示已阅读并同意本免责声明。如有异议,请立即停止使用本工具,并删除所有相关文件。

wechatbot's People

Contributors

devcxl 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.