Metadata-Version: 2.1
Name: wwai_sdk
Version: 0.0.6
Summary: 万网AI云平台SDK
Home-page: 
Author: mrhua
Author-email: 
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: diskcache
Requires-Dist: redis
Requires-Dist: cryptography
Requires-Dist: pycryptodome

# WWAI云平台SDK

## 参数注入方式
| 参数名称          | 描述                                          |
|---------------|---------------------------------------------|
| server        | WWAI云平台地址，默认为 http://ai.api.wwai.wwxckj.com |
| grant_type    | 授权类型,支持password、client_credential，默认为 client_credential      |
| authorization | 客户端模式时的授权信息，路径：系统管理 > 终端管理 > 新建终端            |
| username      | 密码模式时的用户名                                  |
| password      | 密码模式时的密码                                   |
| tenant_code   | 密码模式时的租户号                                   |
| cache_type    | 缓存类型，支持 redis、local，默认为 local               |
| redis_host    | redis地址，默认为 localhost                        |
| redis_port    | redis端口，默认为 6379                           |
| redis_password | redis密码，默认为 None                           |
| redis_db      | redis数据库，默认为 0                           |


## 环境变量方式
| 环境变量名称 | 描述                                          |
| --- |---------------------------------------------|
| WWAI_SERVER | WWAI云平台地址，默认为 http://ai.api.wwai.wwxckj.com |
| WWAI_GRANT_TYPE | 授权类型，默认为 client_credential                  |
| WWAI_AUTHORIZATION | 客户端模式时的授权信息，路径：系统管理 > 终端管理 > 新建终端           |
| WWAI_USERNAME | 密码模式的用户名                                    |
| WWAI_PASSWORD | 密码模式的密码                                     |
| WWAI_TENANT_CODE | 密码模式时的租户号                                   |
| WWAI_CACHE_TYPE | 缓存类型，默认为 local，支持 redis、local               |
| REDIS_HOST | redis地址，默认为 localhost |
| REDIS_PORT | redis端口，默认为 6379 |
| REDIS_PASSWORD | redis密码，默认为 None |
| REDIS_DB | redis数据库，默认为 0 |

## 接口说明
| 接口名称 | 描述        |
| --- |-----------|
| ocr_idcard | 身份证识别     |
| ocr_vehicle | 行驶证识别     |
| ocr_vehicle_certificate | 机动车登记证书识别 |
| ocr_invoice | 发票识别      |
| ocr_bank_card | 银行卡识别     |
| other_classify | 通用图片分类    |
| asr_iat | 讯飞短语音识别   |
| aigc_models | AIGC模型列表  |
| huaweicloud_obs_get_ak_sk | 获取临时OBS的 AK/SK |


## demo 说明
```shell
pip install wwai-sdk
```

```python
import wwai_sdk
import asyncio

# grant_type="client_credential" 为客户端模式
# authorization 从WWAI云平台获取，路径：系统管理 > 终端管理 > 新建终端
client = wwai_sdk.create_client(
    grant_type="client_credential",
    authorization="Basic xxxxxxx"
)

# 身份证识别
res = asyncio.run(client.ocr_idcard("https://ai.bdstatic.com/file/96D2F45674F54D4287EB9FBF9E6AB19A", "front"))
print(res)
```
