AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

无法接入大模型

Open Chbaoo opened this issue 1 year ago • 1 comments

个人号 napcat 在AstrBot仪表盘中无法接入大模型

日志: [16:58:24] [Core] [ERRO] [provider.manager:356]: 实例化 openai_chat_completion(siliconflow) 提供商适配器失败:The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable [17:04:05] [Core] [INFO] [provider.manager:176]: 载入 openai_chat_completion(siliconflow) 服务提供商 ... [17:04:05] [Core] [ERRO] [provider.manager:355]: Traceback (most recent call last): File "C:\Users\chengbao\Desktop\AstrBotLauncher-0.1.5.6\AstrBot\astrbot\core\provider\manager.py", line 322, in load_provider inst = provider_metadata.cls_type( File "C:\Users\chengbao\Desktop\AstrBotLauncher-0.1.5.6\AstrBot\astrbot\core\provider\sources\openai_source.py", line 63, in init self.client = AsyncOpenAI( File "C:\Users\chengbao\Desktop\AstrBotLauncher-0.1.5.6\AstrBot\venv\lib\site-packages\openai_client.py", line 427, in init raise OpenAIError( openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

[17:04:05] [Core] [ERRO] [provider.manager:356]: 实例化 openai_chat_completion(siliconflow) 提供商适配器失败:The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

Chbaoo avatar Jun 20 '25 09:06 Chbaoo

请设置api key

Raven95676 avatar Jun 20 '25 13:06 Raven95676