Skip to main content

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 and follow the guidelines on forum Tencent Pypi Developing Forum deepnlp.org.

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

  • 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

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 Introduction to multimodal generative models
Generative AI Search Engine Optimization
AI Image Generator User Reviews
AI Video Generator User Reviews
AI Chatbot & Assistant Reviews
Best AI Tools User Reviews

Related

AI Services Reviews and Ratings

AI & Robotics User Reviews
AI & Robotics Best AI Tools List

Chatbot

OpenAI o1 Reviews
ChatGPT User Reviews
Gemini User Reviews
Perplexity User Reviews
Claude User Reviews
Qwen AI Reviews
Doubao Reviews
ChatGPT Strawberry
Zhipu AI Reviews

AI Image Generation

Midjourney User Reviews
Stable Diffusion User Reviews
Runway User Reviews
GPT-5 Forecast
Flux AI Reviews
Canva User Reviews

AI Video Generation

Luma AI
Pika AI Reviews
Runway AI Reviews
Kling AI Reviews
Dreamina AI Reviews

AI Education

Coursera Reviews
Udacity Reviews
Grammarly Reviews

Robotics

Tesla Cybercab Robotaxi
Tesla Optimus
Figure AI
Unitree Robotics Reviews
Waymo User Reviews
ANYbotics Reviews
Boston Dynamics

AI Visualization Tools

DeepNLP AI Tools
Multi-Turn Dialogue Visualization
Multi Asynchronous Agent Visualization

AI Widgets

Apple Glasses
Meta Glasses
Apple AR VR Headset
Google Glass
Meta VR Headset
Google AR VR Headsets

Social

Character AI

Self-Driving

BYD Seal
Tesla Model 3
BMW i4
Baidu Apollo Reviews
Hyundai IONIQ 6

Metadata

Release files for tencent 1.0.5

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

Built distribution (wheel)

Table of built distributions (wheels) for tencent 1.0.5
File Interpreter ABI Platform
tencent-1.0.5-py3-none-any.whl Python 3 none any Details

Release files / tencent-1.0.5-py3-none-any.whl

Download URL tencent-1.0.5-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b940e69b474ece003af489fe747854cf53e643cfcca72668cc14d7027cafc284
BLAKE2b-256 checksum
How to use checksums
de157f0867041f2ce197e41b1f4f1923767840352a3a5dda264b65baa4ec81c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file

1.0.4

1 release file

1.0.3

1 release file

0.0.1

1 release file

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