{"id":28368,"library":"tencentcloud-sdk-python-tiia","title":"Tencent Cloud TIAA SDK for Python","description":"Tencent Cloud TIAA SDK for Python provides image analysis capabilities including image recognition, content moderation, and image search. Current version 3.1.69. Releases follow TencentCloud SDK release cadence with occasional breaking changes due to API updates.","status":"active","version":"3.1.69","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","tiia","image-analysis","sdk"],"install":[{"cmd":"pip install tencentcloud-sdk-python-tiia","lang":"bash","label":"Install TIAA SDK"}],"dependencies":[{"reason":"Required for authentication and common client functionality","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Use tiia_client module directly","wrong":"from tencentcloud.tiia.v20190529.tiia_client import TiiaClient","symbol":"TiiaClient","correct":"from tencentcloud.tiia.v20190529 import tiia_client"},{"note":"Must specify API version","wrong":"from tencentcloud.tiia import models","symbol":"models","correct":"from tencentcloud.tiia.v20190529 import models"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.tiia.v20190529 import tiia_client, models\n\nsecret_id = os.environ.get('TENCENTCLOUD_SECRET_ID', '')\nsecret_key = os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n\ncred = credential.Credential(secret_id, secret_key)\nclient = tiia_client.TiiaClient(cred, \"ap-guangzhou\")\n\nreq = models.AssessQualityRequest()\nreq.ImageUrl = \"https://example.com/image.jpg\"\n\ntry:\n    resp = client.AssessQuality(req)\n    print(resp.to_json_string())\nexcept TencentCloudSDKException as e:\n    print(e)","lang":"python","description":"Instantiates a TIAA client with credentials from environment variables and calls AssessQuality on an image URL."},"warnings":[{"fix":"Use 'from tencentcloud.tiia.v20190529 import tiia_client' instead of 'from tencentcloud.tiia import tiia_client'.","message":"Always specify the API version (v20190529) in imports. Many examples omit it, causing ImportError.","severity":"gotcha","affected_versions":"all"},{"fix":"Import as 'from tencentcloud.tiia.v20190529 import tiia_client' and use 'tiia_client.TiiaClient'.","message":"In version 3.x, the client class name changed from 'TiiaClient' to 'tiia_client.TiiaClient' due to automatic code generation. Older code using 'TiiaClient' directly may break if package structure changes.","severity":"breaking","affected_versions":"3.x"},{"fix":"Use new method names as per API docs (e.g., 'RecognizeImage' instead of 'DetectCelebrity').","message":"Some old methods (e.g., 'DetectCelebrity') are deprecated. Check the official API documentation for current methods.","severity":"deprecated","affected_versions":"all"},{"fix":"Set environment variables with correct names.","message":"The environment variables for credentials are 'TENCENTCLOUD_SECRET_ID' and 'TENCENTCLOUD_SECRET_KEY', not 'SECRET_ID' or others. Common mistake leads to auth failure.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'from tencentcloud.tiia.v20190529 import tiia_client' and then instantiate 'tiia_client.TiiaClient()'.","cause":"Incorrect import path. The client is inside 'tiia_client' module.","error":"ImportError: cannot import name 'TiiaClient' from 'tencentcloud.tiia.v20190529.tiia_client'"},{"fix":"Use a supported region like 'ap-guangzhou' or check TIAA region availability.","cause":"The TIAA service is not available in the selected region (e.g., ap-shanghai).","error":"TencentCloudSDKException: [TencentCloudSDKException] code: UnsupportedOperation, message: this action is not supported in this region"},{"fix":"Add 'from tencentcloud.tiia.v20190529 import models'.","cause":"Forgot to import models separately.","error":"AttributeError: module 'tencentcloud.tiia.v20190529' has no attribute 'models'"},{"fix":"Set 'TENCENTCLOUD_SECRET_ID' and 'TENCENTCLOUD_SECRET_KEY' environment variables, or pass them directly to Credential() constructor.","cause":"Credentials not provided or missing from environment.","error":"TypeError: __init__() missing 2 required positional arguments: 'secret_id' and 'secret_key'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}