ask-robot-0.0.4
توضیحات
the robot for chat system
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | ask-robot-0.0.4 |
| نام | ask-robot |
| نسخه کتابخانه | 0.0.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | idlewith |
| ایمیل نویسنده | newellzhou@163.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/ask-robot/ |
| مجوز | MIT |
# Ask robot
**for WeChat platform, offer api to do an ask robot.**
# install python from source
```shell
wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tar.xz
tar -xzvf Python-3.9.7.tar.xz
cd Python-3.9.7
./configure --prefix=/opt/idlepig/apps/python397
make
make altinstall
cd ~/code/venv
/opt/idlepig/apps/python397/bin/python3.9 -m venv wx
source ~/code/venv/wx/bin/activate
cd ~/code/wx
pip install -r requirements.txt
```
# or install python directly
in centos
```shell
yum install python36u
```
# env
create virtual environment and source
```shell
mkdir -p ~/code/venv
cd ~/code/venv
python3 -m venv wx
source ~/code/venv/wx/bin/activate
```
# install ask_robot
```
pip install ask_robot
```
# start flask service
you need set actual info for token, aes_key, appid
if you are in plaintext mode, just set token is ok.
```shell
export token=''
export app_id=''
export aes_key=''
export secret=''
export email_from=''
export email_password=''
export email_to=''
export chatgpt=''
```
```
nohup ask &
```
then http://0.0.0.0:8081 will work
# install nginx
```shell
yum install nginx
```
vi /etc/nginx/nginx.conf
```shell
http {
...
upstream idlewith {
server 127.0.0.1:8081;
}
...
}
```
vi /etc/nginx/conf.d/default.conf
```shell
server {
listen 80;
server_name _;
location / {
proxy_pass http://idlewith;
}
}
```
so, we map 80 port to 8081 port
start nginx
```shell
nginx
```
نیازمندی
| مقدار | نام |
|---|---|
| >=2.2.3,<3.0.0 | Flask |
| >=1.8.18,<2.0.0 | wechatpy |
| >=2.28.2,<3.0.0 | requests |
| >=0.0.1,<0.0.2 | bs4 |
| >=39.0.2,<40.0.0 | cryptography |
| >=0.27.2,<0.28.0 | openai |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7.1,<4.0.0 | Python |
نحوه نصب
نصب پکیج whl ask-robot-0.0.4:
pip install ask-robot-0.0.4.whl
نصب پکیج tar.gz ask-robot-0.0.4:
pip install ask-robot-0.0.4.tar.gz