{"record":{"id":"6fe9bccc978f962e","repo":"binary-husky/gpt_academic","slug":"yunque-secret-key","errorCode":null,"errorMessage":"请配置YUNQUE_SECRET_KEY","messagePattern":"请配置YUNQUE_SECRET_KEY","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"request_llms/bridge_skylark2.py","lineNumber":22,"sourceCode":"\nmodel_name = '云雀大模型'\n\ndef validate_key():\n    YUNQUE_SECRET_KEY = get_conf(\"YUNQUE_SECRET_KEY\")\n    if YUNQUE_SECRET_KEY == '': return False\n    return True\n\ndef predict_no_ui_long_connection(inputs:str, llm_kwargs:dict, history:list=[], sys_prompt:str=\"\",\n                                  observe_window:list=[], console_silence:bool=False):\n    \"\"\"\n        ⭐ 多线程方法\n        函数的说明请见 request_llms/bridge_all.py\n    \"\"\"\n    watch_dog_patience = 5\n    response = \"\"\n\n    if validate_key() is False:\n        raise RuntimeError('请配置YUNQUE_SECRET_KEY')\n\n    from .com_skylark2api import YUNQUERequestInstance\n    sri = YUNQUERequestInstance()\n    for response in sri.generate(inputs, llm_kwargs, history, sys_prompt):\n        if len(observe_window) >= 1:\n            observe_window[0] = response\n        if len(observe_window) >= 2:\n            if (time.time()-observe_window[1]) > watch_dog_patience: raise RuntimeError(\"程序终止。\")\n    return response\n\ndef predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_prompt='', stream = True, additional_fn=None):\n    \"\"\"\n        ⭐ 单线程方法\n        函数的说明请见 request_llms/bridge_all.py\n    \"\"\"\n    chatbot.append((inputs, \"\"))\n    yield from update_ui(chatbot=chatbot, history=history)\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/binary-husky/gpt_academic/blob/d6bde0fa54373309bd05823a49bda8da019d2c77/request_llms/bridge_skylark2.py#L4-L40","documentation":"RuntimeError from bridge_skylark2.predict_no_ui_long_connection: validate_key() returned False, meaning the YUNQUE_SECRET_KEY configuration (Volcano Engine / Doubao Skylark2 credentials) is missing or empty. The check runs before YUNQUERequestInstance is created, so no network call is made - this is a fail-fast configuration guard.","triggerScenarios":"Selecting a skylark2 model without setting YUNQUE_SECRET_KEY in config_private.py; key set under a different name or in the wrong file; deployment env missing the variable.","commonSituations":"Trying Doubao/Skylark models after seeing them in the model list but never configuring Volcano Engine credentials; config typo (YUNQUE_SECRET_KEY vs Skylark API key naming).","solutions":["Set YUNQUE_SECRET_KEY in config_private.py with your Volcano Engine Skylark2 secret key and restart","Verify the variable name matches exactly what get_conf reads","If Skylark was not intended, switch the model selection to a configured provider"],"exampleFix":"# config_private.py\n# before\nYUNQUE_SECRET_KEY = \"\"\n\n# after\nYUNQUE_SECRET_KEY = \"your-skylark2-secret\"","handlingStrategy":"validation","validationCode":"from shared_utils.config_loader import get_conf\nsecret = get_conf('YUNQUE_SECRET_KEY')\nassert secret and len(secret) > 0, 'skylark2 model selected but YUNQUE_SECRET_KEY is unset'","typeGuard":"def skylark2_configured() -> bool:\n    return len(get_conf('YUNQUE_SECRET_KEY')) > 0","tryCatchPattern":"try:\n    result = predict_no_ui_long_connection(...)\nexcept RuntimeError as e:\n    if 'YUNQUE_SECRET_KEY' in str(e):\n        raise SystemExit('Set YUNQUE_SECRET_KEY in config_private.py to use skylark2 models') from e","preventionTips":["Filter skylark2 models out of the UI dropdown when the key is unconfigured","Run a config-completeness check at startup mapping model prefixes to required keys","Keep Volcano Engine credentials in config_private.py"],"tags":["skylark2","volcano","configuration","credentials","api-key"],"backgroundTag":null,"analyzedSha":"d6bde0fa54373309bd05823a49bda8da019d2c77","analyzedAt":"2026-08-14T22:48:35.038Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}