Skip to main content

Contributed API Collections of Tencent Product and Services, such as Wechat Public Account Automatic Reply, Calling OpenAI Agent to Use Tencent Service,etc.

Project description

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
TBD Wechat Public Account Backend Automatic Reply Dev

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

TBD

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()

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

Blogs

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

tencent-1.0.4-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file tencent-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: tencent-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for tencent-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c1bcaf11c7084bce2622ed00aece210511feb3e04b2e3263290540b0a4633593
MD5 357aab7ed9cbcf0efa61e386d62a1442
BLAKE2b-256 d7d7b97e3c3c9ba0698694cc0040ad0d5c83fcfe1b0e4c767dc2e5f75fd1412a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page