Skip to content

Commit

Permalink
✨ feat:更新requirements.txt文件
Browse files Browse the repository at this point in the history
更新requirements.txt文件以满足项目依赖的最新版本要求。
  • Loading branch information
s045pd committed Jul 3, 2024
1 parent 7305958 commit 5631e6a
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 27 deletions.
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/.venv/bin/python",
"args": [
"-m",
"webot"
],
"justMyCode": true
}
]
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
<p align="center">这是一个基于web微信协议的简易微信机器人,目前功能比较简陋且不堪🙈。</p>
<p align="center">
<a href="https://www.codacy.com/manual/aoii103/Webot?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=aoii103/Webot&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/cb6b7e771f5b4cf8a2f7d65aa42a32bf"/></a>
<a target="_blank" href="https://www.python.org/downloads/" title="Python version"><img src="https://img.shields.io/badge/python-%3E=_3.7.4-green.svg"></a>
<a target="_blank" href="https://www.python.org/downloads/" title="Python version"><img src="https://img.shields.io/badge/python-%3E=_3.10-green.svg"></a>
<a target="_blank" href="LICENSE" title="License: MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a>
<a target="_blank" href="Wechat" title="Wechat"><img src="https://img.shields.io/badge/power_by-Wechat-Green.svg"></a></p>
</p>

## 现有功能

- AI机器人(ollama)
- 简单文字消息回复
- 消息过滤
- 实时信息展示(带斗图表情(Iterm2))
Expand Down Expand Up @@ -58,7 +59,7 @@

## 环境安装

首先保证您已经安装了```python3.7.4```及以上版本,然后依次运行如下命令。
首先保证您已经安装了```python3.10```及以上版本,然后依次运行如下命令。

```sh
git clone https://github.com/aoii103/Webot.git
Expand Down
26 changes: 26 additions & 0 deletions examples/ai_chat_with_self.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys
sys.path.append('..')

from webot.core import Webot
from webot.util import Device
import ollama

ollama.pull('llama3')

class bot(Webot):
@Device.filters(["text"], is_me=True)
def send_back(self, msg):
response = ollama.chat(
model="llama3",
messages=[
{
"role": "user",
"content": msg["content"],
},
],
)
self.send_text(msg["from"], response["message"]["content"])



bot().run(hot_reload=True)
73 changes: 62 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,65 @@
requests==2.24.0
termcolor==1.1.0
pandas==1.1.4
filetype==1.0.7
requests_html==0.10.0
PyExecJS==1.5.1
anyio==4.4.0
appdirs==1.4.4
beautifulsoup4==4.12.3
black==24.4.2
bs4==0.0.2
certifi==2024.6.2
charset-normalizer==3.3.2
click==8.1.7
cssselect==1.2.0
decorator==5.1.1
et-xmlfile==1.1.0
exceptiongroup==1.2.1
fake-useragent==1.5.1
filelock==3.15.4
filetype==1.2.0
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
imgcat==0.5.0
openpyxl==3.0.7
Pillow==8.2.0
importlib_metadata==8.0.0
Jinja2==3.1.4
lxml==5.2.2
lxml_html_clean==0.1.1
MarkupSafe==2.1.5
mypy-extensions==1.0.0
numpy==2.0.0
ollama==0.2.1
openpyxl==3.1.5
packaging==24.1
pandas==2.2.2
parse==1.20.2
pathspec==0.12.1
pillow==10.4.0
platformdirs==4.2.2
prettytable==3.10.0
progressbar33==2.4
pyecharts==1.9.0
pygame==2.0.1
py==1.11.0
pyecharts==2.0.6
pyee==11.1.0
PyExecJS==1.5.1
pygame==2.6.0
pyppeteer==2.0.0
pyquery==2.0.0
python-dateutil==2.9.0.post0
pytz==2024.1
requests==2.32.3
requests-html==0.10.0
retry==0.9.2
urlextract==1.3.0
simplejson==3.19.2
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
termcolor==2.4.0
tomli==2.0.1
tqdm==4.66.4
typing_extensions==4.12.2
tzdata==2024.1
uritools==4.0.3
urlextract==1.9.0
urllib3==1.26.19
w3lib==2.2.1
wcwidth==0.2.13
websockets==10.4
zipp==3.19.2
14 changes: 0 additions & 14 deletions test.py

This file was deleted.

3 changes: 3 additions & 0 deletions webot/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ def get_ticket(self):
self.__get_ticket_url,
params={"fun": "new", "lang": "zh_CN", "_": Device.get_timestamp()},
)
resp.encoding = 'GB2312'
if '暂不支持使用网页版微信' in resp.text :
exit('您的账号不支持网页版微信')
info(
f"Get Ticket:{requests_html.requests.utils.dict_from_cookiejar(resp.cookies)}"
)
Expand Down

0 comments on commit 5631e6a

Please sign in to comment.