Open asynchat opened 3 days ago
langchain-core = "^0.2.10" langchain-community = "^0.2.6"
以下是可能的一些解决方案:
import os
from langchain_community.chat_models import QianfanChatEndpoint
from langchain_core.language_models.chat_models import HumanMessage
os.environ["QIANFAN_ACCESS_KEY"] = "your_access_key" os.environ["QIANFAN_SECRET_KEY"] = "your_secret_key"
chat = QianfanChatEndpoint(streaming=True) messages = [HumanMessage(content="Hello")] resp = chat.invoke(messages)
2. 不检验证书(可能存在中间人攻击等安全风险):
```python
import os
os.environ["QIANFAN_SSL_VERIFICATION_ENABLED"]="False"
System Info
python 3.11, qianfan = "^0.3.18"
Reproduction
[INFO][2024-07-01 20:46:04.483] oauth.py:252 [t:8502742016]: trying to refresh access_token for ak
qXoGNC[ERROR][2024-07-01 20:46:05.535] oauth.py:265 [t:8502742016]: refresh access token failed with exception Cannot connect to host aip.baidubce.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')] [WARNING][2024-07-01 20:46:05.536] oauth.py:134 [t:8502742016]: access token is not available for ak
qXoGNC[INFO][2024-07-01 20:46:05.536] oauth.py:252 [t:8502742016]: trying to refresh access_token for ak
qXoGNC[ERROR][2024-07-01 20:46:05.765] oauth.py:265 [t:8502742016]: refresh access token failed with exception Cannot connect to host aip.baidubce.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')] Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x13d09e9d0> [WARNING][2024-07-01 20:46:05.768] oauth.py:134 [t:8502742016]: access token is not available for ak
qXoGNCUnclosed client session client_session: <aiohttp.client.ClientSession object at 0x13cf70c10>