Skip to main content

# qqai

提供[腾讯AI](https://ai.qq.com/)简单易用的python接口。

## 安装

```bash
pip install qqai
```

## 用法

当前包含以下接口:

- [聊天机器人](#聊天机器人)
- [图片转文字](#图片转文字)
- [人脸检测](#人脸检测)

### 聊天机器人

```py
from qqai import TextChat

siri = TextChat(your_app_id, your_app_key)

# 单句对话
answer = siri.ask('你是谁')
print(answer)
# >>> 我是你的小助手啊

# 连续聊天
siri.chat()
# < 有啥想跟我说的?
# > 你是谁啊?
# < 我是你的小助手啊
# > 你能干嘛呀
# < 呵呵,我能干的事情多的数不清。
```

### 图片转文字

```py
from qqai import ImgToText

robot = ImgToText(your_app_id, your_app_key)

# 识别图片URL
result = robot.run('https://yyb.gtimg.com/aiplat/ai/assets/ai-demo/express-6.jpg')
print(result)
# {'ret': 0, 'msg': 'ok', 'data': {'text': '一位男士在海边骑自行车的照片'}}

# 识别打开的本地图片
with open('/my/img.jpeg', 'rb') as image_file:
result = robot.run(image_file)
print(result)
# {'ret': 0, 'msg': 'ok', 'data': {'text': '一艘飞船'}}
```

### 人脸检测

```py
from qqai import Detectface

robot = Detectface(your_app_id, your_app_key)

# 调用方法与图片转文字相同
```



Metadata

Release files for qqai 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qqai 0.1.3
File Size Uploaded Provenance Actions
qqai-0.1.3.tar.gz 4.3 kB Without provenance Details for qqai-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qqai 0.1.3
File Interpreter ABI Platform Actions
qqai-0.1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details for qqai-0.1.3-py2.py3-none-any.whl

Total release size: 7.8 kB

Release files / qqai-0.1.3.tar.gz

Download URL qqai-0.1.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c3c8696fd0b39a35b24fcb29c7c18a3ab0a3ef9a16606d10ada00f1a81d641c3
BLAKE2b-256 checksum
How to use checksums
1cc6b8ab6c95e816a300fa3a8e6559f2fa52eb2f12758337de703ee7dd3348d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.5

Release files / qqai-0.1.3-py2.py3-none-any.whl

Download URL qqai-0.1.3-py2.py3-none-any.whl
Size 3.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d3c71e0d80e12c9080fccc07d3e4b978ca9ba1ede4ae12636d3d036f461d3522
BLAKE2b-256 checksum
How to use checksums
dd3b2cec213f01934268adcc4258f782b5b96e4e1e00e1440dd6097d4fe7f19e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.5

Security for qqai 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page