PaddlePaddle / ERNIE-SDK

ERNIE Bot Agent is a Large Language Model (LLM) Agent Framework, powered by the advanced capabilities of ERNIE Bot and the platform resources of Baidu AI Studio.
http://ernie-bot-agent.readthedocs.io/
Apache License 2.0
324 stars 48 forks source link

星河社区的token(令牌)采用智能体包中的ERNIEBot访问时报[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')(在Aistudio中调用是正常的) #330

Closed zhougx88 closed 3 months ago

zhougx88 commented 3 months ago

星河社区的token(令牌)采用智能体包中的(from erniebot_agent.chat_models import ERNIEBot)ERNIEBot访问时报[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')错误。而采用erniebot包时正常。 代码: os.environ["EB_AGENT_LOGGING_LEVEL"] = "INFO" # 这个是日志包 os.environ["EB_AGENT_ACCESS_TOKEN"] = "****" # 这是星河社区的token(令牌)输入你自己的token async def func(): ai_message = await model.chat(messages=messages) print(ai_message.content)

asyncio.run(func()) 错误: /home/ernie/bin/python /home/ernie/erniebot/2.py Traceback (most recent call last): File "/home/ernie/lib/python3.10/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) File "/home/zhougx/python3.10/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection transport, protocol = await self._create_connection_transport( File "/home/zhougx/python3.10/lib/python3.10/asyncio/base_events.py", line 1119, in _create_connection_transport await waiter File "/home/zhougx/python3.10/lib/python3.10/asyncio/sslproto.py", line 534, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/home/zhougx/python3.10/lib/python3.10/asyncio/sslproto.py", line 188, in feed_ssldata self._sslobj.do_handshake() File "/home/zhougx/python3.10/lib/python3.10/ssl.py", line 975, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

itagan commented 3 months ago

python运行报错 certificate verify failed: unable to get local issuer certifi https://www.cnblogs.com/zhaoyingjie/p/17807094.html

itagan commented 3 months ago

参考这个弄弄

zhougx88 commented 3 months ago

多谢!已经解决

itagan commented 3 months ago

👌