# WenXinAPI
[![PyPi](https://img.shields.io/pypi/v/revWenXin.svg)](https://pypi.python.org/pypi/revWenXin)
对百度文心一言API的简单封装,支持多用户上下文对话
[github地址](https://github.com/umbrella-leaf/WenXinAPI)
## 安装
```
python -m pip install --upgrade WenXinAPI
```
## 支持Python版本
- 最小版本 - Python3.6
- 推荐 - Python3.8+
## 使用方法
### 配置方法
1. 在百度智能云的 [文心千帆平台](https://console.bce.baidu.com/ai/#/ai/wenxinworkshop/overview/index) 上申请使用资格
2. 在控制台 [应用列表页面](https://console.bce.baidu.com/ai/#/ai/wenxinworkshop/app/list) 创建应用
3. 获取并保存API_KEY和SECRET_KEY
### 使用示例(异步流式)
```python
from WenXinAPI.V1 import ChatBot
chatbot = ChatBot(
api_key="<your API_KEY>",
secret_key="<your SECRET_KEY>",
engine="<ENGINE you choose>"
)
print(await chatbot.ask("你好!"))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/umbrella-leaf/WenXinAPI",
"name": "revWenXin",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Zhongnuo Liu",
"author_email": "2313678365@qq.com",
"download_url": "https://files.pythonhosted.org/packages/e7/4b/90d3b3ba7daed266d4a9ee3dc816a67cd410926979dad6c7839bd6504b9a/revWenXin-1.0.4.tar.gz",
"platform": null,
"description": "# WenXinAPI\r\n\r\n[![PyPi](https://img.shields.io/pypi/v/revWenXin.svg)](https://pypi.python.org/pypi/revWenXin)\r\n\r\n\u5bf9\u767e\u5ea6\u6587\u5fc3\u4e00\u8a00API\u7684\u7b80\u5355\u5c01\u88c5\uff0c\u652f\u6301\u591a\u7528\u6237\u4e0a\u4e0b\u6587\u5bf9\u8bdd\r\n[github\u5730\u5740](https://github.com/umbrella-leaf/WenXinAPI)\r\n\r\n## \u5b89\u88c5\r\n\r\n```\r\npython -m pip install --upgrade WenXinAPI\r\n```\r\n\r\n## \u652f\u6301Python\u7248\u672c\r\n\r\n- \u6700\u5c0f\u7248\u672c - Python3.6\r\n- \u63a8\u8350 - Python3.8+\r\n\r\n## \u4f7f\u7528\u65b9\u6cd5\r\n\r\n### \u914d\u7f6e\u65b9\u6cd5\r\n\r\n1. \u5728\u767e\u5ea6\u667a\u80fd\u4e91\u7684 [\u6587\u5fc3\u5343\u5e06\u5e73\u53f0](https://console.bce.baidu.com/ai/#/ai/wenxinworkshop/overview/index) \u4e0a\u7533\u8bf7\u4f7f\u7528\u8d44\u683c\r\n2. \u5728\u63a7\u5236\u53f0 [\u5e94\u7528\u5217\u8868\u9875\u9762](https://console.bce.baidu.com/ai/#/ai/wenxinworkshop/app/list) \u521b\u5efa\u5e94\u7528\r\n3. \u83b7\u53d6\u5e76\u4fdd\u5b58API_KEY\u548cSECRET_KEY\r\n\r\n### \u4f7f\u7528\u793a\u4f8b\uff08\u5f02\u6b65\u6d41\u5f0f)\r\n\r\n```python\r\nfrom WenXinAPI.V1 import ChatBot\r\nchatbot = ChatBot(\r\n api_key=\"<your API_KEY>\",\r\n secret_key=\"<your SECRET_KEY>\",\r\n engine=\"<ENGINE you choose>\"\r\n)\r\nprint(await chatbot.ask(\"\u4f60\u597d\uff01\"))\r\n```\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "Apache-2.0 license",
"summary": "WenXinAPI is a simple wrapper for the official WenXin API",
"version": "1.0.4",
"project_urls": {
"Homepage": "https://github.com/umbrella-leaf/WenXinAPI"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e74b90d3b3ba7daed266d4a9ee3dc816a67cd410926979dad6c7839bd6504b9a",
"md5": "1596f2e64313a2317cb860b43a7876ee",
"sha256": "d1a591c9e62345453960279909b12285e3614e6354d63f382f496c72afd6c9d7"
},
"downloads": -1,
"filename": "revWenXin-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "1596f2e64313a2317cb860b43a7876ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12122,
"upload_time": "2024-07-28T02:52:05",
"upload_time_iso_8601": "2024-07-28T02:52:05.625849Z",
"url": "https://files.pythonhosted.org/packages/e7/4b/90d3b3ba7daed266d4a9ee3dc816a67cd410926979dad6c7839bd6504b9a/revWenXin-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-28 02:52:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "umbrella-leaf",
"github_project": "WenXinAPI",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "revwenxin"
}