{"record":{"id":"7ec6b9eb793313ad","repo":"iflytek/astron-agent","slug":"serviceparamserror","errorCode":"ServiceParamsError","errorMessage":"讯飞开放平台 is not configured. Please configure it in Platform Account Management first.","messagePattern":"讯飞开放平台 is not configured\\. Please configure it in Platform Account Management first\\.","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"core/plugin/aitools/platform_account_config.py","lineNumber":29,"sourceCode":"IFLYTEK_OPEN_PLATFORM_CACHE_KEY = \"platform_account_text:iflytek_open_platform\"\nPLATFORM_ACCOUNT_CATEGORY = \"PLATFORM_ACCOUNT\"\nIFLYTEK_OPEN_PLATFORM_CODE = \"IFLYTEK_OPEN_PLATFORM\"\n\n_REDIS_CLIENT = None\n\n\n@dataclass(frozen=True)\nclass IflytekOpenPlatformCredentials:\n    app_id: str\n    api_key: str\n    api_secret: str\n\n\ndef get_iflytek_open_platform_credentials() -> IflytekOpenPlatformCredentials:\n    raw_config = _load_from_redis() or _load_from_database()\n    credentials = _parse_credentials(raw_config)\n    if credentials is None:\n        raise ServiceException.from_error_code(\n            CodeEnums.ServiceParamsError,\n            extra_message=(\n                \"讯飞开放平台 is not configured. \"\n                \"Please configure it in Platform Account Management first.\"\n            ),\n        )\n    return credentials\n\n\ndef get_iflytek_open_platform_app_id(default: str = \"\") -> str:\n    try:\n        return get_iflytek_open_platform_credentials().app_id\n    except ServiceException:\n        return default\n\n\ndef _load_from_redis() -> Optional[str]:\n    try:","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/plugin/aitools/platform_account_config.py#L11-L47","documentation":"ServiceParamsError from get_iflytek_open_platform_credentials means no iFlytek Open Platform credentials could be loaded from Redis or the database, or the stored config failed parsing. Every iFlytek-dependent service (image gen, OCR, TTS, ISE, image understanding) calls this first and fails fast.","triggerScenarios":"Calling any iflytek service function when no credentials row exists in the database, the Redis cache is empty, or _parse_credentials returns None due to missing/blank app_id/api_key/api_secret fields.","commonSituations":"Fresh deployment where Platform Account Management was never configured, wrong tenant/space so the config lookup returns nothing, Redis flushed or database migration not run, partially saved credentials.","solutions":["Configure the 讯飞开放平台 credentials in Platform Account Management (console UI) and retry.","Verify the Redis key / database row holding the credentials exists and is non-empty.","Check that you are operating in the correct tenant/space where credentials were saved.","Confirm app_id, api_key, and api_secret are all present in the stored config so parsing succeeds."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"async def iflytek_configured() -> bool:\n    from core.plugin.aitools.platform_account_config import _load_from_redis, _load_from_database, _parse_credentials\n    return _parse_credentials(_load_from_redis() or _load_from_database()) is not None","typeGuard":null,"tryCatchPattern":"try:\n    creds = get_iflytek_open_platform_credentials()\nexcept ServiceException as e:\n    return error_response('讯飞开放平台 not configured; set credentials in Platform Account Management', 400)","preventionTips":["Configure iFlytek credentials before deploying dependent features","Verify Redis cache and DB row after saving credentials","Check tenant/space matches where credentials were stored","Add a startup readiness check for required platform configs"],"tags":["configuration","credentials","iflytek"],"backgroundTag":"missing-credentials","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}