Name | tencent JSON |
Version |
1.0.5
JSON |
| download |
home_page | None |
Summary | Contributed API Collections of Tencent Product and Services, such as Wechat Public Account Backend Automatic Reply, Calling OpenAI Agent to Use Tencent Service,etc. |
upload_time | 2024-10-20 13:48:39 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.4 |
license | None |
keywords |
tencent
wechat
qq
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# package: tencent
*** IMPORTANT LEGAL DISCLAIMER ***
"tencent" python package is not affiliated, endorsed, or vetted by Tencent Corporation. It's an open-source pakcage and crowd contributed API Wrapper of public available tencent products and services to help developers deploy and use these product or services easier. This package name is originally intended to serve as "ten cent(s)" or "one dime", quoted from one ex-Tencent-er.
Contributing API Wrapper to tencent pypi package, Visit Github [tencent package Github repo](https://github.com/AI-Hub-Admin/tencent) and follow the guidelines on forum [Tencent Pypi Developing Forum deepnlp.org](http://www.deepnlp.org/blog?category=tencent).
## Public Available API Wrappers
| API NAME | FUNCTIONS | Status |
| -------- | -------- | -------- |
| greeting | Greeting when import package | Prod |
| stock_price | Fetch Tencent Stock Price (HKEX: 700) Realtime Quote | Prod |
| WechatServerVeriAPI | Wechat Server Verification 微信公众号订阅号服务器验证 | Prod |
| WechatTextReplyBaseAPI | Wechat Message Text Reply 处理微信用户文本输入API的基类 | Prod |
| WechatImageReplyBaseAPI | Wechat Message Image Reply 处理微信用户图像输入基类API 基类 | Prod |
## Install
```
pip install tencent
```
## Usage
### Package Import Greeting
```
import tencent
tencent.greeting()
```
![tencent python package pony ma greeting preview](https://github.com/AI-Hub-Admin/tencent/blob/main/docs/greeting_ponyma.jpg?raw=true)
* note: if you want to display the greeting, just set variable START_SCREEN_ENABLE in constants.py to False
### Tencent(HKEX: 700) Stock Price Quote
```
import tencent
stock_dict = tencent.api("stock_price")
keys=["symbol", "avg_price", "high", "low", "change", "update_time", "market_capitalization", "source"]
print ("#### Tencent Stock Price #### ")
for key in keys:
if key in stock_dict:
print (key + "|" + stock_dict[key])
else:
print (key + "|" + "")
```
Output
```
symbol|700
avg_price|420.400 HKD
high|424.600 HKD
low|412.600 HKD
change|+3.400
update_time|16 Oct 2024 09:36
market_capitalization|3,901.15 B HKD
source|HKEX, https://www.hkex.com.hk/Market-Data/Securities-Prices/Equities/Equities-Quote?sym=700&sc_lang=en
```
### Wechat Public Account Backend Automatic Reply
微信公众号后台,python服务自动回复(文本/图像/语音),一键验证和服务部署,依赖Flask的python框架
see /examples/wechat/main.py
```
# start flask server backend
python ./examples/wechat/main.py
```
执行效果
![tencent wechat backend](https://github.com/AI-Hub-Admin/tencent/blob/main/docs/wechat_account_autoreply.png?raw=true)
### Open AI Completions APIs and pass Tencent APIs as function Schema
see /tests/test_agent_api_tools.py for more details
```
import json
import tencent
from tencent.utils.agent_utils import function_to_schema
def tencent_api_base(arg1, arg2, arg3, arg4="value4", arg5 = "value5"):
result = tencent.api("api_base", arg1, arg2, arg3, arg4=arg4, arg5 = arg5)
print ("DEBUG: tencent_api_base result %s" % str(result))
return result
def prepare_agent_api_schema():
tools = [tencent_api_base]
tool_schemas = [function_to_schema(tool) for tool in tools]
print ("DEBUG: Agent API Schema")
[print(json.dumps(schema, indent=2)) for schema in tool_schemas]
return tool_schemas
prepare_agent_api_schema()
def call_openai_api_tools():
"""
swarm, need openai keys
"""
tool_schemas = prepare_agent_api_schema()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Calling Tencent Service and Return Results"}],
tools=tool_schemas,
)
message = response.choices[0].message
message.tool_calls[0].function
call_openai_api_tools()
```
##### Blogs
[Tencent Python Package Contributing General Guidelines](http://www.deepnlp.org/blog/tencent-python-package-contributing-general-guidelines)
[Introduction to multimodal generative models](http://www.deepnlp.org/blog/introduction-to-multimodal-generative-models) <br>
[Generative AI Search Engine Optimization](http://www.deepnlp.org/blog/generative-ai-search-engine-optimization-how-to-improve-your-content) <br>
[AI Image Generator User Reviews](http://www.deepnlp.org/store/image-generator) <br>
[AI Video Generator User Reviews](http://www.deepnlp.org/store/video-generator) <br>
[AI Chatbot & Assistant Reviews](http://www.deepnlp.org/store/chatbot-assistant) <br>
[Best AI Tools User Reviews](http://www.deepnlp.org/store/pub/) <br>
## Related
### AI Services Reviews and Ratings <br>
[AI & Robotics User Reviews](http://www.deepnlp.org/store/) <br>
[AI & Robotics Best AI Tools List](http://www.deepnlp.org/store/pub/) <br>
##### Chatbot
[OpenAI o1 Reviews](http://www.deepnlp.org/store/pub/pub-openai-o1) <br>
[ChatGPT User Reviews](http://www.deepnlp.org/store/pub/pub-chatgpt-openai) <br>
[Gemini User Reviews](http://www.deepnlp.org/store/pub/pub-gemini-google) <br>
[Perplexity User Reviews](http://www.deepnlp.org/store/pub/pub-perplexity) <br>
[Claude User Reviews](http://www.deepnlp.org/store/pub/pub-claude-anthropic) <br>
[Qwen AI Reviews](http://www.deepnlp.org/store/pub/pub-qwen-alibaba) <br>
[Doubao Reviews](http://www.deepnlp.org/store/pub/pub-doubao-douyin) <br>
[ChatGPT Strawberry](http://www.deepnlp.org/store/pub/pub-chatgpt-strawberry) <br>
[Zhipu AI Reviews](http://www.deepnlp.org/store/pub/pub-zhipu-ai) <br>
##### AI Image Generation
[Midjourney User Reviews](http://www.deepnlp.org/store/pub/pub-midjourney) <br>
[Stable Diffusion User Reviews](http://www.deepnlp.org/store/pub/pub-stable-diffusion) <br>
[Runway User Reviews](http://www.deepnlp.org/store/pub/pub-runway) <br>
[GPT-5 Forecast](http://www.deepnlp.org/store/pub/pub-gpt-5) <br>
[Flux AI Reviews](http://www.deepnlp.org/store/pub/pub-flux-1-black-forest-lab) <br>
[Canva User Reviews](http://www.deepnlp.org/store/pub/pub-canva) <br>
##### AI Video Generation
[Luma AI](http://www.deepnlp.org/store/pub/pub-luma-ai) <br>
[Pika AI Reviews](http://www.deepnlp.org/store/pub/pub-pika) <br>
[Runway AI Reviews](http://www.deepnlp.org/store/pub/pub-runway) <br>
[Kling AI Reviews](http://www.deepnlp.org/store/pub/pub-kling-kwai) <br>
[Dreamina AI Reviews](http://www.deepnlp.org/store/pub/pub-dreamina-douyin) <br>
##### AI Education
[Coursera Reviews](http://www.deepnlp.org/store/pub/pub-coursera) <br>
[Udacity Reviews](http://www.deepnlp.org/store/pub/pub-udacity) <br>
[Grammarly Reviews](http://www.deepnlp.org/store/pub/pub-grammarly) <br>
##### Robotics
[Tesla Cybercab Robotaxi](http://www.deepnlp.org/store/pub/pub-tesla-cybercab) <br>
[Tesla Optimus](http://www.deepnlp.org/store/pub/pub-tesla-optimus) <br>
[Figure AI](http://www.deepnlp.org/store/pub/pub-figure-ai) <br>
[Unitree Robotics Reviews](http://www.deepnlp.org/store/pub/pub-unitree-robotics) <br>
[Waymo User Reviews](http://www.deepnlp.org/store/pub/pub-waymo-google) <br>
[ANYbotics Reviews](http://www.deepnlp.org/store/pub/pub-anybotics) <br>
[Boston Dynamics](http://www.deepnlp.org/store/pub/pub-boston-dynamic) <br>
##### AI Visualization Tools
[DeepNLP AI Tools](http://www.deepnlp.org/store/pub/pub-deepnlp-ai) <br>
[Multi-Turn Dialogue Visualization](http://www.deepnlp.org/workspace/dialogue_visualization) <br>
[Multi Asynchronous Agent Visualization](http://www.deepnlp.org/workspace/agent_visualization) <br>
##### AI Widgets
[Apple Glasses](http://www.deepnlp.org/store/pub/pub-apple-glasses) <br>
[Meta Glasses](http://www.deepnlp.org/store/pub/pub-meta-glasses) <br>
[Apple AR VR Headset](http://www.deepnlp.org/store/pub/pub-apple-ar-vr-headset) <br>
[Google Glass](http://www.deepnlp.org/store/pub/pub-google-glass) <br>
[Meta VR Headset](http://www.deepnlp.org/store/pub/pub-meta-vr-headset) <br>
[Google AR VR Headsets](http://www.deepnlp.org/store/pub/pub-google-ar-vr-headset) <br>
##### Social
[Character AI](http://www.deepnlp.org/store/pub/pub-character-ai) <br>
##### Self-Driving
[BYD Seal](http://www.deepnlp.org/store/pub/pub-byd-seal) <br>
[Tesla Model 3](http://www.deepnlp.org/store/pub/pub-tesla-model-3) <br>
[BMW i4](http://www.deepnlp.org/store/pub/pub-bmw-i4) <br>
[Baidu Apollo Reviews](http://www.deepnlp.org/store/pub/pub-baidu-apollo) <br>
[Hyundai IONIQ 6](http://www.deepnlp.org/store/pub/pub-hyundai-ioniq-6) <br>
Raw data
{
"_id": null,
"home_page": null,
"name": "tencent",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.4",
"maintainer_email": null,
"keywords": "tencent, Wechat, QQ",
"author": null,
"author_email": "dingo0927@126.com",
"download_url": null,
"platform": null,
"description": "# package: tencent\n\n*** IMPORTANT LEGAL DISCLAIMER ***\n\n\"tencent\" python package is not affiliated, endorsed, or vetted by Tencent Corporation. It's an open-source pakcage and crowd contributed API Wrapper of public available tencent products and services to help developers deploy and use these product or services easier. This package name is originally intended to serve as \"ten cent(s)\" or \"one dime\", quoted from one ex-Tencent-er.\n\n\nContributing API Wrapper to tencent pypi package, Visit Github [tencent package Github repo](https://github.com/AI-Hub-Admin/tencent) and follow the guidelines on forum [Tencent Pypi Developing Forum deepnlp.org](http://www.deepnlp.org/blog?category=tencent).\n\n\n## Public Available API Wrappers\n\n| API NAME | FUNCTIONS | Status |\n| -------- | -------- | -------- |\n| greeting | Greeting when import package | Prod |\n| stock_price | Fetch Tencent Stock Price (HKEX: 700) Realtime Quote | Prod |\n| WechatServerVeriAPI | Wechat Server Verification \u5fae\u4fe1\u516c\u4f17\u53f7\u8ba2\u9605\u53f7\u670d\u52a1\u5668\u9a8c\u8bc1 | Prod |\n| WechatTextReplyBaseAPI | Wechat Message Text Reply \u5904\u7406\u5fae\u4fe1\u7528\u6237\u6587\u672c\u8f93\u5165API\u7684\u57fa\u7c7b | Prod |\n| WechatImageReplyBaseAPI | Wechat Message Image Reply \u5904\u7406\u5fae\u4fe1\u7528\u6237\u56fe\u50cf\u8f93\u5165\u57fa\u7c7bAPI \u57fa\u7c7b | Prod |\n\n\n## Install\n```\npip install tencent\n```\n\n\n## Usage\n\n### Package Import Greeting\n```\nimport tencent\n\ntencent.greeting()\n\n```\n![tencent python package pony ma greeting preview](https://github.com/AI-Hub-Admin/tencent/blob/main/docs/greeting_ponyma.jpg?raw=true)\n\n\n* note: if you want to display the greeting, just set variable START_SCREEN_ENABLE in constants.py to False\n\n\n\n### Tencent(HKEX: 700) Stock Price Quote\n\n```\nimport tencent\n\nstock_dict = tencent.api(\"stock_price\")\nkeys=[\"symbol\", \"avg_price\", \"high\", \"low\", \"change\", \"update_time\", \"market_capitalization\", \"source\"]\nprint (\"#### Tencent Stock Price #### \")\nfor key in keys:\n if key in stock_dict:\n print (key + \"|\" + stock_dict[key])\n else:\n \tprint (key + \"|\" + \"\")\n```\n\nOutput\n\n```\n symbol|700\n avg_price|420.400 HKD\n high|424.600 HKD\n low|412.600 HKD\n change|+3.400\n update_time|16 Oct 2024 09:36\n market_capitalization|3,901.15 B HKD\n source|HKEX, https://www.hkex.com.hk/Market-Data/Securities-Prices/Equities/Equities-Quote?sym=700&sc_lang=en\n```\n\n\n### Wechat Public Account Backend Automatic Reply \n\n\u5fae\u4fe1\u516c\u4f17\u53f7\u540e\u53f0\uff0cpython\u670d\u52a1\u81ea\u52a8\u56de\u590d(\u6587\u672c/\u56fe\u50cf/\u8bed\u97f3)\uff0c\u4e00\u952e\u9a8c\u8bc1\u548c\u670d\u52a1\u90e8\u7f72\uff0c\u4f9d\u8d56Flask\u7684python\u6846\u67b6\n\nsee /examples/wechat/main.py\n\n\n```\n # start flask server backend\n python ./examples/wechat/main.py\n```\n\n\n\u6267\u884c\u6548\u679c\n\n![tencent wechat backend](https://github.com/AI-Hub-Admin/tencent/blob/main/docs/wechat_account_autoreply.png?raw=true)\n\n\n\n### Open AI Completions APIs and pass Tencent APIs as function Schema\n\nsee /tests/test_agent_api_tools.py for more details\n\n```\n\n\nimport json\nimport tencent\nfrom tencent.utils.agent_utils import function_to_schema\n\ndef tencent_api_base(arg1, arg2, arg3, arg4=\"value4\", arg5 = \"value5\"):\n result = tencent.api(\"api_base\", arg1, arg2, arg3, arg4=arg4, arg5 = arg5)\n print (\"DEBUG: tencent_api_base result %s\" % str(result))\n return result\n\ndef prepare_agent_api_schema():\n tools = [tencent_api_base]\n\n tool_schemas = [function_to_schema(tool) for tool in tools]\n print (\"DEBUG: Agent API Schema\")\n [print(json.dumps(schema, indent=2)) for schema in tool_schemas]\n \n return tool_schemas\n\nprepare_agent_api_schema()\n\n\ndef call_openai_api_tools():\n \"\"\"\n swarm, need openai keys\n \"\"\"\n tool_schemas = prepare_agent_api_schema()\n\n response = client.chat.completions.create(\n model=\"gpt-4o-mini\",\n messages=[{\"role\": \"user\", \"content\": \"Calling Tencent Service and Return Results\"}],\n tools=tool_schemas,\n )\n message = response.choices[0].message\n message.tool_calls[0].function\n\n\ncall_openai_api_tools()\n\n```\n\n\n\n\n##### Blogs\n[Tencent Python Package Contributing General Guidelines](http://www.deepnlp.org/blog/tencent-python-package-contributing-general-guidelines)\n[Introduction to multimodal generative models](http://www.deepnlp.org/blog/introduction-to-multimodal-generative-models) <br>\n[Generative AI Search Engine Optimization](http://www.deepnlp.org/blog/generative-ai-search-engine-optimization-how-to-improve-your-content) <br>\n[AI Image Generator User Reviews](http://www.deepnlp.org/store/image-generator) <br>\n[AI Video Generator User Reviews](http://www.deepnlp.org/store/video-generator) <br>\n[AI Chatbot & Assistant Reviews](http://www.deepnlp.org/store/chatbot-assistant) <br>\n[Best AI Tools User Reviews](http://www.deepnlp.org/store/pub/) <br>\n\n\n## Related\n### AI Services Reviews and Ratings <br>\n[AI & Robotics User Reviews](http://www.deepnlp.org/store/) <br>\n[AI & Robotics Best AI Tools List](http://www.deepnlp.org/store/pub/) <br>\n##### Chatbot\n[OpenAI o1 Reviews](http://www.deepnlp.org/store/pub/pub-openai-o1) <br>\n[ChatGPT User Reviews](http://www.deepnlp.org/store/pub/pub-chatgpt-openai) <br>\n[Gemini User Reviews](http://www.deepnlp.org/store/pub/pub-gemini-google) <br>\n[Perplexity User Reviews](http://www.deepnlp.org/store/pub/pub-perplexity) <br>\n[Claude User Reviews](http://www.deepnlp.org/store/pub/pub-claude-anthropic) <br>\n[Qwen AI Reviews](http://www.deepnlp.org/store/pub/pub-qwen-alibaba) <br>\n[Doubao Reviews](http://www.deepnlp.org/store/pub/pub-doubao-douyin) <br>\n[ChatGPT Strawberry](http://www.deepnlp.org/store/pub/pub-chatgpt-strawberry) <br>\n[Zhipu AI Reviews](http://www.deepnlp.org/store/pub/pub-zhipu-ai) <br>\n##### AI Image Generation\n[Midjourney User Reviews](http://www.deepnlp.org/store/pub/pub-midjourney) <br>\n[Stable Diffusion User Reviews](http://www.deepnlp.org/store/pub/pub-stable-diffusion) <br>\n[Runway User Reviews](http://www.deepnlp.org/store/pub/pub-runway) <br>\n[GPT-5 Forecast](http://www.deepnlp.org/store/pub/pub-gpt-5) <br>\n[Flux AI Reviews](http://www.deepnlp.org/store/pub/pub-flux-1-black-forest-lab) <br>\n[Canva User Reviews](http://www.deepnlp.org/store/pub/pub-canva) <br>\n##### AI Video Generation\n[Luma AI](http://www.deepnlp.org/store/pub/pub-luma-ai) <br>\n[Pika AI Reviews](http://www.deepnlp.org/store/pub/pub-pika) <br>\n[Runway AI Reviews](http://www.deepnlp.org/store/pub/pub-runway) <br>\n[Kling AI Reviews](http://www.deepnlp.org/store/pub/pub-kling-kwai) <br>\n[Dreamina AI Reviews](http://www.deepnlp.org/store/pub/pub-dreamina-douyin) <br>\n##### AI Education\n[Coursera Reviews](http://www.deepnlp.org/store/pub/pub-coursera) <br>\n[Udacity Reviews](http://www.deepnlp.org/store/pub/pub-udacity) <br>\n[Grammarly Reviews](http://www.deepnlp.org/store/pub/pub-grammarly) <br>\n##### Robotics\n[Tesla Cybercab Robotaxi](http://www.deepnlp.org/store/pub/pub-tesla-cybercab) <br>\n[Tesla Optimus](http://www.deepnlp.org/store/pub/pub-tesla-optimus) <br>\n[Figure AI](http://www.deepnlp.org/store/pub/pub-figure-ai) <br>\n[Unitree Robotics Reviews](http://www.deepnlp.org/store/pub/pub-unitree-robotics) <br>\n[Waymo User Reviews](http://www.deepnlp.org/store/pub/pub-waymo-google) <br>\n[ANYbotics Reviews](http://www.deepnlp.org/store/pub/pub-anybotics) <br>\n[Boston Dynamics](http://www.deepnlp.org/store/pub/pub-boston-dynamic) <br>\n##### AI Visualization Tools\n[DeepNLP AI Tools](http://www.deepnlp.org/store/pub/pub-deepnlp-ai) <br>\n[Multi-Turn Dialogue Visualization](http://www.deepnlp.org/workspace/dialogue_visualization) <br>\n[Multi Asynchronous Agent Visualization](http://www.deepnlp.org/workspace/agent_visualization) <br>\n##### AI Widgets\n[Apple Glasses](http://www.deepnlp.org/store/pub/pub-apple-glasses) <br>\n[Meta Glasses](http://www.deepnlp.org/store/pub/pub-meta-glasses) <br>\n[Apple AR VR Headset](http://www.deepnlp.org/store/pub/pub-apple-ar-vr-headset) <br>\n[Google Glass](http://www.deepnlp.org/store/pub/pub-google-glass) <br>\n[Meta VR Headset](http://www.deepnlp.org/store/pub/pub-meta-vr-headset) <br>\n[Google AR VR Headsets](http://www.deepnlp.org/store/pub/pub-google-ar-vr-headset) <br>\n##### Social\n[Character AI](http://www.deepnlp.org/store/pub/pub-character-ai) <br>\n##### Self-Driving\n[BYD Seal](http://www.deepnlp.org/store/pub/pub-byd-seal) <br>\n[Tesla Model 3](http://www.deepnlp.org/store/pub/pub-tesla-model-3) <br>\n[BMW i4](http://www.deepnlp.org/store/pub/pub-bmw-i4) <br>\n[Baidu Apollo Reviews](http://www.deepnlp.org/store/pub/pub-baidu-apollo) <br>\n[Hyundai IONIQ 6](http://www.deepnlp.org/store/pub/pub-hyundai-ioniq-6) <br>\n",
"bugtrack_url": null,
"license": null,
"summary": "Contributed API Collections of Tencent Product and Services, such as Wechat Public Account Backend Automatic Reply, Calling OpenAI Agent to Use Tencent Service,etc.",
"version": "1.0.5",
"project_urls": {
"homepage": "http://www.deepnlp.org/blog?category=tencent",
"repository": "https://github.com/AI-Hub-Admin/tencent"
},
"split_keywords": [
"tencent",
" wechat",
" qq"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "de157f0867041f2ce197e41b1f4f1923767840352a3a5dda264b65baa4ec81c2",
"md5": "d083bf2a7df2ea8189812be2d0cbf593",
"sha256": "b940e69b474ece003af489fe747854cf53e643cfcca72668cc14d7027cafc284"
},
"downloads": -1,
"filename": "tencent-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d083bf2a7df2ea8189812be2d0cbf593",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.4",
"size": 16746,
"upload_time": "2024-10-20T13:48:39",
"upload_time_iso_8601": "2024-10-20T13:48:39.541578Z",
"url": "https://files.pythonhosted.org/packages/de/15/7f0867041f2ce197e41b1f4f1923767840352a3a5dda264b65baa4ec81c2/tencent-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-20 13:48:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AI-Hub-Admin",
"github_project": "tencent",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tencent"
}