taotao7 / wechat_ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wechat ai robot

This is a sample AI bot integrated with Ali Tongyi for WeChat. To use this bot, you need to have a Node environment greater than version 16.

Here are the steps to use the bot:

how to use

Step 1: Generate a Tongyi API key by following the instructions provided in the link: genrate tongyi api key

Step 2: Open the index.js file and update the environment variables:

DASHSCOPE_API_KEY = ""; // your Tongyi API key
WECHAT_NAME = "@taotao7"; // your WeChat name (not ID account), "taotao7" is my WeChat name

Step 3: Run the following commands in your terminal:

npm install
npm run start

After following these steps, you will be able to use the WeChat AI bot with Ali Tongyi.

deploy

If you want to deploy it on a server, you can use pm2 for deployment.

Step 1:

install dependency with server

yum install gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget atk at-spi2-atk libXcomposite gtk3

apt install gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Step 2:

open ecosystem.config.js

env: {
  NODE_ENV: "production",
  DASHSCOPE_API_KEY: "", // your Tongyi API key
  WECHAT_NAME: "@", // your WeChat name (not ID account), "taotao7" is my WeChat name
},

Step 3:

start

npm i pm2 -g

pm2 start ecosystem.config.cjs

pm2 log  # wait qrcode

show qrcode to scan

other

change model

@bot change model: "qwen-turbo", "qwen-plus", "qwen-max", "qwen-max-1201", "qwen-max-longcontext"

@taotao7 change model: qwen-max-longcontext

About


Languages

Language:JavaScript 100.0%