Download bridge/reply.py from hhz520/webchat: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/spaces/hhz520/webchat/resolve/main/bridge/reply.py
- Command line
-
hf download hf://spaces/hhz520/webchat/bridge/reply.py
-
curl -L -o reply.py https://huggingface.co/spaces/hhz520/webchat/resolve/main/bridge/reply.py
707 Bytes
| # encoding:utf-8 | |
| from enum import Enum | |
| class ReplyType(Enum): | |
| TEXT = 1 # 文本 | |
| VOICE = 2 # 音频文件 | |
| IMAGE = 3 # 图片文件 | |
| IMAGE_URL = 4 # 图片URL | |
| VIDEO_URL = 5 # 视频URL | |
| FILE = 6 # 文件 | |
| CARD = 7 # 微信名片,仅支持ntchat | |
| InviteRoom = 8 # 邀请好友进群 | |
| INFO = 9 | |
| ERROR = 10 | |
| TEXT_ = 11 # 强制文本 | |
| VIDEO = 12 | |
| MINIAPP = 13 # 小程序 | |
| def __str__(self): | |
| return self.name | |
| class Reply: | |
| def __init__(self, type: ReplyType = None, content=None): | |
| self.type = type | |
| self.content = content | |
| def __str__(self): | |
| return "Reply(type={}, content={})".format(self.type, self.content) | |